Example usage for org.eclipse.jface.preference IPreferenceStore setDefault

List of usage examples for org.eclipse.jface.preference IPreferenceStore setDefault

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore setDefault.

Prototype

void setDefault(String name, boolean value);

Source Link

Document

Sets the default value for the boolean-valued preference with the given name.

Usage

From source file:com.anirudh.emacseclipse.Activator.java

License:Open Source License

protected void initializeDefaultPreferences(IPreferenceStore store) {
    store.setDefault(GNUCLIENT_PREFERENCE, DEFAULT_GNUCLIENT_PREFERENCE);
    store.setDefault(SEXPR_PREFERENCE, DEFAULT_SEXPR_PREFERENCE);
    store.setDefault(POSTLISP_PREFERENCE, DEFAULT_POSTLISP_PREFERENCE);
}

From source file:com.appnativa.studio.preferences.PreferenceInitializer.java

License:Open Source License

public void initializeDefaultPreferences() {
    IPreferenceStore ps = Activator.getDefault().getPreferenceStore();

    try {// w ww  .  j  a v a  2 s  .com
        String s = Platform.getPreferencesService().getString("com.android.ide.eclipse.adt",
                "com.android.ide.eclipse.adt.sdk", null, null);

        if (s != null) {
            ps.setDefault(PreferenceConstants.ANDROID_PATH, s);
        }

        ps.setDefault(PreferenceConstants.SMALL_SCREEN_SIZE, "960");
        ps.setDefault(PreferenceConstants.MEDIUM_SCREEN_SIZE, "960");
        ps.setDefault(PreferenceConstants.SMALL_SCREEN_SIZE_WITH_MEDIUM, "640");
        ps.setDefault(PreferenceConstants.GRID_COLOR, "0,133,0");
        ps.setDefault(PreferenceConstants.SELECTION_COLOR, "0,0,160");
        ps.setDefault(PreferenceConstants.TRACKING_COLOR, "64,64,64");
    } catch (Exception ignore) {
    }
}

From source file:com.aptana.commons.spelling.engine.SpellingPreferenceInitializer.java

License:Open Source License

public void initializeDefaultPreferences() {
    final Bundle bundle = Platform.getBundle("org.eclipse.jdt.ui"); //$NON-NLS-1$
    final IPreferenceStore preferenceStore = Activator.getSpellingPreferenceStore();
    if ((bundle != null) && false) {
        preferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENGINE,
                "org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine"); //$NON-NLS-1$
    } else {/*from  w w  w . ja v a2  s .c  om*/
        preferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENGINE,
                "com.onpositive.text.spelling.DefaultSpellingEngine"); //$NON-NLS-1$
    }
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_DIGITS, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_MIXED, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_NON_LETTERS, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_SENTENCE, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_UPPER, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_URLS, true);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_PROBLEMS_THRESHOLD, 100);
    preferenceStore.setDefault(PreferenceConstants.SPELLING_IGNORE_SINGLE_LETTERS, true);
    preferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);

}

From source file:com.aptana.editor.php.internal.contentAssist.preferences.ContentAssistPreferencesInitializer.java

License:Open Source License

@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = PHPEditorPlugin.getDefault().getPreferenceStore();
    store.setDefault(AUTO_ACTIVATE_ON_IDENTIFIERS, true);
    store.setDefault(CONTENT_ASSIST_FILTER_TYPE, CONTENT_ASSIST_INCLUDE_ALL);
    store.setDefault(PARSE_UNSAVED_MODULE_ON_IDENTIFIERS_COMPLETION, true);
    store.setDefault(INSERT_FUNCTION_PARAMETERS, true);
    store.setDefault(INSERT_OPTIONAL_FUNCTION_PARAMETERS, false);
    store.setDefault(INSERT_PARENTHESES_AFTER_METHOD_CALLS, false);
    store.setDefault(INSERT_PARENTHESES_AFTER_NEW_INSTANCE, false);
    store.setDefault(INSERT_SEMICOLON_AFTER_METHOD_CALLS, false);
    store.setDefault(INSERT_SEMICOLON_AFTER_NEW_INSTANCE, false);
    store.setDefault(INSERT_MODE, INSERT_MODE_INSERT);
    store.setDefault(PARAMETRS_TAB_JUMP, true);
}

From source file:com.aptana.ide.core.ui.ColorPair.java

License:Open Source License

/**
 * Sets the default value of the preference with the given name in the given preference store.
 * //from  w w w  .  j ava2 s .  c  o  m
 * @param store
 *            the preference store
 * @param name
 *            the name of the preference
 * @param value
 *            the new default value of the preference
 */
