Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2003-10-27 15:26:49 +0000
committerDani Megert2003-10-27 15:26:49 +0000
commit0ca16a55db531e7fe836106d73d921eeb6ecbe2a (patch)
tree921905bb05de0a0e79d40f092e2a1168f9a5eea4
parent6c5c25957891a8a8bbf89b830a702ff2663e3f7f (diff)
downloadeclipse.platform.text-0ca16a55db531e7fe836106d73d921eeb6ecbe2a.tar.gz
eclipse.platform.text-0ca16a55db531e7fe836106d73d921eeb6ecbe2a.tar.xz
eclipse.platform.text-0ca16a55db531e7fe836106d73d921eeb6ecbe2a.zip
Implemented feature 45509: Allow to disable icons in vertical ruler
-rw-r--r--org.eclipse.search/plugin.xml2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties1
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java35
-rw-r--r--org.eclipse.ui.workbench.texteditor/plugin.xml16
-rw-r--r--org.eclipse.ui.workbench.texteditor/schema/markerAnnotationSpecification.exsd16
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java54
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java13
7 files changed, 133 insertions, 4 deletions
diff --git a/org.eclipse.search/plugin.xml b/org.eclipse.search/plugin.xml
index 32310d611..123c27e99 100644
--- a/org.eclipse.search/plugin.xml
+++ b/org.eclipse.search/plugin.xml
@@ -188,6 +188,8 @@
highlightPreferenceValue="false"
overviewRulerPreferenceKey="searchResultIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="searchResultIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="searchResultIndicationColor"
colorPreferenceValue="192,192,192"
presentationLayer="3"
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
index c4af8b565..377799a1e 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
@@ -25,6 +25,7 @@ TextEditorPreferencePage.annotations.others= Others
TextEditorPreferencePage.annotations.showInText= Show in &text
TextEditorPreferencePage.annotations.highlightInText= &Highlight in text
TextEditorPreferencePage.annotations.showInOverviewRuler= Show in overview &ruler
+TextEditorPreferencePage.annotations.showInVerticalRuler= Show in vertical r&uler
TextEditorPreferencePage.annotations.color= C&olor:
TextEditorPreferencePage.general=Appeara&nce
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
index bdfed4cae..6e5d1e0d6 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
@@ -109,6 +109,7 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
private Button fShowInTextCheckBox;
private Button fHighlightInTextCheckBox;
private Button fShowInOverviewRulerCheckBox;
+ private Button fShowInVerticalRulerCheckBox;
private String[][] fQuickDiffProviderListModel;
@@ -134,6 +135,8 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
if (info.getHighlightPreferenceKey() != null)
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
+ if (info.getVerticalRulerPreferenceKey() != null)
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getVerticalRulerPreferenceKey()));
}
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR));
@@ -161,7 +164,7 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
Iterator e= preferences.getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference info= (AnnotationPreference) e.next();
- listModelItems.add(new String[] { info.getPreferenceLabel(), info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey()});
+ listModelItems.add(new String[] { info.getPreferenceLabel(), info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey()});
}
String[][] items= new String[listModelItems.size()][];
listModelItems.toArray(items);
@@ -229,6 +232,15 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
fHighlightInTextCheckBox.setEnabled(true);
} else
fHighlightInTextCheckBox.setEnabled(false);
+
+ key= fAnnotationColorListModel[i][5];
+ if (key != null) {
+ fShowInVerticalRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
+ fShowInVerticalRulerCheckBox.setEnabled(true);
+ } else {
+ fShowInVerticalRulerCheckBox.setSelection(true);
+ fShowInVerticalRulerCheckBox.setEnabled(false);
+ }
}
private void handleProviderListSelection() {
@@ -477,6 +489,13 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
gd.horizontalAlignment= GridData.BEGINNING;
gd.horizontalSpan= 2;
fShowInOverviewRulerCheckBox.setLayoutData(gd);
+
+ fShowInVerticalRulerCheckBox= new Button(optionsComposite, SWT.CHECK);
+ fShowInVerticalRulerCheckBox.setText(TextEditorMessages.getString("TextEditorPreferencePage.annotations.showInVerticalRuler")); //$NON-NLS-1$
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan= 2;
+ fShowInVerticalRulerCheckBox.setLayoutData(gd);
label= new Label(optionsComposite, SWT.LEFT);
label.setText(TextEditorMessages.getString("TextEditorPreferencePage.annotations.color")); //$NON-NLS-1$
@@ -535,7 +554,19 @@ public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbe
fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
}
});
-
+
+ fShowInVerticalRulerCheckBox.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ int i= fAnnotationList.getSelectionIndex();
+ String key= fAnnotationColorListModel[i][5];
+ fOverlayStore.setValue(key, fShowInVerticalRulerCheckBox.getSelection());
+ }
+ });
+
foregroundColorButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
// do nothing
diff --git a/org.eclipse.ui.workbench.texteditor/plugin.xml b/org.eclipse.ui.workbench.texteditor/plugin.xml
index b16dd48ae..28f9f582a 100644
--- a/org.eclipse.ui.workbench.texteditor/plugin.xml
+++ b/org.eclipse.ui.workbench.texteditor/plugin.xml
@@ -297,6 +297,8 @@
textPreferenceValue="true"
overviewRulerPreferenceKey="errorIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="errorIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="errorIndicationColor"
colorPreferenceValue="255,0,128"
presentationLayer="6"
@@ -317,6 +319,8 @@
textPreferenceValue="true"
overviewRulerPreferenceKey="warningIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="warningIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="warningIndicationColor"
colorPreferenceValue="244,200,45"
presentationLayer="5"
@@ -336,6 +340,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="infoIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="infoIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="infoIndicationColor"
colorPreferenceValue="244,200,45"
presentationLayer="4"
@@ -355,6 +361,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="taskIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="taskIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="taskIndicationColor"
colorPreferenceValue="0,128,255"
presentationLayer="2"
@@ -374,6 +382,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="bookmarkIndicationInOverviewRuler"
overviewRulerPreferenceValue="true"
+ verticalRulerPreferenceKey="bookmarkIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="bookmarkIndicationColor"
colorPreferenceValue="34,164,99"
presentationLayer="1"
@@ -395,6 +405,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="changeIndicationInOverviewRuler"
overviewRulerPreferenceValue="false"
+ verticalRulerPreferenceKey="changeIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="changeIndicationColor"
colorPreferenceValue="204,163,205"
presentationLayer="2"
@@ -414,6 +426,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="additionIndicationInOverviewRuler"
overviewRulerPreferenceValue="false"
+ verticalRulerPreferenceKey="additionIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="additionIndicationColor"
colorPreferenceValue="188,188,222"
presentationLayer="2"
@@ -433,6 +447,8 @@
textPreferenceValue="false"
overviewRulerPreferenceKey="deletionIndicationInOverviewRuler"
overviewRulerPreferenceValue="false"
+ verticalRulerPreferenceKey="deletionIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"
colorPreferenceKey="deletionIndicationColor"
colorPreferenceValue="0,0,0"
presentationLayer="2"
diff --git a/org.eclipse.ui.workbench.texteditor/schema/markerAnnotationSpecification.exsd b/org.eclipse.ui.workbench.texteditor/schema/markerAnnotationSpecification.exsd
index 5134465fb..192ecf245 100644
--- a/org.eclipse.ui.workbench.texteditor/schema/markerAnnotationSpecification.exsd
+++ b/org.eclipse.ui.workbench.texteditor/schema/markerAnnotationSpecification.exsd
@@ -62,6 +62,14 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="verticalRulerPreferenceKey" type="string">
+ <annotation>
+ <documentation>
+ The preference key for the show in vertical ruler preference.
+since: 3.0
+ </documentation>
+ </annotation>
+ </attribute>
<attribute name="textPreferenceKey" type="string" use="required">
<annotation>
<documentation>
@@ -123,6 +131,14 @@ since: 3.0
</documentation>
</annotation>
</attribute>
+ <attribute name="verticalRulerPreferenceValue" type="boolean">
+ <annotation>
+ <documentation>
+ The default value for showing in vertical ruler.
+since: 3.0
+ </documentation>
+ </annotation>
+ </attribute>
<attribute name="textPreferenceValue" type="boolean">
<annotation>
<documentation>
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
index 0924fc870..a514147b9 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
@@ -70,6 +70,16 @@ public class AnnotationPreference {
private String fOverviewRulerKey;
/** The default visibility in the overview ruler */
private boolean fOverviewRulerValue;
+ /**
+ * The preference key for the visibility in the vertical ruler.
+ * @since 3.0
+ */
+ private String fVerticalRulerKey;
+ /**
+ * The default visibility in the vertical ruler.
+ * @since 3.0
+ */
+ private boolean fVerticalRulerValue;
/** The presentation layer */
private int fPresentationLayer;
/** Indicates whether the annotation type contributed to the overview ruler's header */
@@ -138,7 +148,7 @@ public class AnnotationPreference {
public boolean isPreferenceKey(String key) {
if (key == null)
return false;
- return key.equals(fColorKey) || key.equals(fOverviewRulerKey) || key.equals(fTextKey) || key.equals(fHighlightKey);
+ return key.equals(fColorKey) || key.equals(fOverviewRulerKey) || key.equals(fTextKey) || key.equals(fHighlightKey) || key.equals(fVerticalRulerKey);
}
/**
@@ -203,7 +213,27 @@ public class AnnotationPreference {
public boolean getOverviewRulerPreferenceValue() {
return fOverviewRulerValue;
}
-
+
+ /**
+ * Returns the preference key for the visibility in the vertical ruler.
+ *
+ * @return the preference key for the visibility in the vertical ruler
+ * @since 3.0
+ */
+ public String getVerticalRulerPreferenceKey() {
+ return fVerticalRulerKey;
+ }
+
+ /**
+ * Returns the default visibility in the vertical ruler.
+ *
+ * @return the default visibility in the vertical ruler
+ * @since 3.0
+ */
+ public boolean getVerticalRulerPreferenceValue() {
+ return fVerticalRulerValue;
+ }
+
/**
* Returns the presentation layer.
*
@@ -333,6 +363,26 @@ public class AnnotationPreference {
}
/**
+ * Sets the preference key for the visibility in the vertical ruler.
+ *
+ * @param verticalRulerKey the preference key
+ * @since 3.0
+ */
+ public void setVerticalRulerPreferenceKey(String verticalRulerKey) {
+ fVerticalRulerKey= verticalRulerKey;
+ }
+
+ /**
+ * Sets the default visibility in the vertical ruler.
+ *
+ * @param verticalRulerValue <code>true</code> if visible by default, <code>false</code> otherwise
+ * @since 3.0
+ */
+ public void setVerticalRulerPreferenceValue(boolean verticalRulerValue) {
+ fVerticalRulerValue= verticalRulerValue;
+ }
+
+ /**
* Sets the presentation layer.
*
* @param presentationLayer the presentation layer
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java
index 8884f8195..f2a152028 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java
@@ -174,6 +174,17 @@ public class MarkerAnnotationPreferences {
b= StringConverter.asBoolean(s, false);
info.setOverviewRulerPreferenceValue(b);
+ s= element.getAttribute("verticalRulerPreferenceKey"); //$NON-NLS-1$
+ if (s == null || s.trim().length() == 0)
+ s= null;
+ info.setVerticalRulerPreferenceKey(s);
+
+ b= false;
+ s= element.getAttribute("verticalRulerPreferenceValue"); //$NON-NLS-1$
+ if (s != null && s.trim().length() > 0)
+ b= StringConverter.asBoolean(s, true);
+ info.setVerticalRulerPreferenceValue(b);
+
s= element.getAttribute("colorPreferenceKey"); //$NON-NLS-1$
if (s == null || s.trim().length() == 0) return null;
info.setColorPreferenceKey(s);
@@ -245,6 +256,8 @@ public class MarkerAnnotationPreferences {
AnnotationPreference info= (AnnotationPreference) e.next();
store.setDefault(info.getTextPreferenceKey(), info.getTextPreferenceValue());
store.setDefault(info.getOverviewRulerPreferenceKey(), info.getOverviewRulerPreferenceValue());
+ if (info.getVerticalRulerPreferenceKey() != null)
+ store.setDefault(info.getVerticalRulerPreferenceKey(), info.getVerticalRulerPreferenceValue());
PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue());
if (info.getShowInNextPrevDropdownToolbarActionKey() != null)
store.setDefault(info.getShowInNextPrevDropdownToolbarActionKey(), info.isShowInNextPrevDropdownToolbarAction());

Back to the top