Examples of IPreferencesService


Examples of org.eclipse.core.runtime.preferences.IPreferencesService

  /**
   * Returns the value of the integer preference corresponding to the given key,
   * or the provided default value if not defined.
   */
  public static int getInt(String key, int defaultValue) {
    IPreferencesService service = Activator.getPreferenceService();
    if (service == null)
      return defaultValue;
    return service.getInt(ServerConstants.PREFERENCE_SCOPE, key, defaultValue, null);
  }
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

    if (isDeprecatedOption(optionName)) {
      return JavaCore.ERROR;
    }
    int optionLevel = getOptionLevel(optionName);
    if (optionLevel != UNKNOWN_OPTION){
      IPreferencesService service = Platform.getPreferencesService();
      String value = service.get(optionName, null, this.preferencesLookup);
      if (value == null && optionLevel == DEPRECATED_OPTION) {
        // May be a deprecated option, retrieve the new value in compatible options
        String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
        value = service.get(compatibleOptions[0], null, this.preferencesLookup);
      }
      return value==null ? null : value.trim();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

      this.optionsCache = getDefaultOptionsNoInitialization();
      return new Hashtable(this.optionsCache);
    }
    // init
    Hashtable options = new Hashtable(10);
    IPreferencesService service = Platform.getPreferencesService();

    // set options using preferences service lookup
    Iterator iterator = this.optionNames.iterator();
    while (iterator.hasNext()) {
      String propertyName = (String) iterator.next();
      String propertyValue = service.get(propertyName, null, this.preferencesLookup);
      if (propertyValue != null) {
        options.put(propertyName, propertyValue);
      }
    }

    // set deprecated options using preferences service lookup
    Iterator deprecatedEntries = this.deprecatedOptions.entrySet().iterator();
    while (deprecatedEntries.hasNext()) {
      Entry entry = (Entry) deprecatedEntries.next();
      String propertyName = (String) entry.getKey();
      String propertyValue = service.get(propertyName, null, this.preferencesLookup);
      if (propertyValue != null) {
        options.put(propertyName, propertyValue);
        String[] compatibleOptions = (String[]) entry.getValue();
        for (int co=0, length=compatibleOptions.length; co < length; co++) {
          String compatibleOption = compatibleOptions[co];
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

        //printKeyEvent(e);
        //System.out.println("accelerat:\t" + accelerator + "\t (" +
        // KeySupport.formatStroke(Stroke.create(accelerator), true) +
        // ")");

                final IPreferencesService service = Platform.getPreferencesService();
                final boolean stickyCycle = service.getBoolean(
                        "org.eclipse.ui.workbench", "STICKY_CYCLE", false, null); //$NON-NLS-1$ //$NON-NLS-2$
        if ((!stickyCycle && (firstKey || quickReleaseMode)) && keyCode == stateMask)
          ok(dialog, table);
            }
        });
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

        //printKeyEvent(e);
        //System.out.println("accelerat:\t" + accelerator + "\t (" +
        // KeySupport.formatStroke(Stroke.create(accelerator), true) +
        // ")");

                final IPreferencesService service = Platform.getPreferencesService();
                final boolean stickyCycle = service.getBoolean(
                        "org.eclipse.ui.workbench", "STICKY_CYCLE", false, null); //$NON-NLS-1$ //$NON-NLS-2$
        if ((!stickyCycle && (firstKey || quickReleaseMode)) && keyCode == stateMask)
          ok(dialog, table);
            }
        });
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

    proxyService.setProxyScanEnabled(!oldValue);
    return null;
  }
 
  private void configureScanner(IScannerConfig config) {
    final IPreferencesService preferencesService = Platform.getPreferencesService();
    final boolean logAll = preferencesService.getBoolean(SCANNER_PLUGIN, P_LOG_ALL_REQUESTS, false, null);
    final boolean displayDebug = preferencesService.getBoolean(SCANNER_PLUGIN, P_DISPLAY_DEBUG_OUTPUT, false, null);
    config.setLogAllRequests(logAll);
    config.setDisplayDebugOutput(displayDebug);
  }
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

    public long getCurrentTime() {
        return System.currentTimeMillis();
    }

    public String getApplicationId() {
        IPreferencesService preferencesService = Platform.getPreferencesService();
        if (preferencesService == null) {
            return TESTING_ID;
        }
        //Note: this is the same qualifier/id used by aptana plugins (so that we don't generate
        //a new one if there's already one registered).
        String qualifier = "com.aptana.db";
        String key = "ide-id";
        String id = preferencesService.getString(qualifier, key, null, null);

        if (id == null) {
            Preferences node = null;
            String keyNodeInPrefs = qualifier + "." + key;
            String keySettingInPrefs = "UUID";
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

     *
     * @return the String to use for indenting
     */
    private String indentStringFromEditorsUIPreferences() {
       
        IPreferencesService ps = Platform.getPreferencesService();
        boolean spacesForTabs = ps.getBoolean(
                EditorsUI.PLUGIN_ID,
                AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS,
                false,
                null
                );
        if (spacesForTabs) {
            int tabWidth = ps.getInt(
                    EditorsUI.PLUGIN_ID,
                    AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH,
                    4,
                    null
                    );
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

    if (isDeprecatedOption(optionName)) {
      return JavaCore.ERROR;
    }
    int optionLevel = getOptionLevel(optionName);
    if (optionLevel != UNKNOWN_OPTION){
      IPreferencesService service = Platform.getPreferencesService();
      String value = service.get(optionName, null, this.preferencesLookup);
      if (value == null && optionLevel == DEPRECATED_OPTION) {
        // May be a deprecated option, retrieve the new value in compatible options
        String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
        value = service.get(compatibleOptions[0], null, this.preferencesLookup);
      }
      return value==null ? null : value.trim();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IPreferencesService

      this.optionsCache = getDefaultOptionsNoInitialization();
      return new Hashtable(this.optionsCache);
    }
    // init
    Hashtable options = new Hashtable(10);
    IPreferencesService service = Platform.getPreferencesService();

    // set options using preferences service lookup
    Iterator iterator = this.optionNames.iterator();
    while (iterator.hasNext()) {
      String propertyName = (String) iterator.next();
      String propertyValue = service.get(propertyName, null, this.preferencesLookup);
      if (propertyValue != null) {
        options.put(propertyName, propertyValue);
      }
    }

    // set deprecated options using preferences service lookup
    Iterator deprecatedEntries = this.deprecatedOptions.entrySet().iterator();
    while (deprecatedEntries.hasNext()) {
      Entry entry = (Entry) deprecatedEntries.next();
      String propertyName = (String) entry.getKey();
      String propertyValue = service.get(propertyName, null, this.preferencesLookup);
      if (propertyValue != null) {
        options.put(propertyName, propertyValue);
        String[] compatibleOptions = (String[]) entry.getValue();
        for (int co=0, length=compatibleOptions.length; co < length; co++) {
          String compatibleOption = compatibleOptions[co];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.