Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Preferences


    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

          }
        }
      }
    };

    Preferences p= ResourcesPlugin.getPlugin().getPluginPreferences();
    p.addPropertyChangeListener(fPropertyChangeListener);
  }
View Full Code Here

  /**
   * Disposes this encoding support.
   */
  public void dispose() {
    Preferences p= ResourcesPlugin.getPlugin().getPluginPreferences();
    p.removePropertyChangeListener(fPropertyChangeListener);

    fTextEditor= null;
  }
View Full Code Here

    super.createControl(parent);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ITextEditorHelpContextIds.TEXT_EDITOR_PREFERENCE_PAGE);
  }

  protected Preferences getPreferences() {
    return new Preferences();
  }
View Full Code Here

  }
 
  public void addRecentFile(String fileName, String menuID, String recentMenuID, String recentFilesKey, String menuLabel, PropertyChangeListener listener) {
   
    Plugin plugin = Activator.getDefault();
    Preferences prefs = plugin.getPluginPreferences();

    String recentFiles = prefs.getString(recentFilesKey);

    if (recentFiles == null) {
      recentFiles = "";
    }

    String[] recentFilesArray = recentFiles.split(";");
    String[] newFilesArray = new String[10];

    // put new file
    newFilesArray[0] = fileName;

    // move files
    for (int i = 0; i < 9; i++) {

      // check files
      if (i >= recentFilesArray.length) {
        break;
      }

      // check if file has not been already added
      if (!fileName.equals(recentFilesArray[i])) {
        newFilesArray[i + 1] = recentFilesArray[i];
      }
    }

    // now join
    recentFiles = "";
    for (String file : newFilesArray) {
      if (file != null && file != "") {
        recentFiles += file + ";";
      }
    }

    // store preference
    prefs.setValue(recentFilesKey, recentFiles);
    plugin.savePluginPreferences();
   
    // rebuild menu
    rebuildRecentFiles(menuID, recentMenuID, recentFilesKey, menuLabel, listener);
  }
View Full Code Here

   
  }

  public String[] getRecentFiles(String recentFilesKey) {
    Plugin plugin = Activator.getDefault();
    Preferences prefs = plugin.getPluginPreferences();

    String recentFiles = prefs.getString(recentFilesKey);

    return recentFiles.split(";");
  }
View Full Code Here

public class Control implements IStartup {

    public void earlyStartup ()
    {
        Preferences pref = Activator.getDefault().getPluginPreferences();
        if (pref.getBoolean(Activator.PrefAutoCheck)) {
            String awhome = pref.getString(Activator.PrefAWPath);
            if (awhome == null || awhome.length() == 0 || !new File(awhome).exists()) {
                Display.getDefault().asyncExec(new Runnable() {
                    public void run ()
                    {
                        PreferenceDialog pd = PreferencesUtil.createPreferenceDialogOn(
View Full Code Here

        return ret;
    }

  public void updateAntHome ()
    {
        Preferences pref = Activator.getDefault().getPluginPreferences();

        String awhome = pref.getString(Activator.PrefAWPath);
        File anthome = new File(awhome, "tools/ant/");
        if (awhome.length() > 0 && anthome.exists()) {
            File antLib = new File(anthome, "lib");
            String[] antJars = antLib.list(new FilenameFilter() {
                public boolean accept (File dir, String name)
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.