protected void adjustSourceCompatibility(String value) { Hashtable map = JavaCore.getOptions(); map.put(JavaCore.COMPILER_SOURCE, value); JavaCore.setOptions(map); }
protected void adjustSourceCompatibility(String value) { Hashtable map = JavaCore.getOptions(); map.put(JavaCore.COMPILER_SOURCE, value); JavaCore.setOptions(map); }
private static void setFormattingOptions(Map<String, String> options) { Map<String, String> defaultOptions = DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap(); defaultOptions.putAll(options); Hashtable<String, String> javaOptions = JavaCore.getOptions(); defaultOptions.entrySet().stream().filter(p -> p.getKey().startsWith(FORMATTER_OPTION_PREFIX)).forEach(p -> { javaOptions.put(p.getKey(), p.getValue()); }); JavaCore.setOptions(javaOptions); }
/** * Tells this processor to restrict its proposal to those element * visible in the actual invocation context. * * @param restrict <code>true</code> if proposals should be restricted */ private static void restrictProposalsToVisibility(boolean restrict) { Hashtable options= JavaCore.getOptions(); Object value= options.get(VISIBILITY); if (value instanceof String) { String newValue= restrict ? ENABLED : DISABLED; if (!newValue.equals(value)) { options.put(VISIBILITY, newValue); JavaCore.setOptions(options); } } }
/** * Tells this processor to restrict its proposal to those element * visible in the actual invocation context. * * @param restrict <code>true</code> if proposals should be restricted */ public void restrictProposalsToVisibility(boolean restrict) { Hashtable<String, String> options= JavaCore.getOptions(); Object value= options.get(VISIBILITY); if (value instanceof String) { String newValue= restrict ? ENABLED : DISABLED; if ( !newValue.equals(value)) { options.put(VISIBILITY, newValue); JavaCore.setOptions(options); } } }
/** * Tells this processor to restrict its proposal to those element * visible in the actual invocation context. * * @param restrict <code>true</code> if proposals should be restricted */ public void restrictProposalsToVisibility(boolean restrict) { Hashtable<String, String> options= JavaCore.getOptions(); Object value= options.get(VISIBILITY); if (value instanceof String) { String newValue= restrict ? ENABLED : DISABLED; if ( !newValue.equals(value)) { options.put(VISIBILITY, newValue); JavaCore.setOptions(options); } } }
/** * Tells this processor to restrict its proposal to those element * visible in the actual invocation context. * * @param restrict <code>true</code> if proposals should be restricted */ public void restrictProposalsToVisibility(boolean restrict) { Hashtable options= JavaCore.getOptions(); Object value= options.get(VISIBILITY); if (value instanceof String) { String newValue= restrict ? ENABLED : DISABLED; if ( !newValue.equals(value)) { options.put(VISIBILITY, newValue); JavaCore.setOptions(options); } } }
JavaCore.setOptions(options);
public static void configureFormatter(PreferenceManager preferenceManager, ProjectsManager projectsManager) { String formatterUrl = preferenceManager.getPreferences().getFormatterUrl(); Map<String, String> options = null; if (formatterUrl != null) { URL url = projectsManager.getUrl(formatterUrl); if (url != null) { try (InputStream inputStream = url.openStream()) { InputSource inputSource = new InputSource(inputStream); String profileName = preferenceManager.getPreferences().getFormatterProfileName(); options = FormatterManager.readSettingsFromStream(inputSource, profileName); } catch (Exception e) { JavaLanguageServerPlugin.logException(e.getMessage(), e); } } else { JavaLanguageServerPlugin.logInfo("Invalid formatter:" + formatterUrl); } } if (options != null && !options.isEmpty()) { setFormattingOptions(options); } else { Map<String, String> defaultOptions = DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap(); Hashtable<String, String> javaOptions = JavaCore.getOptions(); defaultOptions.forEach((k, v) -> { javaOptions.put(k, v); }); JavaCore.setOptions(javaOptions); JavaLanguageServerPlugin.getPreferencesManager().initialize(); } }
@Override public boolean performOk() { IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); List<String> checked= fFilterListField.getCheckedElements(); List<String> unchecked= fFilterListField.getElements(); unchecked.removeAll(checked); prefs.setValue(PREF_FILTER_ENABLED, packOrderList(checked)); prefs.setValue(PREF_FILTER_DISABLED, packOrderList(unchecked)); JavaPlugin.flushInstanceScope(); Hashtable<String, String> coreOptions= JavaCore.getOptions(); String hideForbidden= fHideForbiddenField.isSelected() ? JavaCore.ENABLED : JavaCore.DISABLED; coreOptions.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, hideForbidden); String hideDiscouraged= fHideDiscouragedField.isSelected() ? JavaCore.ENABLED : JavaCore.DISABLED; coreOptions.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, hideDiscouraged); JavaCore.setOptions(coreOptions); return true; }
@Override public boolean performOk() { IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); List<String> checked= fFilterListField.getCheckedElements(); List<String> unchecked= fFilterListField.getElements(); unchecked.removeAll(checked); prefs.setValue(PREF_FILTER_ENABLED, packOrderList(checked)); prefs.setValue(PREF_FILTER_DISABLED, packOrderList(unchecked)); JavaPlugin.flushInstanceScope(); Hashtable<String, String> coreOptions= JavaCore.getOptions(); String hideForbidden= fHideForbiddenField.isSelected() ? JavaCore.ENABLED : JavaCore.DISABLED; coreOptions.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, hideForbidden); String hideDiscouraged= fHideDiscouragedField.isSelected() ? JavaCore.ENABLED : JavaCore.DISABLED; coreOptions.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, hideDiscouraged); JavaCore.setOptions(coreOptions); return true; }
Hashtable options = new Hashtable(oldOptions); options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.DISABLED); JavaCore.setOptions(options); ); } finally { JavaCore.setOptions(oldOptions);
Hashtable options = new Hashtable(oldOptions); options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.DISABLED); JavaCore.setOptions(options); ); } finally { JavaCore.setOptions(oldOptions);
Hashtable options = new Hashtable(oldOptions); options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.DISABLED); JavaCore.setOptions(options); ); } finally { JavaCore.setOptions(oldOptions);
Hashtable options = new Hashtable(oldOptions); options.put(JavaCore.CODEASSIST_CAMEL_CASE_MATCH, JavaCore.DISABLED); JavaCore.setOptions(options); ); } finally { JavaCore.setOptions(oldOptions);
javaCoreOptions.put(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED); javaCoreOptions.put(DefaultCodeFormatterConstants.FORMATTER_USE_ON_OFF_TAGS, DefaultCodeFormatterConstants.TRUE); JavaCore.setOptions(javaCoreOptions);
Hashtable map= JavaCore.getOptions(); JavaModelUtil.set50CompilanceOptions(map); JavaCore.setOptions(map); } else { Map map= fProject.getOptions(false);
Hashtable<String, String> map= JavaCore.getOptions(); JavaModelUtil.setComplianceOptions(map, fRequiredVersion); JavaCore.setOptions(map); } else { Map<String, String> map= fProject.getOptions(false);
Hashtable<String, String> map= JavaCore.getOptions(); JavaModelUtil.setComplianceOptions(map, fRequiredVersion); JavaCore.setOptions(map); } else { Map<String, String> map= fProject.getOptions(false);