List of usage examples for org.eclipse.jface.preference IPreferenceStore getBoolean
boolean getBoolean(String name);
From source file:com.google.dart.tools.ui.internal.text.editor.SemanticHighlightings.java
License:Open Source License
/** * Tests whether semantic highlighting is currently enabled. * //from w w w .j a v a2s .c o m * @param store the preference store to consult * @return <code>true</code> if semantic highlighting is enabled, <code>false</code> if it is not */ public static boolean isEnabled(IPreferenceStore store) { SemanticHighlighting[] highlightings = getSemanticHighlightings(); for (SemanticHighlighting highlighting : highlightings) { String enabledKey = getEnabledPreferenceKey(highlighting); if (store.getBoolean(enabledKey)) { return true; } } return false; }
From source file:com.google.dart.tools.ui.internal.text.functions.ContentAssistPreference.java
License:Open Source License
/** * Changes the configuration of the given content assistant according to the given property change * event and the given preference store. *//*from www.j a v a 2 s.co m*/ public static void changeConfiguration(ContentAssistant assistant, IPreferenceStore store, PropertyChangeEvent event) { String p = event.getProperty(); if (AUTOACTIVATION.equals(p)) { boolean enabled = store.getBoolean(AUTOACTIVATION); assistant.enableAutoActivation(enabled); } else if (AUTOACTIVATION_DELAY.equals(p)) { int delay = store.getInt(AUTOACTIVATION_DELAY); assistant.setAutoActivationDelay(delay); } else if (PROPOSALS_FOREGROUND.equals(p)) { Color c = getColor(store, PROPOSALS_FOREGROUND); assistant.setProposalSelectorForeground(c); } else if (PROPOSALS_BACKGROUND.equals(p)) { Color c = getColor(store, PROPOSALS_BACKGROUND); assistant.setProposalSelectorBackground(c); } else if (PARAMETERS_FOREGROUND.equals(p)) { Color c = getColor(store, PARAMETERS_FOREGROUND); assistant.setContextInformationPopupForeground(c); assistant.setContextSelectorForeground(c); } else if (PARAMETERS_BACKGROUND.equals(p)) { Color c = getColor(store, PARAMETERS_BACKGROUND); assistant.setContextInformationPopupBackground(c); assistant.setContextSelectorBackground(c); } else if (AUTOINSERT.equals(p)) { boolean enabled = store.getBoolean(AUTOINSERT); assistant.enableAutoInsert(enabled); } else if (PREFIX_COMPLETION.equals(p)) { boolean enabled = store.getBoolean(PREFIX_COMPLETION); assistant.enablePrefixCompletion(enabled); } changeJavaProcessor(assistant, store, p); changeJavaDocProcessor(assistant, store, p); }
From source file:com.google.dart.tools.ui.internal.text.functions.ContentAssistPreference.java
License:Open Source License
/** * Configure the given content assistant from the given store. *//*w w w . j a v a 2 s . co m*/ public static void configure(ContentAssistant assistant, IPreferenceStore store) { DartTextTools textTools = DartToolsPlugin.getDefault().getDartTextTools(); IColorManager manager = textTools.getColorManager(); boolean enabled = store.getBoolean(AUTOACTIVATION); assistant.enableAutoActivation(enabled); int delay = store.getInt(AUTOACTIVATION_DELAY); assistant.setAutoActivationDelay(delay); Color c = getColor(store, PROPOSALS_FOREGROUND, manager); assistant.setProposalSelectorForeground(c); c = getColor(store, PROPOSALS_BACKGROUND, manager); assistant.setProposalSelectorBackground(c); c = getColor(store, PARAMETERS_FOREGROUND, manager); assistant.setContextInformationPopupForeground(c); assistant.setContextSelectorForeground(c); c = getColor(store, PARAMETERS_BACKGROUND, manager); assistant.setContextInformationPopupBackground(c); assistant.setContextSelectorBackground(c); enabled = store.getBoolean(AUTOINSERT); assistant.enableAutoInsert(enabled); enabled = store.getBoolean(PREFIX_COMPLETION); assistant.enablePrefixCompletion(enabled); assistant.enableColoredLabels(true); configureJavaProcessor(assistant, store); DartX.todo("dartdoc"); // configureJavaDocProcessor(assistant, store); }
From source file:com.google.dart.tools.ui.internal.text.functions.ContentAssistPreference.java
License:Open Source License
public static boolean fillArgumentsOnMethodCompletion(IPreferenceStore store) { return store.getBoolean(FILL_METHOD_ARGUMENTS); }
From source file:com.google.dart.tools.ui.internal.text.functions.ContentAssistPreference.java
License:Open Source License
private static void changeJavaProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { DartCompletionProcessor jcp = getJavaProcessor(assistant); if (jcp == null) { return;/*from www . j av a 2 s . c om*/ } if (AUTOACTIVATION_TRIGGERS_JAVA.equals(key)) { String triggers = store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) { jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); } } else if (SHOW_VISIBLE_PROPOSALS.equals(key)) { boolean enabled = store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); } else if (CASE_SENSITIVITY.equals(key)) { boolean enabled = store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); } }
From source file:com.google.dart.tools.ui.internal.text.functions.ContentAssistPreference.java
License:Open Source License
private static void configureJavaProcessor(ContentAssistant assistant, IPreferenceStore store) { DartCompletionProcessor jcp = getJavaProcessor(assistant); if (jcp == null) { return;//www . ja va 2 s .c om } String triggers = store.getString(AUTOACTIVATION_TRIGGERS_JAVA); if (triggers != null) { jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); } boolean enabled = store.getBoolean(SHOW_VISIBLE_PROPOSALS); jcp.restrictProposalsToVisibility(enabled); enabled = store.getBoolean(CASE_SENSITIVITY); jcp.restrictProposalsToMatchingCases(enabled); }
From source file:com.google.dart.tools.ui.internal.viewsupport.AppearanceAwareLabelProvider.java
License:Open Source License
private void initMasks() { IPreferenceStore store = PreferenceConstants.getPreferenceStore(); fTextFlagMask = -1;//from w w w . j a v a 2 s . c o m if (!store.getBoolean(PreferenceConstants.APPEARANCE_METHOD_RETURNTYPE)) { fTextFlagMask ^= DartElementLabels.M_APP_RETURNTYPE; } if (!store.getBoolean(PreferenceConstants.APPEARANCE_METHOD_TYPEPARAMETERS)) { fTextFlagMask ^= DartElementLabels.M_APP_TYPE_PARAMETERS; } if (!store.getBoolean(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES)) { fTextFlagMask ^= DartElementLabels.P_COMPRESSED; } if (!store.getBoolean(PreferenceConstants.APPEARANCE_CATEGORY)) { fTextFlagMask ^= DartElementLabels.ALL_CATEGORY; } fImageFlagMask = -1; }
From source file:com.google.dart.tools.ui.PreferenceConstants.java
License:Open Source License
/** * Initializes the given preference store with the default values. * /* ww w.j av a2s.co m*/ * @param store the preference store to be initialized */ @SuppressWarnings("deprecation") public static void initializeDefaultValues(IPreferenceStore store) { ColorRegistry registry = getColorRegistry(); store.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); // JavaBasePreferencePage store.setDefault(PreferenceConstants.DOUBLE_CLICK, PreferenceConstants.DOUBLE_CLICK_EXPANDS); store.setDefault(PreferenceConstants.UPDATE_JAVA_VIEWS, PreferenceConstants.UPDATE_WHILE_EDITING); store.setToDefault(PreferenceConstants.UPDATE_JAVA_VIEWS); // clear // preference, // update on save // not supported // anymore store.setDefault(PreferenceConstants.LINK_BROWSING_PROJECTS_TO_EDITOR, true); store.setDefault(PreferenceConstants.LINK_BROWSING_PACKAGES_TO_EDITOR, true); store.setDefault(PreferenceConstants.LINK_BROWSING_TYPES_TO_EDITOR, true); store.setDefault(PreferenceConstants.LINK_BROWSING_MEMBERS_TO_EDITOR, true); store.setDefault(PreferenceConstants.SEARCH_USE_REDUCED_MENU, true); // AppearancePreferencePage store.setDefault(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES, false); store.setDefault(PreferenceConstants.APPEARANCE_METHOD_RETURNTYPE, false); store.setDefault(PreferenceConstants.APPEARANCE_METHOD_TYPEPARAMETERS, true); store.setDefault(PreferenceConstants.APPEARANCE_CATEGORY, false); store.setDefault(PreferenceConstants.BROWSING_STACK_VERTICALLY, false); store.setDefault(PreferenceConstants.APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW, ""); //$NON-NLS-1$ // ImportOrganizePreferencePage store.setDefault(PreferenceConstants.ORGIMPORTS_IMPORTORDER, "java;javax;org;com"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD, 99); store.setDefault(PreferenceConstants.ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD, 99); store.setDefault(PreferenceConstants.ORGIMPORTS_IGNORELOWERCASE, true); // TypeFilterPreferencePage store.setDefault(PreferenceConstants.TYPEFILTER_ENABLED, ""); //$NON-NLS-1$ store.setDefault(PreferenceConstants.TYPEFILTER_DISABLED, ""); //$NON-NLS-1$ // ClasspathVariablesPreferencePage // CodeFormatterPreferencePage // CompilerPreferencePage // no initialization needed // RefactoringPreferencePage store.setDefault(PreferenceConstants.REFACTOR_ERROR_PAGE_SEVERITY_THRESHOLD, PreferenceConstants.REFACTOR_WARNING_SEVERITY); store.setDefault(PreferenceConstants.REFACTOR_SAVE_ALL_EDITORS, false); store.setDefault(PreferenceConstants.REFACTOR_LIGHTWEIGHT, true); // TemplatePreferencePage store.setDefault(PreferenceConstants.TEMPLATES_USE_CODEFORMATTER, true); // CodeGenerationPreferencePage // compatibility code if (store.getBoolean(PreferenceConstants.CODEGEN_USE_GETTERSETTER_PREFIX)) { String prefix = store.getString(PreferenceConstants.CODEGEN_GETTERSETTER_PREFIX); if (prefix.length() > 0) { DartCore.getPlugin().getPluginPreferences().setValue(JavaScriptCore.CODEASSIST_FIELD_PREFIXES, prefix); store.setToDefault(PreferenceConstants.CODEGEN_USE_GETTERSETTER_PREFIX); store.setToDefault(PreferenceConstants.CODEGEN_GETTERSETTER_PREFIX); } } if (store.getBoolean(PreferenceConstants.CODEGEN_USE_GETTERSETTER_SUFFIX)) { String suffix = store.getString(PreferenceConstants.CODEGEN_GETTERSETTER_SUFFIX); if (suffix.length() > 0) { DartCore.getPlugin().getPluginPreferences().setValue(JavaScriptCore.CODEASSIST_FIELD_SUFFIXES, suffix); store.setToDefault(PreferenceConstants.CODEGEN_USE_GETTERSETTER_SUFFIX); store.setToDefault(PreferenceConstants.CODEGEN_GETTERSETTER_SUFFIX); } } 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, false); store.setDefault(PreferenceConstants.CODEGEN_USE_OVERRIDE_ANNOTATION, true); // MembersOrderPreferencePage store.setDefault(PreferenceConstants.APPEARANCE_MEMBER_SORT_ORDER, "T,SF,SI,SM,F,I,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); // JavaEditorPreferencePage store.setDefault(PreferenceConstants.EDITOR_MATCHING_BRACKETS, true); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192))); store.setDefault(PreferenceConstants.EDITOR_CORRECTION_INDICATION, true); store.setDefault(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, true); store.setDefault(PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, true); PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINKED_POSITION_COLOR, new RGB(121, 121, 121)); store.setDefault(PreferenceConstants.EDITOR_TAB_WIDTH, 2); store.setDefault(PreferenceConstants.EDITOR_SPACES_FOR_TABS, true); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_MULTI_LINE_COMMENT_COLOR, new RGB(63, 127, 95))); store.setDefault(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR, new RGB(63, 127, 95))); store.setDefault(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DART_KEYWORD_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVA_KEYWORD_COLOR, new RGB(127, 0, 85))); store.setDefault(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD, true); store.setDefault(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC, false); PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_JAVA_ANNOTATION_COLOR, new RGB(100, 100, 100)); store.setDefault(PreferenceConstants.EDITOR_JAVA_ANNOTATION_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVA_ANNOTATION_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_STRING_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_STRING_COLOR, new RGB(42, 0, 255))); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_MULTI_LINE_STRING_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_MULTI_LINE_STRING_COLOR, new RGB(42, 0, 255))); store.setDefault(PreferenceConstants.EDITOR_STRING_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_STRING_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DART_DEFAULT_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVA_DEFAULT_COLOR, new RGB(0, 0, 0))); store.setDefault(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_JAVA_METHOD_NAME_COLOR, new RGB(0, 0, 0)); store.setDefault(PreferenceConstants.EDITOR_JAVA_METHOD_NAME_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVA_METHOD_NAME_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DART_KEYWORD_RETURN_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVA_KEYWORD_RETURN_COLOR, new RGB(127, 0, 85))); store.setDefault(PreferenceConstants.EDITOR_JAVA_KEYWORD_RETURN_BOLD, true); store.setDefault(PreferenceConstants.EDITOR_JAVA_KEYWORD_RETURN_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DART_OPERATOR_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVA_OPERATOR_COLOR, new RGB(0, 0, 0))); store.setDefault(PreferenceConstants.EDITOR_JAVA_OPERATOR_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVA_OPERATOR_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DART_BRACKET_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVA_BRACKET_COLOR, new RGB(0, 0, 0))); store.setDefault(PreferenceConstants.EDITOR_JAVA_BRACKET_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVA_BRACKET_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_TASK_TAG_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_TASK_TAG_COLOR, new RGB(127, 159, 191))); store.setDefault(PreferenceConstants.EDITOR_TASK_TAG_BOLD, true); store.setDefault(PreferenceConstants.EDITOR_TASK_TAG_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DARTDOC_KEYWORD_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVADOC_KEYWORD_COLOR, new RGB(127, 159, 191))); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_KEYWORD_BOLD, true); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_KEYWORD_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DARTDOC_TAG_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVADOC_TAG_COLOR, new RGB(127, 127, 159))); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_TAG_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DARTDOC_LINKS_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVADOC_LINKS_COLOR, new RGB(63, 63, 191))); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_LINKS_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.EDITOR_DARTDOC_DEFAULT_COLOR, findRGB(registry, IJavaThemeConstants.EDITOR_JAVADOC_DEFAULT_COLOR, new RGB(63, 95, 191))); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD, false); store.setDefault(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_ITALIC, false); store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION, true); store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY, 300); store.setDefault(PreferenceConstants.CODEASSIST_AUTOINSERT, false); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_PROPOSALS_BACKGROUND, new RGB(255, 255, 255))); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0))); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255))); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0))); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_REPLACEMENT_BACKGROUND, new RGB(255, 255, 0))); setDefaultAndFireEvent(store, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND, findRGB(registry, IJavaThemeConstants.CODEASSIST_REPLACEMENT_FOREGROUND, new RGB(255, 0, 0))); store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, "."); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, "@#"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, true); store.setDefault(PreferenceConstants.CODEASSIST_CASE_SENSITIVITY, false); store.setDefault(PreferenceConstants.CODEASSIST_ADDIMPORT, false); store.setDefault(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, true); store.setDefault(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, true); store.setDefault(PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, true); store.setDefault(PreferenceConstants.CODEASSIST_PREFIX_COMPLETION, false); // can't believe embedded null is used as a delimiter store.setDefault(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, "com.google.dart.tools.ui.spellingProposalCategory\0com.google.dart.tools.ui.textProposalCategory\0"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_CATEGORY_ORDER, "com.google.dart.tools.ui.spellingProposalCategory:65545\0com.google.dart.tools.ui.javaTypeProposalCategory:65540\0com.google.dart.tools.ui.javaNoTypeProposalCategory:65539\0com.google.dart.tools.ui.textProposalCategory:65541\0com.google.dart.tools.ui.templateProposalCategory:2\0"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_LRU_HISTORY, ""); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_SORTER, "com.google.dart.tools.ui.RelevanceSorter"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, ""); //$NON-NLS-1$ store.setDefault(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION, true); store.setDefault(PreferenceConstants.EDITOR_SMART_PASTE, true); store.setDefault(PreferenceConstants.EDITOR_IMPORTS_ON_PASTE, true); store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS, true); store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACKETS, true); store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACES, true); store.setDefault(PreferenceConstants.EDITOR_CLOSE_JAVADOCS, true); store.setDefault(PreferenceConstants.EDITOR_WRAP_STRINGS, true); store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS, false); store.setDefault(PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, true); store.setDefault(PreferenceConstants.EDITOR_FORMAT_JAVADOCS, false); store.setDefault(PreferenceConstants.EDITOR_REMOVE_TRAILING_WS, false); int sourceHoverModifier = SWT.MOD2; String sourceHoverModifierName = Action.findModifierString(sourceHoverModifier); // Shift int nlsHoverModifier = SWT.MOD1 + SWT.MOD3; String nlsHoverModifierName = Action.findModifierString(SWT.MOD1) + "+" //$NON-NLS-1$ + Action.findModifierString(SWT.MOD3); // Ctrl + Alt store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS, "com.google.dart.tools.ui.BestMatchHover;0;com.google.dart.tools.ui.JavaSourceHover;" //$NON-NLS-1$ + sourceHoverModifierName + ";com.google.dart.tools.ui.NLSStringHover;" //$NON-NLS-1$ + nlsHoverModifierName); store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS, "com.google.dart.tools.ui.BestMatchHover;0;com.google.dart.tools.ui.JavaSourceHover;" //$NON-NLS-1$ + sourceHoverModifier + ";com.google.dart.tools.ui.NLSStringHover;" + nlsHoverModifier); //$NON-NLS-1$ store.setDefault(PreferenceConstants.EDITOR_SMART_TAB, true); store.setDefault(PreferenceConstants.EDITOR_SMART_BACKSPACE, true); store.setDefault(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER, false); store.setDefault(EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT, true); DartX.todo(); // store.setDefault(PreferenceConstants.FORMATTER_PROFILE, // FormatterProfileManager.DEFAULT_PROFILE); // mark occurrences boolean disableMarks = DartCoreDebug.DISABLE_MARK_OCCURRENCES; store.setDefault(PreferenceConstants.EDITOR_MARK_OCCURRENCES, !disableMarks); store.setDefault(PreferenceConstants.EDITOR_STICKY_OCCURRENCES, false); store.setDefault(PreferenceConstants.EDITOR_MARK_TYPE_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_METHOD_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_CONSTANT_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_FIELD_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_EXCEPTION_OCCURRENCES, true); store.setDefault(PreferenceConstants.EDITOR_MARK_METHOD_EXIT_POINTS, true); store.setDefault(PreferenceConstants.EDITOR_MARK_BREAK_CONTINUE_TARGETS, true); store.setDefault(PreferenceConstants.EDITOR_MARK_IMPLEMENTORS, true); // folding store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true); store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, "com.google.dart.tools.ui.text.defaultFoldingProvider"); //$NON-NLS-1$ store.setDefault(PreferenceConstants.EDITOR_FOLDING_JAVADOC, false); store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, false); store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false); store.setDefault(PreferenceConstants.EDITOR_FOLDING_IMPORTS, true); store.setDefault(PreferenceConstants.EDITOR_FOLDING_HEADERS, true); // properties file editor setDefaultAndFireEvent(store, PreferenceConstants.PROPERTIES_FILE_COLORING_KEY, findRGB(registry, IJavaThemeConstants.PROPERTIES_FILE_COLORING_KEY, new RGB(0, 0, 0))); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_KEY_BOLD, false); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_KEY_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE, findRGB(registry, IJavaThemeConstants.PROPERTIES_FILE_COLORING_VALUE, new RGB(42, 0, 255))); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE_BOLD, false); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT, findRGB(registry, IJavaThemeConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT, new RGB(0, 0, 0))); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT_BOLD, false); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT, findRGB(registry, IJavaThemeConstants.PROPERTIES_FILE_COLORING_ARGUMENT, new RGB(127, 0, 85))); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT_BOLD, true); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT_ITALIC, false); setDefaultAndFireEvent(store, PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT, findRGB(registry, IJavaThemeConstants.PROPERTIES_FILE_COLORING_COMMENT, new RGB(63, 127, 95))); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT_BOLD, false); store.setDefault(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT_ITALIC, false); store.setDefault(PreferenceConstants.PREF_DEFAULT_EXPAND_WITH_CONSTRUCTORS_MEMBERS, ""); //$NON-NLS-1$ // semantic highlighting SemanticHighlightings.initDefaults(store); // do more complicated stuff DartX.todo(); // NewJavaProjectPreferencePage.initDefaults(store); // reset preferences that are not settable by editor any longer // see AbstractDecoratedTextEditorPreferenceConstants store.setToDefault(EDITOR_SMART_HOME_END); // global store.setToDefault(EDITOR_LINE_NUMBER_RULER); // global store.setToDefault(EDITOR_LINE_NUMBER_RULER_COLOR); // global store.setToDefault(EDITOR_OVERVIEW_RULER); // removed -> true store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS); // accessibility store.setToDefault(PreferenceConstants.EDITOR_CURRENT_LINE); // global store.setToDefault(PreferenceConstants.EDITOR_CURRENT_LINE_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_PRINT_MARGIN); // global store.setToDefault(PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN); // global store.setToDefault(PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_FOREGROUND_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_FOREGROUND_DEFAULT_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_BACKGROUND_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_FIND_SCOPE_COLOR); // global store.setToDefault( AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR); // global store.setToDefault( AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR); // global store.setToDefault(PreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE); // global store.setToDefault(PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ENABLED); // removed store.setToDefault(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE); // global // Code Clean Up DartX.todo(); CleanUpConstants.initDefaults(store); }
From source file:com.google.dart.tools.ui.text.folding.DartFoldingStructureProvider.java
License:Open Source License
private void initializePreferences() { IPreferenceStore store = DartToolsPlugin.getDefault().getPreferenceStore();//dartEditor.getPreferences() collapseImportContainer = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_IMPORTS); collapseDartDoc = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_JAVADOC); collapseMembers = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_METHODS); collapseHeaderComments = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_HEADERS); collapseClasses = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_CLASSES); collapseFunctions = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_FUNCTIONS); }
From source file:com.google.dart.tools.ui.text.folding.DefaultDartFoldingStructureProvider.java
License:Open Source License
private void initializePreferences() { IPreferenceStore store = DartToolsPlugin.getDefault().getPreferenceStore(); collapseInnerTypes = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_INNERTYPES); collapseImportContainer = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_IMPORTS); collapseDartDoc = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_JAVADOC); collapseMembers = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_METHODS); collapseHeaderComments = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_HEADERS); }