Refine search
public static String getDefaultLineDelimiter() { return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, null); } }
public static boolean isEnabled() { IPreferencesService preferenceService = Platform.getPreferencesService(); if (preferenceService == null) { return true; } return preferenceService.getBoolean(JavaCore.PLUGIN_ID, ENABLE_NEW_JAVA_INDEX, ENABLE_NEW_JAVA_INDEX_DEFAULT, null); }
fos = new FileOutputStream(file); output = new BufferedOutputStream(fos); IEclipsePreferences node = (IEclipsePreferences) service.getRootNode().node(InstanceScope.SCOPE); service.exportPreferences(node, output, (String[]) null); output.flush(); fos.getFD().sync();
/** * Is tracing enabled in the preferences store * * @return <code>true</code> if tracing is enabled in the preferences; Otherwise, <code>false</code> is returned. */ public static boolean isTracingEnabled() { final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE }; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getBoolean(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_ENABLEMENT_IDENTIFIER, false, lookupOrder); }
/** * Accessor for the output to standard output stream selection in the preference store * * @return The output to standard output stream selection in the preference store or the default value if it's not defined. */ public static String getOutputToStandardStream() { final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE }; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getString(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_OUTPUT_STANDARD_STREAM, "false", lookupOrder); //$NON-NLS-1$ }
/** * Answer the <code>Preferences</code> for the receiver, this will be a * project preferences if the receiver is editing project preferences, * otherwise instance preferences. * * @param project * the project for which the line editor will be modified * @return the preferences */ private Preferences getPreferences(IProject project) { if (project != null) { return Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE).node(project.getName()); } return Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE); }
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$ }
public static final int getScalePercentage() { int scale = Platform.getPreferencesService().getInt(IntroPlugin.PLUGIN_ID, (SCALE_FACTOR), 0, null); return scale; }
/** * Accessor for the maximum file size in the preference store * * @return The maximum file size in the preference store or the value 1000 if it's not defined. */ public static int getMaxFileSize() { final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE }; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getInt(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_MAX_FILE_SIZE_IDENTIFIER, 1000, lookupOrder); }
public CriteriaManager() { criteriaEnabled = Platform.getPreferencesService().getBoolean(HelpPlugin.PLUGIN_ID, ENABLE_CRITERIA, false, null); supportedCriteria = new ArrayList<>(); StringTokenizer criteria = new StringTokenizer(Platform.getPreferencesService().getString(HelpPlugin.PLUGIN_ID, SUPPORTED_CRITERIA, "", null), ",;"); //$NON-NLS-1$ //$NON-NLS-2$ while (criteria.hasMoreTokens()) { supportedCriteria.add(criteria.nextToken().toLowerCase().trim()); } allCriteriaValues = new HashMap<>(); if (criteriaDefinitionManager == null){ criteriaDefinitionManager = new CriteriaDefinitionManager(); } }
return getPreferencesService().getBoolean(nodePath, key, false, null); else if (descriptorsClass.equals(int.class)) return getPreferencesService().getInt(nodePath, key, 0, null); else if (descriptorsClass.equals(double.class)) return getPreferencesService().getDouble(nodePath, key, 0.0d, null); else if (descriptorsClass.equals(float.class)) return getPreferencesService().getFloat(nodePath, key, 0.0f, null); else if (descriptorsClass.equals(long.class)) return getPreferencesService().getLong(nodePath, key, 0L, null); return getPreferencesService().getString(nodePath, key, null, null); else if (Boolean.class.equals(descriptorsClass)) return getPreferencesService().getBoolean(nodePath, key, false, null); else if (Boolean.class.equals(descriptorsClass)) return getPreferencesService().getBoolean(nodePath, key, false, null); else if (Integer.class.equals(descriptorsClass)) return getPreferencesService().getInt(nodePath, key, 0, null); else if (Double.class.equals(descriptorsClass)) return getPreferencesService().getDouble(nodePath, key, 0.0d, null); else if (Float.class.equals(descriptorsClass)) return getPreferencesService().getFloat(nodePath, key, 0.0f, null); else if (Long.class.equals(descriptorsClass)) return getPreferencesService().getLong(nodePath, key, 0L, null); return getPreferencesService().getString(nodePath, key, null, null);
Preferences getSharedPreferences() { if (agentLocation == null) return null; IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(Activator.getContext(), IPreferencesService.class.getName()); if (prefService == null) return null; try { //see ProfileScope for preference path format String locationString = EncodingUtils.encodeSlashes(agentLocation.getRootLocation().toString()); return prefService.getRootNode().node("/profile/shared/" + locationString + "/_SELF_/" + getBundleId() + '/' + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ } catch (IllegalArgumentException e) { return null; } }
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()]))); }
public static void setSelectedSSHAgents(String methods){ IPreferencesService service=Platform.getPreferencesService(); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_SSHAGENT, methods); }
String getProxyType(){ IPreferencesService ps=Platform.getPreferencesService(); return ps.get(IConstants.PREF_PROXY_TYPE, "", getProxyPreferenceStore()); //$NON-NLS-1$ }
public static int getMarkerSeverity() { return Platform.getPreferencesService().getInt(SonarLintCorePlugin.UI_PLUGIN_ID, PREF_MARKER_SEVERITY, PREF_MARKER_SEVERITY_DEFAULT, null); }
/** * Accessor for the file path in the preference store * * @return The file path in the preference store or the default value if it's not defined. */ public static String getFilePath() { final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()}; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getString(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_FILE_PATH, DebugOptionsHandler.getDebugOptions().getFile().getAbsolutePath(), lookupOrder); }
/** * Accessor for the maximum file count in the preference store * * @return The maximum file count in the preference store or the value 10 if it's not defined. */ public static int getMaxFileCount() { final IScopeContext[] lookupOrder = new IScopeContext[] { InstanceScope.INSTANCE }; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getInt(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_MAX_FILE_COUNT_IDENTIFIER, 10, lookupOrder); }
if (type.isPrimitive()) { if (type.equals(boolean.class)) { return (T) Boolean.valueOf(getPreferenceService().getBoolean(path, key, ((Boolean) defaultValue).booleanValue(),null)); } else if (type.equals(int.class)) { return (T) Integer.valueOf(getPreferenceService().getInt(path, key, ((Integer) defaultValue).intValue(), null)); } else if (type.equals(double.class)) { return (T) Double.valueOf(getPreferenceService().getDouble(path, key, ((Double) defaultValue).doubleValue(), null)); } else if (type.equals(float.class)) { return (T) Float.valueOf(getPreferenceService().getFloat(path, key, ((Float) defaultValue).floatValue(), null)); } else if (type.equals(long.class)) { return (T) Long.valueOf(getPreferenceService().getLong(path, key, ((Long) defaultValue).longValue(), null)); return (T) getPreferenceService().getString(path, key, v, null); } else if (Boolean.class.equals(type)) { return (T) Boolean.valueOf(getPreferenceService().getBoolean(path, key, ((Boolean) defaultValue).booleanValue(), null)); } else if (Integer.class.equals(type)) { return (T) Integer.valueOf(getPreferenceService().getInt(path, key, ((Integer) defaultValue).intValue(), null)); } else if (Double.class.equals(type)) { return (T) Double.valueOf(getPreferenceService().getDouble(path, key, ((Double) defaultValue).doubleValue(), null)); } else if (Float.class.equals(type)) { return (T) Float.valueOf(getPreferenceService().getFloat(path, key, ((Float) defaultValue).floatValue(), null)); } else if (Long.class.equals(type)) { return (T) Long.valueOf(getPreferenceService().getLong(path, key, ((Long) defaultValue).longValue(), null)); } else { String value = getPreferenceService().getString(path, key, null, null); if( value != null ) { ValueSerializer valueSerializer = getValueSerializer();
/** * Is tracing enabled in the preferences store * * @return <code>true</code> if tracing is enabled in the preferences; Otherwise, <code>false</code> is returned. */ public static boolean isTracingEnabled() { final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()}; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getBoolean(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_ENABLEMENT_IDENTIFIER, false, lookupOrder); }