Removes the "Show Line Numbers" option from the PHPEclipse preferences and sets the...
authormbowie <mbowie>
Fri, 6 Jun 2008 05:52:00 +0000 (05:52 +0000)
committermbowie <mbowie>
Fri, 6 Jun 2008 05:52:00 +0000 (05:52 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/PHPUIMessages.properties
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/JavaEditorPreferencePage.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/preferences/PreferencesMessages.properties
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java

index e8bbead..e1e7d3f 100644 (file)
@@ -298,9 +298,7 @@ PHPEditorPreferencePage.codeAssist=Code A&ssist
 PHPEditorPreferencePage.change=C&hange...
 PHPEditorPreferencePage.empty_input=Empty input
 PHPEditorPreferencePage.invalid_input=''{0}'' is not a valid input.
-PHPEditorPreferencePage.showLineNumbers=Show lin&e numbers
 PHPEditorPreferencePage.lineNumberColor=Line number foreground color:
-PHPEditorPreferencePage.lineNumberForegroundColor=Line number foreground
 PHPEditorPreferencePage.matchingBracketsHighlightColor2=Matching brackets highlight
 PHPEditorPreferencePage.currentLineHighlighColor=Current line highlight
 PHPEditorPreferencePage.printMarginColor2=Print margin
index e1700c5..7c6e28f 100644 (file)
@@ -67,21 +67,26 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
 import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.TabItem;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
 import org.eclipse.ui.texteditor.AnnotationPreference;
 import org.eclipse.ui.texteditor.ChainedPreferenceStore;
 import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
 
+
 /**
  * The page for setting the editor options.
  */
@@ -185,11 +190,6 @@ public class JavaEditorPreferencePage extends PreferencePage implements
        private final String[][] fAppearanceColorListModel = new String[][] {
                        {
                                        PreferencesMessages
-                                                       .getString("JavaEditorPreferencePage.lineNumberForegroundColor"),
-                                       AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR },
-                       //$NON-NLS-1$
-                       {
-                                       PreferencesMessages
                                                        .getString("JavaEditorPreferencePage.matchingBracketsHighlightColor2"),
                                        PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR },
                        //$NON-NLS-1$
@@ -558,14 +558,6 @@ public class JavaEditorPreferencePage extends PreferencePage implements
                                .add(new OverlayPreferenceStore.OverlayKey(
                                                OverlayPreferenceStore.BOOLEAN,
                                                AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER));
-               overlayKeys
-                               .add(new OverlayPreferenceStore.OverlayKey(
-                                               OverlayPreferenceStore.STRING,
-                                               AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR));
-               overlayKeys
-                               .add(new OverlayPreferenceStore.OverlayKey(
-                                               OverlayPreferenceStore.BOOLEAN,
-                                               AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER));
                overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
                                OverlayPreferenceStore.BOOLEAN,
                                PreferenceConstants.EDITOR_SPACES_FOR_TABS));
@@ -984,7 +976,28 @@ public class JavaEditorPreferencePage extends PreferencePage implements
                GridLayout layout = new GridLayout();
                layout.numColumns = 2;
                appearanceComposite.setLayout(layout);
+               
+               // Inserts a hyper-link to the General Editor preferences page
+               // TODO Can probably be removed post 1.5.0?
                String label = PreferencesMessages
+                               .getString("JavaEditorPreferencePage.appearanceTabLink");
+               Link link = new Link(appearanceComposite, SWT.NONE);
+               GridData gridPosition = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+               gridPosition.horizontalSpan = 2;
+               link.setLayoutData(gridPosition);
+               
+               link.setText(label);
+               link.addListener(SWT.Selection, new Listener () {
+                       public void handleEvent(Event event) {
+                               String u = event.text;
+                               PreferencesUtil.createPreferenceDialogOn(getShell(), u, null, null);
+                       }
+               });
+               String tooltip = PreferencesMessages
+                               .getString("JavaEditorPreferencePage.appearanceTabTooltip");
+               link.setToolTipText(tooltip);           
+                       
+               label = PreferencesMessages
                                .getString("JavaEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$
                addTextField(appearanceComposite, label,
                                PreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true);
@@ -1003,13 +1016,6 @@ public class JavaEditorPreferencePage extends PreferencePage implements
                                AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER,
                                0);
                label = PreferencesMessages