public static void setDefault(IPreferenceStore store, String name, ColorPair value) {
    store.setDefault(name, asString(value));
}

From source file:com.aptana.ide.core.ui.preferences.PreferenceInitializer.java

License:Open Source License

/**
 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 *///from   ww w  .  jav a2 s.  co  m
public void initializeDefaultPreferences() {
    IPreferenceStore store = CoreUIPlugin.getDefault().getPreferenceStore();
    store.setDefault(IPreferenceConstants.P_ENABLED, true);
    store.setDefault(IPreferenceConstants.P_SCHEDULE, IPreferenceConstants.VALUE_ON_STARTUP);
    store.setDefault(IPreferenceConstants.P_DOWNLOAD, false);
    store.setDefault(IPreferenceConstants.PREF_AUTO_BACKUP_ENABLED, true);
    store.setDefault(IPreferenceConstants.PREF_AUTO_BACKUP_LASTNAME, ""); //$NON-NLS-1$
    store.setDefault(IPreferenceConstants.PREF_AUTO_BACKUP_PATH,
            ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString() + File.separatorChar
                    + "preferences"); //$NON-NLS-1$
    store.setDefault(IPreferenceConstants.PREF_FILE_EXPLORER_WEB_FILES,
            "*.js;*.htm;*.html;*.xhtm;*.xhtml;*.css;*.xml;*.xsl;*.xslt;" //$NON-NLS-1$
                    + "*.fla;*.gif;*.jpg;*.jpeg;*.php;*.asp;*.jsp;*.png;*.as;*.sdoc;*.swf;*.shtml;*.txt;*.aspx;*.asmx;"); //$NON-NLS-1$
    store.setDefault(com.aptana.ide.core.preferences.IPreferenceConstants.PREF_GLOBAL_SYNC_CLOAKING_EXTENSIONS,
            ".svn;.tmp*~;.settings;CVS;.git;.DS_Store"); //$NON-NLS-1$

    store.setDefault(IPreferenceConstants.INITIAL_POOL_SIZE, DEFAULT_INITIAL_POOL_SIZE);
    store.setDefault(IPreferenceConstants.MAX_POOL_SIZE, DEFAULT_MAX_POOL_SIZE);

    store = Activator.getDefault().getPreferenceStore();
    store.setDefault(IPreferencesConstants2.SWITCH_TO_APTANA_PRESPECTIVE, MessageDialogWithToggle.PROMPT);
}

From source file:com.aptana.ide.editor.css.preferences.PreferenceInitializer.java

License:Open Source License

/**
 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 *//*from w w  w .  jav  a 2  s .c o m*/
