Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Preferences


    autoJCasAction = new Action() {
      // The run action is simply to toggle the setting in the prefs page, and
      //   to update the checked status to correspond to that
      public void run() {
        TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
        Preferences prefs = plugin.getPluginPreferences();
        boolean bAutoJCasGen = !prefs.getBoolean(PreferencePage.P_JCAS); //$NON-NLS-1$
        autoJCasAction.setChecked(bAutoJCasGen);
        prefs.setValue(PreferencePage.P_JCAS, bAutoJCasGen); //$NON-NLS-1$
      }
    };

    runJCasGenAction = new Action() {
      public void run() {
        ((MultiPageEditor) activeEditorPart).doJCasGenChkSrc(null); // don't know how to get
        // progress monitor
      }
    };

    qualifiedTypesAction = new Action() {
      public void run() {
        TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
        Preferences prefs = plugin.getPluginPreferences();
        boolean bFullyQualifiedTypeNames = !prefs
                .getBoolean(PreferencePage.P_SHOW_FULLY_QUALIFIED_NAMES); //$NON-NLS-1$
        qualifiedTypesAction.setChecked(bFullyQualifiedTypeNames);
        prefs.setValue(PreferencePage.P_SHOW_FULLY_QUALIFIED_NAMES, bFullyQualifiedTypeNames); //$NON-NLS-1$

        // mark all pages as stale for all editors, since this is a global setting
        IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
        for (int i = 0; i < pages.length; i++) {
          IWorkbenchPart[] editors = pages[i].getEditors();
View Full Code Here


    setVnsPort(getCDEVnsPort());
  }

  private static String getUimaPrefString(String key, String defaultValue) {
    TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
    Preferences prefs = plugin.getPluginPreferences();
    boolean isDefault = prefs.isDefault(key);
    if (isDefault)
      prefs.setDefault(key, defaultValue);
    return prefs.getString(key);
  }
View Full Code Here

    return prefs.getString(key);
  }

  private static boolean getUimaPrefBoolean(String key, boolean defaultValue) {
    TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
    Preferences prefs = plugin.getPluginPreferences();
    boolean isDefault = prefs.isDefault(key);
    if (isDefault)
      prefs.setDefault(key, defaultValue);
    return prefs.getBoolean(key);
  }
View Full Code Here

    return prefs.getBoolean(key);
  }

  private static int getUimaPrefInt(String key, int defaultValue) {
    TAEConfiguratorPlugin plugin = TAEConfiguratorPlugin.getDefault();
    Preferences prefs = plugin.getPluginPreferences();
    boolean isDefault = prefs.isDefault(key);
    if (isDefault)
      prefs.setDefault(key, defaultValue);
    return prefs.getInt(key);
  }
View Full Code Here

    super.stop(context);
  }

  @Override
  protected void initializeDefaultPluginPreferences() {
      Preferences preferences = plugin.getPluginPreferences();
      preferences.setDefault(PreferenceConstants.INCLUDE_CUSTOMCMDLETS, true);
      preferences.setDefault(PreferenceConstants.INCLUDE_PSCMDLETS, true);
      preferences.setDefault(PreferenceConstants.PS_SNAPIN_FILES, "");
      preferences.setDefault(PreferenceConstants.TAB_WIDTH, 4);
      preferences.setDefault(PreferenceConstants.COLOR_COMMENT, "0,128,0");
        preferences.setDefault(PreferenceConstants.COLOR_STRING, "0,128,255");
        preferences.setDefault(PreferenceConstants.COLOR_VARIABLE, "200,50,50");
        preferences.setDefault(PreferenceConstants.COLOR_KEYWORD, "128,0,64");
        preferences.setDefault(PreferenceConstants.COLOR_DASH_KEYWORD, "255,0,64");
        preferences.setDefault(PreferenceConstants.COLOR_OTHER, "0,0,0");
  }
View Full Code Here

   * DOMContentBuilder constructor comment.
   * @param document org.w3c.dom.Document
   */
  public HTMLContentBuilder(Document document) {
    super(document);
    Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
    fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
    fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
    //  Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
    //  fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
    //  fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
  }
View Full Code Here

  public IStructuredFormatPreferences getFormatPreferences() {
    if (fFormatPreferences == null) {
      fFormatPreferences = new StructuredFormatPreferencesXML();

      Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
      if (preferences != null) {
        fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
        fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));

        char indentChar = ' ';
        String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
        if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
          indentChar = '\t';
        }
        int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);

        StringBuffer indent = new StringBuffer();
        for (int i = 0; i < indentationWidth; i++) {
          indent.append(indentChar);
        }
View Full Code Here

  protected StructuredFormatPreferencesXML getFormatPreferences() {
    if (fFormatPreferences == null) {
      fFormatPreferences = new StructuredFormatPreferencesXML();

      Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
      if (preferences != null) {
        fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
        fFormatPreferences.setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
        fFormatPreferences.setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
        fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));

        char indentChar = ' ';
        String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
        if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
          indentChar = '\t';
        }
        int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);

        StringBuffer indent = new StringBuffer();
        for (int i = 0; i < indentationWidth; i++) {
          indent.append(indentChar);
        }
View Full Code Here

  public IStructuredCleanupPreferences getCleanupPreferences() {
    if (fCleanupPreferences == null) {
      fCleanupPreferences = new StructuredCleanupPreferences();

      Preferences preferences = getModelPreferences();
      if (preferences != null) {
        fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
        fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
        fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
        fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
        fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
        fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
        fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
        fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
        fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
      }
    }

    return fCleanupPreferences;
  }
View Full Code Here

  public IStructuredCleanupPreferences getCleanupPreferences() {
    if (fCleanupPreferences == null) {
      fCleanupPreferences = new StructuredCleanupPreferences();
 
      Preferences preferences = getModelPreferences();
      if (preferences != null) {
        fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
        fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
        fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
        fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
        fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
        fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
        fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
        fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
        fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
      }
    }

    return fCleanupPreferences;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Preferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.