Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Dahyabhai2020-04-08 02:58:50 +0000
committerNitin Dahyabhai2020-04-08 02:58:50 +0000
commit627d05f96ca4337330cf72151a9a2adc509f7870 (patch)
tree91d1c2dcde293a677f478eb5a5401edd2aad4bbb
parent55253971b5a5caf110070b4a7965179e9bb06aff (diff)
downloadwebtools.sourceediting-627d05f96ca4337330cf72151a9a2adc509f7870.tar.gz
webtools.sourceediting-627d05f96ca4337330cf72151a9a2adc509f7870.tar.xz
webtools.sourceediting-627d05f96ca4337330cf72151a9a2adc509f7870.zip
[561347] Move hover modifiers back to a central preference
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AppearancePreferenceNames.java2
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/StructuredTextEditorPreferencePage.java28
2 files changed, 23 insertions, 7 deletions
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AppearancePreferenceNames.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AppearancePreferenceNames.java
index 4f4ceb3bc1..ff93923f51 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AppearancePreferenceNames.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AppearancePreferenceNames.java
@@ -122,7 +122,7 @@ public final class AppearancePreferenceNames {
}
/**
- * A named preference that defines the key for the hover modifiers.
+ * A named preference that defines the key for the hover modifiers. Not yet used.
* <p>
* Value is of type <code>String</code>.
* </p>
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/StructuredTextEditorPreferencePage.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/StructuredTextEditorPreferencePage.java
index dca3d93330..113efce91e 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/StructuredTextEditorPreferencePage.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/StructuredTextEditorPreferencePage.java
@@ -154,6 +154,13 @@ public class StructuredTextEditorPreferencePage extends PreferencePage implement
private OverlayPreferenceStore fOverlayStore;
private IPreferenceTab[] fTabs = null;
+ /*
+ * Unless/until the hover management can be broken out into a per-plug-in
+ * setup rather than a singleton in SSSE UI, the Hover preferences need to
+ * remain in one place only
+ */
+ private boolean showHoverTab = true;
+
public StructuredTextEditorPreferencePage() {
// subject to be overridden via initialization data
setDescription(SSEUIMessages.StructuredTextEditorPreferencePage_6); // $NON-NLS-1$
@@ -320,7 +327,10 @@ public class StructuredTextEditorPreferencePage extends PreferencePage implement
protected Control createContents(Composite parent) {
// need to create tabs before loading/starting overlaystore in case
// tabs also add values
- IPreferenceTab hoversTab = new TextHoverPreferenceTab(this, fOverlayStore);
+ IPreferenceTab hoversTab = null;
+ if (showHoverTab) {
+ hoversTab = new TextHoverPreferenceTab(this, fOverlayStore);
+ }
fOverlayStore.load();
fOverlayStore.start();
@@ -333,12 +343,17 @@ public class StructuredTextEditorPreferencePage extends PreferencePage implement
item.setText(SSEUIMessages.StructuredTextEditorPreferencePage_0); // $NON-NLS-1$
item.setControl(createAppearancePage(folder));
- item = new TabItem(folder, SWT.NONE);
- item.setText(hoversTab.getTitle());
- item.setControl(hoversTab.createContents(folder));
-
- fTabs = new IPreferenceTab[]{hoversTab};
+ if (hoversTab != null) {
+ item = new TabItem(folder, SWT.NONE);
+ item.setText(hoversTab.getTitle());
+ item.setControl(hoversTab.createContents(folder));
+ fTabs = new IPreferenceTab[]{hoversTab};
+ }
+ else {
+ fTabs = new IPreferenceTab[0];
+ }
+
initialize();
Dialog.applyDialogFont(folder);
@@ -507,6 +522,7 @@ public class StructuredTextEditorPreferencePage extends PreferencePage implement
if (PREFERENCE_SCOPE_NAME.equalsIgnoreCase(entry.getKey().toString())) {
setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, entry.getValue().toString().toLowerCase(Locale.US)));
fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
+ showHoverTab = false;
}
if (DESCRIPTION.equalsIgnoreCase(entry.getKey().toString())) {
setDescription(entry.getValue().toString());

Back to the top