public void initializeDefaultPreferences() {

    IPreferenceStore store = CSSPlugin.getDefault().getPreferenceStore();

    if (Platform.getOS().equals(Platform.OS_WIN32)) {
        store.setDefault(IPreferenceConstants.CSSEDITOR_BROWSER_PREVIEW_PREFERENCE, "IE,Firefox"); //$NON-NLS-1$
    } else if (Platform.getOS().equals(Platform.OS_LINUX)) {
        store.setDefault(IPreferenceConstants.CSSEDITOR_BROWSER_PREVIEW_PREFERENCE, "Default"); //$NON-NLS-1$
    } else if (Platform.getOS().equals(Platform.OS_MACOSX)) {
        store.setDefault(IPreferenceConstants.CSSEDITOR_BROWSER_PREVIEW_PREFERENCE, "Safari,Firefox"); //$NON-NLS-1$
    }
    store.setDefault(IPreferenceConstants.CSSEDITOR_BROWSER_TEMPLATE_PREFERENCE,
            "<h1>The H1 tag looks like this</h1>\n" //$NON-NLS-1$
                    + "<p>The paragraph tag after an H1 tag looks like this</p>\n" //$NON-NLS-1$
                    + "<h2>The H2 tag looks like this</h2>\n" //$NON-NLS-1$
                    + "<p>The paragraph tag after an H2 tag looks like this</p>\n" //$NON-NLS-1$
                    + "<h3>The H3 tag looks like this</h3>\n" //$NON-NLS-1$
                    + "<p>The paragraph tag after an H3 tag looks like this</p>\n" //$NON-NLS-1$
                    + "<h4>The H4 tag looks like this</h4>\n" //$NON-NLS-1$
                    + "<p>The paragraph tag after an H4 tag looks like this</p>\n" //$NON-NLS-1$
                    + "<h5>The H5 tag looks like this</h5>\n" //$NON-NLS-1$
                    + "<p>The paragraph tag after an H5 tag looks like this</p>\n" //$NON-NLS-1$
                    + "<ol>\n" //$NON-NLS-1$
                    + "<li><strong>This is a strong element in an ordered list</strong></li>\n" //$NON-NLS-1$
                    + "<li><i>This is an italic element in an ordered list</i></li>\n" //$NON-NLS-1$
                    + "<li><b>This is a bold element in an ordered list</b></li>\n" //$NON-NLS-1$
                    + "<li><em>This is an emphasized element in an ordered list</em></li>\n" //$NON-NLS-1$
                    + "<li>This is a regular element in an ordered list</li>\n" //$NON-NLS-1$
                    + "</ol>\n" //$NON-NLS-1$
                    + "<ul>\n" //$NON-NLS-1$
                    + "<li><strong>This is a strong element in an unordered list</strong></li>\n" //$NON-NLS-1$
                    + "<li><i>This is an italic element in an unordered list</i></li>\n" //$NON-NLS-1$
                    + "<li><b>This is a bold element in an unordered list</b></li>\n" //$NON-NLS-1$
                    + "<li><em>This is an emphasized element in an unordered list</em></li>\n" //$NON-NLS-1$
                    + "<li>This is a regular element in an unordered list</li>\n" //$NON-NLS-1$
                    + "</ul>\n" //$NON-NLS-1$
                    + "<blockquote>The block quote element looks like this</blockquote>\n" //$NON-NLS-1$
                    + "<pre>The pre element looks like this</pre>\n" //$NON-NLS-1$
                    + "<code>The code element looks like this</code>\n" //$NON-NLS-1$
                    + "<br/>\n" //$NON-NLS-1$
                    + "<span>The span element looks like this</span>\n" //$NON-NLS-1$
                    + "<br/>\n" //$NON-NLS-1$
                    + "<a href=\"#\">The anchor element looks like this</a>\n" //$NON-NLS-1$
                    + "<br/>\n" //$NON-NLS-1$
                    + "<br/>\n" //$NON-NLS-1$
                    + "<div style=\"float:left;margin:20px;width:200px;\">Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.  Text inside a div that is 200 pixels wide looks like this.</div>\n" //$NON-NLS-1$
                    + "<div style=\"float:left;margin:20px;width:400px;\">Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.  Text inside a div that is 400 pixels wide looks like this.</div>\n" //$NON-NLS-1$
                    + "<div style=\"float:left;margin:20px;width:600px;\">Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.  Text inside a div that is 600 pixels wide looks like this.</div>"); //$NON-NLS-1$

    store.setDefault(IPreferenceConstants.CSSEDITOR_BROWSER_USE_TEMPLATE_PREFERENCE, true);

    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.AUTO_BRACKET_INSERTION, "INSERT"); //$NON-NLS-1$
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.CODE_ASSIST_AUTO_ACTIVATION, true);

    store.setDefault(IPreferenceConstants.CSSEDITOR_INSERT_SEMICOLON, true);

    store.setDefault(IPreferenceConstants.SHOW_CSS_TOOLBAR, true);
    store.setDefault(IPreferenceConstants.USE_TEMP_FILES_FOR_PREVIEW, true);

    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_ERROR_COLOR, ICSSColorConstants.ERROR);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_IDENTIFIER_COLOR,
            ICSSColorConstants.IDENTIFIER);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_LITERAL_COLOR,
            ICSSColorConstants.LITERAL);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_KEYWORD_COLOR,
            ICSSColorConstants.KEYWORD);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_PUNCTUATOR_COLOR,
            ICSSColorConstants.PUNCTUATOR);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_COMMENT_COLOR,
            ICSSColorConstants.COMMENT);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_HASH_COLOR, ICSSColorConstants.HASH);
    PreferenceConverter.setDefault(store, IPreferenceConstants.CSSEDITOR_STRING_COLOR,
            ICSSColorConstants.STRING);

    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.IGNORE_PROBLEMS,
            "~~~~~~~~-1~~~~.*You have no background-color with your color.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*You have no color with your background-color.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~C\\s*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*-moz-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*-o-*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*accelerator.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*background-position-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*filter.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*ime-mode.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*layout-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*line-break.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*overflow-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*page.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*ruby-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*scrollbar-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*text-align-.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*text-justify.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*text-overflow.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*text-shadow.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*text-underline-position.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*word-spacing.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*word-wrap.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*writing-mode.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*zoom.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*opacity.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*hand is not a cursor value.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*inline-block is not a display value.*" + //$NON-NLS-1$
                    "####~~~~~~~~-1~~~~.*Property word-break doesn't exist.*" //$NON-NLS-1$
    );
    store.setDefault(IPreferenceConstants.CSSEDITOR_INITIAL_CONTENTS, "body {\n\t\n}\n"); //$NON-NLS-1$
    store.setDefault(IPreferenceConstants.CSSEDITOR_INITIAL_FILE_NAME, "new_file.css"); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, " "); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4"); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.SHOW_PAIR_MATCHES,
            com.aptana.ide.editors.preferences.IPreferenceConstants.BOTH);
    PreferenceConverter.setDefault(store,
            com.aptana.ide.editors.preferences.IPreferenceConstants.PAIR_MATCHING_COLOR,
            new RGB(192, 192, 192));

    IPreferenceStore unifiedStore = UnifiedEditorsPlugin.getDefault().getPreferenceStore();
    unifiedStore.setDefault(FoldingExtensionPointLoader.createEnablePreferenceId(CSSMimeType.MimeType), true);
}

