/** {@inheritDoc} */ public Object execute(CommandLine commandLine) throws Exception { String name = commandLine.getValue(Options.PROJECT_OPTION); IProject project = ProjectUtils.getProject(name, true); String setting = commandLine.getValue(Options.SETTING_OPTION); Preferences preferences = getPreferences(); if (commandLine.hasOption(Options.VALUE_OPTION)) { String value = commandLine.getValue(Options.VALUE_OPTION); preferences.setValue(project, setting, value); return null; } return preferences.getValue(project, setting); }
/** * Loads the supplied map to be used in a template with the available preferences. * * @param project The current project. * @param preferences The eclim preferences. * @param values The values to populate. */ public static void loadPreferencesForTemplate( IProject project, Preferences preferences, Map<String, Object> values) throws Exception { Map<String, String> options = preferences.getValues(project); for (String key : options.keySet()) { String value = options.get(key); values.put(key.replace('.', '_'), value); } }