Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2014-09-30 16:53:38 -0400
committerIan Trimble2014-09-30 16:53:38 -0400
commit3b7e25151f7ff028844b1fbab5b09ab1e13b9c77 (patch)
tree0f741297352aa55093adf3b64fbf23b466094f7c
parent1650337988d34e7e960d5ed6899ef6624b0ca32e (diff)
downloadwebtools.jsf-3b7e25151f7ff028844b1fbab5b09ab1e13b9c77.tar.gz
webtools.jsf-3b7e25151f7ff028844b1fbab5b09ab1e13b9c77.tar.xz
webtools.jsf-3b7e25151f7ff028844b1fbab5b09ab1e13b9c77.zip
Bug 436642 - [WPE] Provide user preference to show/hide Preview page
Bug 442006 - Allow IWPEPersistanceListeners the opportunity to cancel save, save as, and revert operations
-rw-r--r--jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml2
-rw-r--r--jsf/features/org.eclipse.jst.webpageeditor.feature/pom.xml2
-rw-r--r--jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/feature.xml2
-rw-r--r--jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/pom.xml2
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF2
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/pom.xml2
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IWPEPersistenceListener.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferencePage.java15
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferences.java118
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.java4
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.properties3
12 files changed, 231 insertions, 39 deletions
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml b/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml
index f4ca06a2b..617af3df1 100644
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml
+++ b/jsf/features/org.eclipse.jst.webpageeditor.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jst.webpageeditor.feature"
label="%featureName"
- version="2.6.1.qualifier"
+ version="2.7.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.license"
diff --git a/jsf/features/org.eclipse.jst.webpageeditor.feature/pom.xml b/jsf/features/org.eclipse.jst.webpageeditor.feature/pom.xml
index 26d42b7eb..302581db6 100644
--- a/jsf/features/org.eclipse.jst.webpageeditor.feature/pom.xml
+++ b/jsf/features/org.eclipse.jst.webpageeditor.feature/pom.xml
@@ -22,7 +22,7 @@
<groupId>org.eclipse.webtools.jsf</groupId>
<artifactId>org.eclipse.jst.webpageeditor.feature</artifactId>
- <version>2.6.1-SNAPSHOT</version>
+ <version>2.7.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
diff --git a/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/feature.xml b/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/feature.xml
index 6043254b2..556ec7ceb 100644
--- a/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/feature.xml
+++ b/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jst.webpageeditor_sdk.feature"
label="%featureName"
- version="2.6.1.qualifier"
+ version="2.7.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="1.0.1.qualifier">
diff --git a/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/pom.xml b/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/pom.xml
index 35a7a6522..1af1d59f3 100644
--- a/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/pom.xml
+++ b/jsf/features/org.eclipse.jst.webpageeditor_sdk.feature/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.jsf</groupId>
<artifactId>org.eclipse.jst.webpageeditor_sdk.feature</artifactId>
- <version>2.6.1-SNAPSHOT</version>
+ <version>2.7.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF
index 8d18a46ed..29ae6b093 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-SymbolicName: org.eclipse.jst.pagedesigner;singleton:=true
Bundle-Name: %pluginName
-Bundle-Version: 1.6.100.qualifier
+Bundle-Version: 1.7.0.qualifier
Bundle-Activator: org.eclipse.jst.pagedesigner.PDPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/pom.xml b/jsf/plugins/org.eclipse.jst.pagedesigner/pom.xml
index 4277216e2..626e15e60 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/pom.xml
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.jsf</groupId>
<artifactId>org.eclipse.jst.pagedesigner</artifactId>
- <version>1.6.100-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java
index 6b9c42184..23d05fcc2 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java
@@ -14,6 +14,7 @@ package org.eclipse.jst.pagedesigner.editors;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -26,6 +27,8 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.ui.views.palette.PalettePage;
@@ -76,6 +79,7 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.part.MultiPageEditorSite;
import org.eclipse.ui.part.MultiPageSelectionProvider;
@@ -137,7 +141,7 @@ public final class HTMLEditor extends MultiPageEditorPart implements
private SashEditorPart _sashEditorPart = null;
- private int _previewPageIndex;
+ private int _previewPageIndex = -1;
/** The design viewer */
private SimpleGraphicalEditor _designViewer;
@@ -456,7 +460,35 @@ public final class HTMLEditor extends MultiPageEditorPart implements
tabbed_createAndAddDesignSourcePage();
}
connectDesignPage();
- createAndAddPreviewPage();
+
+ //show preview page unless preference is hiding for content type
+ boolean showPreviewPage = true;
+ final IEditorInput input = getEditorInput();
+ if (input instanceof FileEditorInput) {
+ final IFile file = ((FileEditorInput)input).getFile();
+ if (file != null) {
+ try {
+ final IContentDescription description = file.getContentDescription();
+ if (description != null) {
+ final IContentType type = description.getContentType();
+ if (type != null) {
+ final String id = type.getId();
+ if (id != null && id.length() > 0) {
+ if (Arrays.binarySearch(PDPreferences.getHiddenPreviewPageContentTypes(), id) > -1) {
+ showPreviewPage = false;
+ }
+ }
+ }
+ }
+ } catch (CoreException cEx) {
+ //do nothing
+ }
+ }
+ }
+ if (showPreviewPage) {
+ createAndAddPreviewPage();
+ }
+
DesignerSourceMouseTrackAdapter adapter = new DesignerSourceMouseTrackAdapter(
_textEditor, getEditDomain());
_textEditor.getTextViewer().getTextWidget().addMouseListener(
@@ -484,8 +516,10 @@ public final class HTMLEditor extends MultiPageEditorPart implements
return new DesignerStructuredTextEditorJSP() {
@Override
protected void performRevert() {
- super.performRevert();
- firePersistenceEvent(PersistenceEventType.REVERTED);
+ if (firePersistenceEvent(PersistenceEventType.BEFORE_REVERT)) {
+ super.performRevert();
+ firePersistenceEvent(PersistenceEventType.REVERTED);
+ }
}
};
}
@@ -545,8 +579,12 @@ public final class HTMLEditor extends MultiPageEditorPart implements
}
public void doSave(IProgressMonitor monitor) {
- _textEditor.doSave(monitor);
- firePersistenceEvent(PersistenceEventType.SAVED);
+ if (firePersistenceEvent(PersistenceEventType.BEFORE_SAVE)) {
+ _textEditor.doSave(monitor);
+ firePersistenceEvent(PersistenceEventType.SAVED);
+ } else {
+ monitor.setCanceled(true);
+ }
}
/*
@@ -558,8 +596,10 @@ public final class HTMLEditor extends MultiPageEditorPart implements
* @see IEditorPart
*/
public void doSaveAs() {
- _textEditor.doSaveAs();
- firePersistenceEvent(PersistenceEventType.SAVED_AS);
+ if (firePersistenceEvent(PersistenceEventType.BEFORE_SAVE_AS)) {
+ _textEditor.doSaveAs();
+ firePersistenceEvent(PersistenceEventType.SAVED_AS);
+ }
}
private void editorInputIsAcceptable(IEditorInput input)
@@ -1276,10 +1316,16 @@ public final class HTMLEditor extends MultiPageEditorPart implements
}
}
- private void firePersistenceEvent(final PersistenceEventType type) {
+ /**
+ * @param type
+ * @return <code>true</code> if operation is to continue, otherwise <code>false</code>
+ */
+ private boolean firePersistenceEvent(final PersistenceEventType type) {
if (persistenceListeners != null) {
List<IWPEPersistenceListener> listeners = new ArrayList<IWPEPersistenceListener>(persistenceListeners);
- IPersistenceEvent event = new IPersistenceEvent() {
+ IPersistenceEvent event = new IPersistenceEvent() {
+ private boolean cancelled;
+
public HTMLEditor getWPEInstance() {
return HTMLEditor.this;
}
@@ -1287,6 +1333,14 @@ public final class HTMLEditor extends MultiPageEditorPart implements
public PersistenceEventType getEventType() {
return type;
}
+
+ public boolean isOperationCancelled() {
+ return cancelled;
+ }
+
+ public void cancelOperation() {
+ cancelled = true;
+ }
};
for (IWPEPersistenceListener listener : listeners) {
@@ -1296,7 +1350,9 @@ public final class HTMLEditor extends MultiPageEditorPart implements
PDPlugin.log("Exception thrown while notifying a persistence listener", e); //$NON-NLS-1$
}
}
+ return !event.isOperationCancelled();
}
+ return true;
}
/**
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IWPEPersistenceListener.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IWPEPersistenceListener.java
index af319bc27..49dd84435 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IWPEPersistenceListener.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/IWPEPersistenceListener.java
@@ -1,37 +1,52 @@
package org.eclipse.jst.pagedesigner.editors;
/**
- * Listens for persistence events fired from WPE instances, including
- * save and revert.
+ * Listens for persistence events fired from WPE instances, including save and revert.
*/
public interface IWPEPersistenceListener {
+
/**
* The type of the persistence event.
*
*/
public static enum PersistenceEventType {
/**
+ * WPE is about to be saved. A listener may request that this operation be cancelled.
+ */
+ BEFORE_SAVE,
+
+ /**
* WPE was saved
*/
SAVED,
/**
+ * WPE is about to be saved as. A listener may request that this operation be cancelled.
+ */
+ BEFORE_SAVE_AS,
+
+ /**
* WPE was saved as
*/
SAVED_AS,
/**
+ * WPE is about to be reverted. A listener may request that this operation be cancelled.
+ */
+ BEFORE_REVERT,
+
+ /**
* WPE was reverted.
*/
REVERTED;
- }
+ }
/**
* A persistence event.
*
* <p>Not intended to be implemented by clients.</p>
- */
- public static interface IPersistenceEvent {
+ */
+ public static interface IPersistenceEvent {
/**
* @return editor
*/
@@ -40,13 +55,24 @@ public interface IWPEPersistenceListener {
/**
* @return EventType
*/
- public PersistenceEventType getEventType();
+ public PersistenceEventType getEventType();
+
+ /**
+ * A listener requests that all further processing of the operation be stopped after this
+ * event has first been sent to all listeners.
+ */
+ public void cancelOperation();
+
+ /**
+ * @return <code>true</code> if a listener has requested that the operation be cancelled.
+ */
+ public boolean isOperationCancelled();
}
/**
* A persistence event has occurred
- * @param event
- */
+ * @param event
+ */
public void notify(IPersistenceEvent event);
}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferencePage.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferencePage.java
index 1be27be38..0fdd71092 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferencePage.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferencePage.java
@@ -14,6 +14,7 @@ package org.eclipse.jst.pagedesigner.ui.preferences;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jst.pagedesigner.PDPlugin;
import org.eclipse.jst.pagedesigner.utils.EditorUtil;
import org.eclipse.swt.SWT;
@@ -101,6 +102,11 @@ public final class PDPreferencePage extends FieldEditorPreferencePage implements
PDPreferences.CSS_USE_ARTIFICAL_CELL_PADDING,
PreferenceMessages.EditorPreferences_LABEL_CSSArtificalCellPadding,
_cssLayoutGroup);
+
+ addStringField(
+ PDPreferences.HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES,
+ PreferenceMessages.EditorPreferences_LABEL_HidePreviewPageForContentTypes,
+ getFieldEditorParent());
}
@@ -150,4 +156,11 @@ public final class PDPreferencePage extends FieldEditorPreferencePage implements
addField(f);
return f;
}
-} \ No newline at end of file
+
+ private StringFieldEditor addStringField(String name, String labelText, Composite parent)
+ {
+ StringFieldEditor f = new StringFieldEditor(name, labelText, parent);
+ addField(f);
+ return f;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferences.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferences.java
index b2dda7a85..78a97072a 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferences.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PDPreferences.java
@@ -7,6 +7,8 @@
*******************************************************************************/
package org.eclipse.jst.pagedesigner.ui.preferences;
+import java.util.Arrays;
+
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jst.pagedesigner.PDPlugin;
@@ -39,6 +41,12 @@ public class PDPreferences extends AbstractPreferenceInitializer {
.getName()
+ ".CSSEnableAbsolutePositioning"; //$NON-NLS-1$
/**
+ * Content types (as comma-delimited String) for which to hide preview page (default is the empty String).
+ */
+ public static final String HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES = PDPreferences.class.
+ getName() +
+ ".hidePreviewPageForContentTypes"; //$NON-NLS-1$
+ /**
* The default value for absolute positioning enablement
*/
public static final boolean DEFAULT_CSS_ENABLE_ABSOLUTE_POSITIONING = false;
@@ -46,10 +54,24 @@ public class PDPreferences extends AbstractPreferenceInitializer {
* The default value for artificial cell padding.
*/
public static final int DEFAULT_CSS_USE_ARTIFICIAL_CELL_PADDING = 4;
+ /**
+ * Default value for content types for which to hide preview page.
+ */
+ public static final String DEFAULT_HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES = ""; //$NON-NLS-1$
- private static IPreferenceStore getPreferenceStore()
+ @Override
+ public void initializeDefaultPreferences()
{
- return PDPlugin.getDefault().getPreferenceStore();
+ // Set default HTML editor split vertical (i.e. with top and bottom
+ // pane)
+ IPreferenceStore store = getPreferenceStore();
+ store.setDefault(SASH_EDITOR_MODE_PREF, HTMLEditor.MODE_SASH_VERTICAL);
+ store.setDefault(CSS_USE_ARTIFICAL_CELL_PADDING,
+ DEFAULT_CSS_USE_ARTIFICIAL_CELL_PADDING);
+ store.setDefault(CSS_ENABLE_ABSOLUTE_POSITIONING,
+ DEFAULT_CSS_ENABLE_ABSOLUTE_POSITIONING);
+ store.setDefault(HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES,
+ DEFAULT_HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES);
}
/**
@@ -70,16 +92,86 @@ public class PDPreferences extends AbstractPreferenceInitializer {
return store.getInt(CSS_USE_ARTIFICAL_CELL_PADDING);
}
- @Override
- public void initializeDefaultPreferences()
+ /**
+ * Get list of content types for which to hide preview page.
+ * @return Content types (as String array) for which to hide preview page.
+ */
+ public static String[] getHiddenPreviewPageContentTypes()
{
- // Set default HTML editor split vertical (i.e. with top and bottom
- // pane)
- IPreferenceStore store = getPreferenceStore();
- store.setDefault(SASH_EDITOR_MODE_PREF, HTMLEditor.MODE_SASH_VERTICAL);
- store.setDefault(CSS_USE_ARTIFICAL_CELL_PADDING,
- DEFAULT_CSS_USE_ARTIFICIAL_CELL_PADDING);
- store.setDefault(CSS_ENABLE_ABSOLUTE_POSITIONING,
- DEFAULT_CSS_ENABLE_ABSOLUTE_POSITIONING);
+ String[] hiddenTypes = new String[0];
+ final IPreferenceStore store = getPreferenceStore();
+ final String hiddenTypesString = store.getString(HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES);
+ if (hiddenTypesString != null && hiddenTypesString.length() > 0)
+ {
+ hiddenTypes = hiddenTypesString.split(","); //$NON-NLS-1$
+ }
+ return hiddenTypes;
+ }
+
+ /**
+ * Adds content type to list of types for which to hide preview page.
+ * @param contentTypeId Content type to add to list.
+ */
+ public static void addHiddenPreviewPageContentType(String contentTypeId)
+ {
+ if (contentTypeId != null && contentTypeId.length() > 0)
+ {
+ final String[] hiddenContentTypes = getHiddenPreviewPageContentTypes();
+ if (Arrays.binarySearch(hiddenContentTypes, contentTypeId) < 0)
+ {
+ String hiddenTypesString = arrayToString(hiddenContentTypes);
+ if (hiddenTypesString.length() > 0)
+ {
+ hiddenTypesString = hiddenTypesString.concat(","); //$NON-NLS-1$
+ }
+ hiddenTypesString = hiddenTypesString.concat(contentTypeId.trim());
+ final IPreferenceStore store = getPreferenceStore();
+ store.setValue(HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES, hiddenTypesString);
+ }
+ }
+ }
+
+ /**
+ * Removes content type from list of types for which to hide preview page.
+ * @param contentTypeId Content type to remove from list.
+ */
+ public static void removeHiddenPreviewPageContentType(String contentTypeId)
+ {
+ if (contentTypeId != null && contentTypeId.length() > 0) {
+ final String[] hiddenContentTypes = getHiddenPreviewPageContentTypes();
+ if (Arrays.binarySearch(hiddenContentTypes, contentTypeId) >= 0)
+ {
+ final String hiddenTypesString = arrayToString(hiddenContentTypes);
+ hiddenTypesString.replace(contentTypeId, ""); //$NON-NLS-1$
+ hiddenTypesString.replace(",,", ","); //$NON-NLS-1$ //$NON-NLS-2$
+ final IPreferenceStore store = getPreferenceStore();
+ store.setValue(HIDE_PREVIEW_PAGE_FOR_CONTENT_TYPES, hiddenTypesString);
+ }
+ }
+ }
+
+ private static IPreferenceStore getPreferenceStore()
+ {
+ return PDPlugin.getDefault().getPreferenceStore();
+ }
+
+ private static String arrayToString(String[] array)
+ {
+ String string = ""; //$NON-NLS-1$
+ if (array != null && array.length > 0)
+ {
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < array.length; i++)
+ {
+ if (i > 0)
+ {
+ builder.append(',');
+ }
+ builder.append(array[i]);
+ }
+ string = builder.toString();
+ }
+ return string;
}
-} \ No newline at end of file
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.java
index 0caaeeecb..325f5cd3f 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.java
@@ -17,6 +17,10 @@ import org.eclipse.osgi.util.NLS;
* See PreferenceMessages.properties
*/
public static String EditorPreferences_LABEL_CSSEnableAbsolutePositioning;
+ /**
+ * See PreferenceMessages.properties
+ */
+ public static String EditorPreferences_LABEL_HidePreviewPageForContentTypes;
private PreferenceMessages() {
// Do not instantiate
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.properties b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.properties
index c7c72051b..bb722c8ce 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.properties
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/ui/preferences/PreferenceMessages.properties
@@ -1,3 +1,4 @@
PDPreferences_description=Preferences for the design page of Web Page Editor.
EditorPreferences_LABEL_CSSArtificalCellPadding=Add Artificial Padding Around Containers:
-EditorPreferences_LABEL_CSSEnableAbsolutePositioning=Enable Absolute CSS Position \ No newline at end of file
+EditorPreferences_LABEL_CSSEnableAbsolutePositioning=Enable Absolute CSS Position
+EditorPreferences_LABEL_HidePreviewPageForContentTypes=Hide Preview Page for Content Types (comma-delimited): \ No newline at end of file

Back to the top