protected boolean getBooleanPreference(String key, boolean defaultValue) { IPreferencesService prefService = GCActivator.getService(IPreferencesService.class); if (prefService == null) return defaultValue; List<IEclipsePreferences> nodes = new ArrayList<>(); // todo we should look in the instance scope as well but have to be careful that the instance location has been set nodes.add(ConfigurationScope.INSTANCE.getNode(GCActivator.ID)); nodes.add(DefaultScope.INSTANCE.getNode(GCActivator.ID)); return Boolean.parseBoolean(prefService.get(key, Boolean.toString(defaultValue), nodes.toArray(new Preferences[nodes.size()]))); }
protected boolean getBooleanPreference(String key, boolean defaultValue) { IPreferencesService prefService = GCActivator.getService(IPreferencesService.class); if (prefService == null) return defaultValue; List<IEclipsePreferences> nodes = new ArrayList<IEclipsePreferences>(); // todo we should look in the instance scope as well but have to be careful that the instance location has been set nodes.add(ConfigurationScope.INSTANCE.getNode(GCActivator.ID)); nodes.add(DefaultScope.INSTANCE.getNode(GCActivator.ID)); return Boolean.parseBoolean(prefService.get(key, Boolean.toString(defaultValue), nodes.toArray(new Preferences[nodes.size()]))); }
boolean isUseProxy(){ IPreferencesService ps=Platform.getPreferencesService(); String value=ps.get(IConstants.PREF_USE_PROXY, "false", getProxyPreferenceStore()); //$NON-NLS-1$ return value==null ? false : !value.equals("false"); //$NON-NLS-1$ }
protected boolean getBooleanPreference(String key, boolean defaultValue) { IPreferencesService prefService = GCActivator.getService(IPreferencesService.class); if (prefService == null) return defaultValue; List<IEclipsePreferences> nodes = new ArrayList<IEclipsePreferences>(); // todo we should look in the instance scope as well but have to be careful that the instance location has been set nodes.add(new ConfigurationScope().getNode(GCActivator.ID)); nodes.add(new DefaultScope().getNode(GCActivator.ID)); return Boolean.valueOf(prefService.get(key, Boolean.toString(defaultValue), nodes.toArray(new Preferences[nodes.size()]))).booleanValue(); }
protected boolean getBooleanPreference(String key, boolean defaultValue) { IPreferencesService prefService = GCActivator.getService(IPreferencesService.class); if (prefService == null) return defaultValue; List<IEclipsePreferences> nodes = new ArrayList<IEclipsePreferences>(); // todo we should look in the instance scope as well but have to be careful that the instance location has been set nodes.add(new ConfigurationScope().getNode(GCActivator.ID)); nodes.add(new DefaultScope().getNode(GCActivator.ID)); return Boolean.valueOf(prefService.get(key, Boolean.toString(defaultValue), nodes.toArray(new Preferences[nodes.size()]))).booleanValue(); }
boolean isUseProxyAuth(){ IPreferencesService ps=Platform.getPreferencesService(); String value=ps.get(IConstants.PREF_PROXY_AUTH, "false", getProxyPreferenceStore()); //$NON-NLS-1$ return value==null ? false : !value.equals("false"); //$NON-NLS-1$ }
String getProxyType(){ IPreferencesService ps=Platform.getPreferencesService(); return ps.get(IConstants.PREF_PROXY_TYPE, "", getProxyPreferenceStore()); //$NON-NLS-1$ }
@Override public boolean isDefault(String name) { if (name == null) { return false; } return (Platform.getPreferencesService().get(name, null, getPreferenceNodes(false))) == null; }
/** * Return the string value for the specified key. Look in the nodes which * are specified by this object's list of search scopes. If the value does * not exist then return <code>null</code>. * * @param key * the key to search with * @return String or <code>null</code> if the value does not exist. */ private String internalGet(String key) { return Platform.getPreferencesService().get(key, null, getPreferenceNodes(true)); }
public boolean isDefault(String name) { if (name == null) { return false; } return (Platform.getPreferencesService().get(name, null, getPreferenceNodes(false))) == null; }
/** * Return the string value for the specified key. Look in the nodes which * are specified by this object's list of search scopes. If the value does * not exist then return <code>null</code>. * * @param key * the key to search with * @return String or <code>null</code> if the value does not exist. */ private String internalGet(String key) { return Platform.getPreferencesService().get(key, null, getPreferenceNodes(true)); }
public boolean contains(String name) { if (name == null) { return false; } return (Platform.getPreferencesService().get(name, null, getPreferenceNodes(true))) != null; }
@Override public boolean contains(String name) { if (name == null) { return false; } return (Platform.getPreferencesService().get(name, null, getPreferenceNodes(true))) != null; }
public String getOption(String optionName) { if (JavaCore.CORE_ENCODING.equals(optionName)){ return JavaCore.getEncoding(); } // backward compatibility 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; }
String getProxyPort(){ IPreferencesService ps=Platform.getPreferencesService(); return ps.get(IConstants.PREF_PROXY_PORT, "", getProxyPreferenceStore()); //$NON-NLS-1$ }
String getProxyHost(){ IPreferencesService ps=Platform.getPreferencesService(); return ps.get(IConstants.PREF_PROXY_HOST, "", getProxyPreferenceStore()); //$NON-NLS-1$ }
public String getOption(String optionName) { if (JavaCore.CORE_ENCODING.equals(optionName)){ return JavaCore.getEncoding(); } // backward compatibility 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; }
public String getOption(String optionName) { if (JavaCore.CORE_ENCODING.equals(optionName)){ return JavaCore.getEncoding(); } // backward compatibility 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 = this.deprecatedOptions.get(optionName); value = service.get(compatibleOptions[0], null, this.preferencesLookup); } return value==null ? null : value.trim(); } return null; }
public String getOption(String optionName) { if (JavaCore.CORE_ENCODING.equals(optionName)){ return JavaCore.getEncoding(); } // backward compatibility 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; }
@Override public boolean hasSpecificProjectSettings(IProject project) { if(project != null) { Preferences[] prefs = new Preferences[] {new ProjectScope(project).getNode(MavenJdtAptPlugin.PLUGIN_ID)}; IPreferencesService service = Platform.getPreferencesService(); for(String optionName : PreferencesConstants.DEFAULT_OPTIONS.keySet()) { if(service.get(optionName, null, prefs) != null) { return true; } } } return false; }