Examples of IPreferencesService


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

    if (isDeprecatedOption(optionName)) {
      return JavaCore.ERROR;
    }
    String propertyName = optionName;
    if (this.optionNames.contains(propertyName)){
      IPreferencesService service = Platform.getPreferencesService();
      String value =  service.get(optionName, null, this.preferencesLookup);
      return value==null ? null : value.trim();
    }
    return null;
  }
View Full Code Here

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

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

    // set options using preferences service lookup
    Iterator iterator = 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);
        }
    }
View Full Code Here

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

                removeWarningsOnClean);
        helper.flush();
    }

    private static Collection<String> getPLTPathsFromPreferences() {
        final IPreferencesService service = Platform.getPreferencesService();
        final String key = "default_plt_files";
        final String pluginId = "org.erlide.ui";
        final String pltFilesString = service.getString(pluginId, key, "", null);
        return getPltFiles(pltFilesString);
    }
View Full Code Here

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

        final String pltFilesString = service.getString(pluginId, key, "", null);
        return getPltFiles(pltFilesString);
    }

    public static String getAlternatePLTFileDirectoryFromPreferences() {
        final IPreferencesService service = Platform.getPreferencesService();
        final String key = "alternate_plt_file_directory";
        final String pluginId = "org.erlide.ui";
        return service.getString(pluginId, key, "", null);
    }
View Full Code Here

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

        multi.add(status);
        log(multi);
    }

    public static String getLogDir(final String logDir) {
        final IPreferencesService service = Platform.getPreferencesService();
        final String key = "erlide_log_directory";
        final String pluginId = ErlangCore.PLUGIN_ID;
        final String s = service.getString(pluginId, key, logDir, null);
        String dir;
        if (s != null) {
            dir = s;
        } else {
            dir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
View Full Code Here

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

  public String getExternalModules() {
    return this.getExternal(ExternalKind.EXTERNAL_MODULES);
  }
 
  private String getExternal(final ExternalKind external) {
    final IPreferencesService service = Platform.getPreferencesService();
    String _xifexpression = null;
    boolean _equals = Objects.equal(external, ExternalKind.EXTERNAL_INCLUDES);
    if (_equals) {
      _xifexpression = "default_external_includes";
    } else {
View Full Code Here

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

  protected PreferenceTransferElement[] getTransfers() {
    PreferenceTransferElement[] elements = super.getTransfers();
    PreferenceTransferElement[] returnElements = new PreferenceTransferElement[elements.length];
    IPreferenceFilter[] filters = new IPreferenceFilter[1];
    IPreferenceFilter[] matches;
    IPreferencesService service = Platform.getPreferencesService();
    int count = 0;
    try {
      for (int i = 0; i < elements.length; i++) {
        PreferenceTransferElement element = elements[i];
        filters[0] = element.getFilter();
        matches = service.matches((IEclipsePreferences) service
            .getRootNode().node("instance"), filters); //$NON-NLS-1$
        if (matches.length > 0) {
          returnElements[count++] = element;
        }
      }
View Full Code Here

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

        } catch (FileNotFoundException e) {
          WorkbenchPlugin.log(e.getMessage(), e);
          MessageDialog.openError(getControl().getShell(), new String(), e.getLocalizedMessage());
          return false;
        }
        IPreferencesService service = Platform.getPreferencesService();
        try {
          service.exportPreferences(service.getRootNode(), transfers,
              fos);
        } catch (CoreException e) {
          WorkbenchPlugin.log(e.getMessage(), e);
          MessageDialog.openError(getControl().getShell(), new String(), e.getLocalizedMessage());
          return false;
View Full Code Here

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

                fis = new FileInputStream(getDestinationValue());
            } catch (FileNotFoundException e) {
                WorkbenchPlugin.log(e.getMessage(), e);
                return new PreferenceTransferElement[0];
            }
            IPreferencesService service = Platform.getPreferencesService();
            try {
                IExportedPreferences prefs;
                prefs = service.readPreferences(fis);
                PreferenceTransferElement[] transfers = super.getTransfers();
                IPreferenceFilter[] filters = new IPreferenceFilter[transfers.length];
                for (int i = 0; i < transfers.length; i++) {
                    PreferenceTransferElement transfer = transfers[i];
                    filters[i] = transfer.getFilter();
                }
                IPreferenceFilter[] matches = service.matches(prefs, filters);
                PreferenceTransferElement[] returnTransfers = new PreferenceTransferElement[matches.length];
                int index = 0;
                for (int i = 0; i < matches.length; i++) {
                    IPreferenceFilter filter = matches[i];
                    for (int j = 0; j < transfers.length; j++) {
View Full Code Here

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

                } catch (FileNotFoundException e) {
                    WorkbenchPlugin.log(e.getMessage(), e);
                    MessageDialog.openError(getControl().getShell(), new String(), e.getLocalizedMessage());
                    return false;
                }
                IPreferencesService service = Platform.getPreferencesService();
                try {
                    IExportedPreferences prefs = service.readPreferences(fis);
                   
                    service.applyPreferences(prefs, filters);
                } catch (CoreException e) {
                    WorkbenchPlugin.log(e.getMessage(), e);
                    MessageDialog.openError(getControl().getShell(), new String(), e.getLocalizedMessage());
                    return false;
                }
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.