X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java index 95b7d94..a66dd95 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java @@ -15,14 +15,14 @@ import net.sourceforge.phpdt.internal.ui.text.spelling.SpellCheckEngine; import net.sourceforge.phpdt.internal.ui.text.spelling.engine.ISpellCheckPreferenceKeys; import net.sourceforge.phpeclipse.IPreferenceConstants; import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider; import org.eclipse.jface.action.Action; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractTextEditor; // @@ -59,7 +59,7 @@ public class PreferenceConstants { /** * A named preference that defines the pattern used for package name compression. *

- * Value is of type String. For example foe the given package name 'org.eclipse.jdt' pattern '.' will compress it + * Value is of type String. For example foe the given package name 'net.sourceforge.phpdt' pattern '.' will compress it * to '..jdt', '1~' to 'o~.e~.jdt'. *

*/ @@ -107,6 +107,34 @@ public class PreferenceConstants { public static final String APPEARANCE_MEMBER_SORT_ORDER = "outlinesortoption"; //$NON-NLS-1$ /** + * A named preference that defines how member elements are ordered by visibility in the Java views using the + * JavaElementSorter. + *

+ * Value is of type String: A comma separated list of the following entries. Each entry must be in the list, no + * duplication. List order defines the sort order. + *

+ *

+ * + * @since 3.0 + */ + public static final String APPEARANCE_VISIBILITY_SORT_ORDER = "net.sourceforge.phpdt.ui.visibility.order"; //$NON-NLS-1$ + + /** + * A named preferences that controls if Java elements are also sorted by visibility. + *

+ * Value is of type Boolean. + *

+ * + * @since 3.0 + */ + public static final String APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER = "net.sourceforge.phpdt.ui.enable.visibility.order"; //$NON-NLS-1$ + + /** * A named preference that controls if prefix removal during setter/getter generation is turned on or off. *

* Value is of type Boolean. @@ -141,7 +169,37 @@ public class PreferenceConstants { * @see #CODEGEN_USE_GETTERSETTER_SUFFIX */ public static final String CODEGEN_GETTERSETTER_SUFFIX = "net.sourceforge.phpdt.ui.gettersetter.suffix.list"; //$NON-NLS-1$ - + /** + * A named preference that controls whether the keyword "this" will be added + * automatically to field accesses in generated methods. + *

+ * Value is of type Boolean. + *

+ * @since 3.0 + */ + public static final String CODEGEN_KEYWORD_THIS= "org.eclipse.jdt.ui.keywordthis"; //$NON-NLS-1$ + + /** + * A named preference that controls whether to use the prefix "is" or the prefix "get" for + * automatically created getters which return a boolean field. + *

+ * Value is of type Boolean. + *

+ * @since 3.0 + */ + public static final String CODEGEN_IS_FOR_GETTERS= "org.eclipse.jdt.ui.gettersetter.use.is"; //$NON-NLS-1$ + + + /** + * A named preference that defines the preferred variable names for exceptions in + * catch clauses. + *

+ * Value is of type String. + *

+ * @since 3.0 + */ + public static final String CODEGEN_EXCEPTION_VAR_NAME= "org.eclipse.jdt.ui.exception.name"; //$NON-NLS-1$ + /** * A named preference that controls if comment stubs will be added automatically to newly created types and methods. *

@@ -513,7 +571,9 @@ public class PreferenceConstants { * Value is of type Int: positive int value specifying the number of spaces per tab. *

*/ - public final static String EDITOR_TAB_WIDTH = "net.sourceforge.phpdt.ui.editor.tab.width"; //$NON-NLS-1$ + public final static String EDITOR_TAB_WIDTH = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH; //"net.sourceforge.phpdt.ui.editor.tab.width"; + + // //$NON-NLS-1$ /** * A named preference that controls whether the outline view selection should stay in sync with with the element at the current @@ -1003,7 +1063,7 @@ public class PreferenceConstants { public final static String EDITOR_MULTI_LINE_COMMENT_COLOR = IPreferenceConstants.PHP_MULTILINE_COMMENT; /** - * The symbolic font name for the Java editor text font (value "org.eclipse.jdt.ui.editors.textfont"). + * The symbolic font name for the Java editor text font (value "net.sourceforge.phpdt.ui.editors.textfont"). * * @since 2.1 */ @@ -1257,7 +1317,7 @@ public class PreferenceConstants { * @see org.eclipse.jface.resource.StringConverter * @see org.eclipse.jface.preference.PreferenceConverter */ - public final static String EDITOR_STRING_COLOR = IPreferenceConstants.PHP_STRING; + public final static String EDITOR_STRING_COLOR_DQ = IPreferenceConstants.PHP_STRING_DQ; /** * A named preference that controls whether string constants are rendered in bold. @@ -1265,7 +1325,17 @@ public class PreferenceConstants { * Value is of type Boolean. *

*/ - public final static String EDITOR_STRING_BOLD = IPreferenceConstants.PHP_STRING + EDITOR_BOLD_SUFFIX; + public final static String EDITOR_STRING_BOLD_DQ = IPreferenceConstants.PHP_STRING_DQ + EDITOR_BOLD_SUFFIX; + + public final static String EDITOR_STRING_COLOR_SQ = IPreferenceConstants.PHP_STRING_SQ; + + /** + * A named preference that controls whether string constants are rendered in bold. + *

+ * Value is of type Boolean. + *

+ */ + public final static String EDITOR_STRING_BOLD_SQ = IPreferenceConstants.PHP_STRING_SQ + EDITOR_BOLD_SUFFIX; /** * A named preference that holds the color used to render php default text. @@ -2106,6 +2176,17 @@ public class PreferenceConstants { public static final String TEMPLATES_USE_CODEFORMATTER = "net.sourceforge.phpdt.ui.template.format"; //$NON-NLS-1$ /** + * A named preference that controls whether annotation roll over is used or not. + *

+ * Value is of type Boolean. If true the annotation ruler column + * uses a roll over to display multiple annotations + *

+ * + * @since 3.0 + */ + public static final String EDITOR_ANNOTATION_ROLL_OVER = "editor_annotation_roll_over"; //$NON-NLS-1$ + + /** * A named preference that controls the key modifier mask for browser like links. The value is only used if the value of * EDITOR_BROWSER_LIKE_LINKS cannot be resolved to valid SWT modifier bits. *

@@ -2230,34 +2311,23 @@ public class PreferenceConstants { store.setDefault(PreferenceConstants.CODEGEN_USE_GETTERSETTER_SUFFIX, false); store.setDefault(PreferenceConstants.CODEGEN_GETTERSETTER_PREFIX, "fg, f, _$, _, m_"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEGEN_GETTERSETTER_SUFFIX, "_"); //$NON-NLS-1$ + + store.setDefault(PreferenceConstants.CODEGEN_KEYWORD_THIS, false); + store.setDefault(PreferenceConstants.CODEGEN_IS_FOR_GETTERS, true); + store.setDefault(PreferenceConstants.CODEGEN_EXCEPTION_VAR_NAME, "e"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEGEN_ADD_COMMENTS, true); store.setDefault(PreferenceConstants.CODEGEN__NON_JAVADOC_COMMENTS, false); store.setDefault(PreferenceConstants.CODEGEN__FILE_COMMENTS, false); // MembersOrderPreferencePage - store.setDefault(PreferenceConstants.APPEARANCE_MEMBER_SORT_ORDER, "T,SI,SF,SM,I,F,C,M"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.APPEARANCE_MEMBER_SORT_ORDER, "T,SF,SI,SM,I,F,C,M"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.APPEARANCE_VISIBILITY_SORT_ORDER, "B,V,R,D"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER, false); // must add here to guarantee that it is the first in the listener list store.addPropertyChangeListener(PHPeclipsePlugin.getDefault().getMemberOrderPreferenceCache()); - // PHPEditorPreferencePage - /* - * Ensure that the display is accessed only in the UI thread. Ensure that there are no side effects of switching the thread. - */ - final RGB[] rgbs = new RGB[3]; - final Display display = Display.getDefault(); - display.syncExec(new Runnable() { - public void run() { - Color c = display.getSystemColor(SWT.COLOR_GRAY); - rgbs[0] = c.getRGB(); - c = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); - rgbs[1] = c.getRGB(); - c = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); - rgbs[2] = c.getRGB(); - } - }); - store.setDefault(PreferenceConstants.EDITOR_MATCHING_BRACKETS, true); - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, rgbs[0]); + PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192)); store.setDefault(PreferenceConstants.EDITOR_CURRENT_LINE, true); PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_CURRENT_LINE_COLOR, new RGB(225, 235, 224)); @@ -2307,10 +2377,8 @@ public class PreferenceConstants { PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINKED_POSITION_COLOR, new RGB(0, 200, 100)); PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINK_COLOR, new RGB(0, 0, 255)); - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_FOREGROUND_COLOR, rgbs[1]); store.setDefault(PreferenceConstants.EDITOR_FOREGROUND_DEFAULT_COLOR, true); - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_BACKGROUND_COLOR, rgbs[2]); store.setDefault(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR, true); store.setDefault(PreferenceConstants.EDITOR_TAB_WIDTH, 4); @@ -2340,9 +2408,12 @@ public class PreferenceConstants { PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_PHP_TYPE_COLOR, new RGB(127, 0, 85)); store.setDefault(PreferenceConstants.EDITOR_PHP_TYPE_BOLD, false); - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_STRING_COLOR, new RGB(42, 0, 255)); - store.setDefault(PreferenceConstants.EDITOR_STRING_BOLD, false); + PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_STRING_COLOR_DQ, PHPColorProvider.STRING_DQ); + store.setDefault(PreferenceConstants.EDITOR_STRING_BOLD_DQ, true); + PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_STRING_COLOR_SQ, PHPColorProvider.STRING_SQ); + store.setDefault(PreferenceConstants.EDITOR_STRING_BOLD_SQ, false); + PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR, new RGB(0, 0, 0)); store.setDefault(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD, false); @@ -2394,7 +2465,7 @@ public class PreferenceConstants { store.setDefault(PreferenceConstants.EDITOR_WRAP_STRINGS_SQ, true); store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS_SQ, false); store.setDefault(PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, true); - store.setDefault(PreferenceConstants.EDITOR_FORMAT_JAVADOCS, true); + store.setDefault(PreferenceConstants.EDITOR_FORMAT_JAVADOCS, false); store.setDefault(PreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE, false); store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS_HTML, true);