From source file:com.aptana.ide.editor.erb.preferences.PreferenceInitializer.java

License:Open Source License

/**
 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 *///from  w  w  w .  j  a va 2  s  . c  o  m
public void initializeDefaultPreferences() {
    IPreferenceStore store = ERBPlugin.getDefault().getPreferenceStore();

    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.CODE_ASSIST_AUTO_ACTIVATION,
            false);

    store.setDefault(IPreferenceConstants.EDITORS_AUTO_CLOSE, true);

    store.setDefault(IPreferenceConstants.ERBEDITOR_INITIAL_CONTENTS,
            Messages.PreferenceInitializer_IntitialFileContents);
    store.setDefault(IPreferenceConstants.ERBEDITOR_INITIAL_FILE_NAME,
            Messages.PreferenceInitializer_Default_Filename);

    store.setDefault(IPreferenceConstants.CONTENT_ASSIST_DEBUG, false);
}

From source file:com.aptana.ide.editor.js.preferences.PreferenceInitializer.java

License:Open Source License

/**
 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 *///from   w  w w .  j  av a  2  s.  c om
public void initializeDefaultPreferences() {

    IPreferenceStore store = JSPlugin.getDefault().getPreferenceStore();
    store.setDefault(IPreferenceConstants.ENABLE_NO_VALIDATE_COMMENT, false);
    store.setDefault(IPreferenceConstants.SHOW_JS_TOOLBAR, true);
    store.setDefault(IPreferenceConstants.PREFERENCE_COMMENT_INDENT_USE_STAR, true);
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.AUTO_BRACKET_INSERTION, "INSERT"); //$NON-NLS-1$
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.CODE_ASSIST_AUTO_ACTIVATION, true);
    store.setDefault(IPreferenceConstants.AUTO_FORMAT_ON_CLOSE_CURLY, true);
    store.setDefault(IPreferenceConstants.AUTO_INDENT_ON_CARRIAGE_RETURN, true);
    store.setDefault(IPreferenceConstants.PREFERENCE_PRIVATE_FIELD_INDICATOR, "_"); //$NON-NLS-1$
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.VALIDATORS_LIST,
            Messages.PreferenceInitializer_Mozilla_javascript_validator);

    store.setDefault(IPreferenceConstants.LOADED_ENVIRONMENTS,
            JSLanguageEnvironment.DOM_5 + "," + JSLanguageEnvironment.DOM_3 + "," //$NON-NLS-1$//$NON-NLS-2$
                    + JSLanguageEnvironment.DOM_1_2 + "," //$NON-NLS-1$
                    + JSLanguageEnvironment.DOM_0);

    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_PROPOSALS_FOREGROUND_COLOR,
            IJSColorConstants.PROPOSALS_FOREGROUND);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_PROPOSALS_BACKGROUND_COLOR,
            IJSColorConstants.PROPOSALS_BACKGROUND);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_DEFAULT_COLOR,
            IJSColorConstants.DEFAULT);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_KEYWORD_COLOR,
            IJSColorConstants.KEYWORD);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_NATIVETYPE_COLOR,
            IJSColorConstants.NATIVETYPE);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_PUNCTUATOR_COLOR,
            IJSColorConstants.PUNCTUATOR);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_RESERVED_COLOR,
            IJSColorConstants.RESERVED);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_FUTURE_COLOR, IJSColorConstants.FUTURE);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_STRING_COLOR, IJSColorConstants.STRING);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_NUMBER_COLOR, IJSColorConstants.NUMBER);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_LITERAL_COLOR,
            IJSColorConstants.LITERAL);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_COMMENT_COLOR,
            IJSColorConstants.COMMENT);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_DOCUMENTATION_COLOR,
            IJSColorConstants.DOCUMENTATION);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_ERROR_COLOR, IJSColorConstants.ERROR);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_HTMLDOM_COLOR,
            IJSColorConstants.HTMLDOM);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSEDITOR_JSCORE_COLOR, IJSColorConstants.JSCORE);

    PreferenceConverter.setDefault(store, IPreferenceConstants.JSCOMMENTEDITOR_TEXT_COLOR,
            IJSCommentColorConstants.TEXT);
    PreferenceConverter.setDefault(store, IPreferenceConstants.JSCOMMENTEDITOR_DELIMITER_COLOR,
            IJSCommentColorConstants.DELIMITER);

    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_TEXT_COLOR,
            IScriptDocColorConstants.TEXT);
    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_KEYWORDCOLOR,
            IScriptDocColorConstants.KEYWORD);
    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_USER_KEYWORD_COLOR,
            IScriptDocColorConstants.KEYWORD);
    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_IDENTIFIER_COLOR,
            IScriptDocColorConstants.IDENTIFIER);
    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_PUNCTUATOR_COLOR,
            IScriptDocColorConstants.PUNCTUATOR);
    PreferenceConverter.setDefault(store, IPreferenceConstants.SCRIPTDOCEDITOR_DELIMITER_COLOR,
            IScriptDocColorConstants.DELIMITER);

    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.IGNORE_PROBLEMS,
            "~~~~~~~~-1~~~~Undefined variable.*####~~~~~~~~-1~~~~Expected an identifier and instead saw 'const'.####~~~~~~~~-1~~~~.*identifier is a reserved word.*####~~~~~~~~-1~~~~All debugger statements should be removed."); //$NON-NLS-1$
    store.setDefault(IPreferenceConstants.JSEDITOR_INITIAL_CONTENTS,
            Messages.PreferenceInitializer_InitialFileContents);
    store.setDefault(IPreferenceConstants.JSEDITOR_INITIAL_FILE_NAME,
            Messages.PreferenceInitializer_NewFileName);
    store.setDefault(IPreferenceConstants.SCRIPTDOCEDITOR_INITIAL_FILE_NAME,
            Messages.PreferenceInitializer_Default_sdoc_filename);
    store.setDefault(com.aptana.ide.editors.preferences.IPreferenceConstants.SHOW_PAIR_MATCHES,
            com.aptana.ide.editors.preferences.IPreferenceConstants.BOTH);
    PreferenceConverter.setDefault(store,
            com.aptana.ide.editors.preferences.IPreferenceConstants.PAIR_MATCHING_COLOR,
            new RGB(192, 192, 192));

    IPreferenceStore unifiedStore = UnifiedEditorsPlugin.getDefault().getPreferenceStore();
    unifiedStore.setDefault(FoldingExtensionPointLoader.createEnablePreferenceId(JSMimeType.MimeType), true);
    unifiedStore.setDefault(FoldingExtensionPointLoader.createEnablePreferenceId(ScriptDocMimeType.MimeType),
            true);

    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_IF_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_RETURN_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT,
            CommentsTabPage.INSERT);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE,
            Boolean.FALSE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE,
            Boolean.FALSE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE,
            Boolean.FALSE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, Boolean.FALSE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE,
            Boolean.FALSE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, " "); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4"); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY,
            Boolean.TRUE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK,
            Boolean.TRUE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH,
            Boolean.TRUE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES,
            Boolean.TRUE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES,
            Boolean.TRUE.toString());
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1"); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, "0"); //$NON-NLS-1$
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_PRESERVE_EXTRA_CARRIAGE_RETURNS,
            Boolean.TRUE.toString()); //$NON-NLS-1$

    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER,
            DefaultCodeFormatterConstants.END_OF_LINE);
    store.setDefault(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE,
            Boolean.TRUE.toString());
}

From source file:com.aptana.ide.editor.json.parsing.JSONParser.java

License:Open Source License

/**
 * JSONParser/*w  w  w  . ja  va  2s  .  c  o m*/
 * 
 * @param mimeType
 * @throws ParserInitializationException
 */
public JSONParser(String mimeType) throws ParserInitializationException {
    super(mimeType);

    IPreferenceStore unifiedStore = UnifiedEditorsPlugin.getDefault().getPreferenceStore();
    unifiedStore.setDefault(FoldingExtensionPointLoader.createEnablePreferenceId(JSONMimeType.MimeType), true);
}