-                               .getString("JavaEditorPreferencePage.showLineNumbers"); //$NON-NLS-1$
-               addCheckBox(
-                               appearanceComposite,
-                               label,
-                               AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER,
-                               0);
-               label = PreferencesMessages
                                .getString("JavaEditorPreferencePage.highlightMatchingBrackets"); //$NON-NLS-1$
                addCheckBox(appearanceComposite, label,
                                PreferenceConstants.EDITOR_MATCHING_BRACKETS, 0);
index 4884b64..7a0486e 100644 (file)
@@ -80,6 +80,9 @@ NewJavaProjectPreferencePage.folders.error.invalidsrcname=Invalid source folder
 NewJavaProjectPreferencePage.folders.error.invalidbinname=Invalid output folder name: {0}
 NewJavaProjectPreferencePage.folders.error.invalidcp=Settings will result in an invalid build path. Check for nested folders.
 
+JavaEditorPreferencePage.appearanceTabLink=Some general preferences now live on the Eclipse <a href="org.eclipse.ui.preferencePages.GeneralTextEditor">Text Editors</a> pages.
+JavaEditorPreferencePage.appearanceTabTooltip=Jump to the Text Editors page
+
 JavaEditorPreferencePage.annotationsTab.title= Annotation&s
 JavaEditorPreferencePage.showQuickFixables= Indicate annotations solvable with &Quick Fix in vertical ruler
 JavaEditorPreferencePage.analyseAnnotationsWhileTyping= Analyze annotations &while typing
@@ -160,8 +163,6 @@ JavaEditorPreferencePage.colors=Synta&x
 JavaEditorPreferencePage.codeAssist= &Code Assist
 JavaEditorPreferencePage.empty_input=Empty input
 JavaEditorPreferencePage.invalid_input=''{0}'' is not a valid input.
-JavaEditorPreferencePage.showLineNumbers=Show lin&e numbers
-JavaEditorPreferencePage.lineNumberForegroundColor=Line number foreground
 JavaEditorPreferencePage.matchingBracketsHighlightColor2=Matching brackets highlight
 JavaEditorPreferencePage.currentLineHighlighColor=Current line highlight
 JavaEditorPreferencePage.printMarginColor2=Print margin
index 1dfe2cf..60f8e03 100644 (file)
@@ -1091,29 +1091,6 @@ public class PreferenceConstants {
        public final static String EDITOR_OVERVIEW_RULER = "overviewRuler"; //$NON-NLS-1$
 
        /**
-        * A named preference that controls if the line number ruler is shown in the
-        * UI.
-        * <p>
-        * Value is of type <code>Boolean</code>.
-        * </p>
-        */
-       public final static String EDITOR_LINE_NUMBER_RULER = "lineNumberRuler"; //$NON-NLS-1$
-
-       /**
-        * A named preference that holds the color used to render line numbers
-        * inside the line number ruler.
-        * <p>
-        * Value is of type <code>String</code>. A RGB color value encoded as a
-        * string using class <code>PreferenceConverter</code>
-        * </p>
-        * 
-        * @see org.eclipse.jface.resource.StringConverter
-        * @see org.eclipse.jface.preference.PreferenceConverter
-        * @see #EDITOR_LINE_NUMBER_RULER
-        */
-       public final static String EDITOR_LINE_NUMBER_RULER_COLOR = "lineNumberColor"; //$NON-NLS-1$
-
-       /**
         * A named preference that holds the color used to render linked positions
         * inside code templates.
         * <p>
@@ -2760,11 +2737,6 @@ public class PreferenceConstants {
 
                store.setDefault(PreferenceConstants.EDITOR_OVERVIEW_RULER, true);
 
-               store.setDefault(PreferenceConstants.EDITOR_LINE_NUMBER_RULER, false);
-               PreferenceConverter.setDefault(store,
-                               PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, new RGB(0,
-                                               0, 0));
-
                // WorkbenchChainedTextFontFieldEditor.startPropagate(store,
                // JFaceResources.TEXT_FONT);
 
index 0a09a2e..e8de8e0 100644 (file)
@@ -3063,12 +3063,6 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements
         */
        private boolean fStickyOccurrenceAnnotations;
 
-       /** Preference key for showing the line number ruler */
-       // private final static String LINE_NUMBER_RULER =
-       // PreferenceConstants.EDITOR_LINE_NUMBER_RULER;
-       /** Preference key for the foreground color of the line numbers */
-       // private final static String LINE_NUMBER_COLOR =
-       // PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR;
        /** Preference key for the link color */
        private final static String LINK_COLOR = PreferenceConstants.EDITOR_LINK_COLOR;