public String removeVariable(String name) { return configuration.removeVariable(name); } }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>0</code> if it wasn't set. */ public float removeFloatVariable(String name) { return ConfigurationSection.getFloatValue(removeVariable(name)); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>0</code> if it wasn't set. */ public long removeLongVariable(String name) { return ConfigurationSection.getLongValue(removeVariable(name)); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>false</code> if it wasn't set. */ public boolean removeBooleanVariable(String name) { return ConfigurationSection.getBooleanValue(removeVariable(name)); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>0</code> if it wasn't set. */ public int removeIntegerVariable(String name) { return ConfigurationSection.getIntegerValue(removeVariable(name)); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @return the variable's old value, or <code>0</code> if it wasn't set. */ public double removeDoubleVariable(String name) { return ConfigurationSection.getDoubleValue(removeVariable(name)); }
/** * Deletes the specified variable from the configuration. * <p> * If the variable was set, a configuration {@link ConfigurationEvent event} will be passed to * all registered LISTENERS. * </p> * @param name name of the variable to remove. * @param separator character used to split the variable's value into a list. * @return the variable's old value, or <code>null</code> if it wasn't set. */ public ValueList removeListVariable(String name, String separator) { return ConfigurationSection.getListValue(removeVariable(name), separator); }
/** * Moves the value of <code>fromVar</code> to <code>toVar</code>. * <p> * At the end of this call, <code>fromVar</code> will have been deleted. Note that if <code>fromVar</code> doesn't * exist, but <code>toVar</code> does, <code>toVar</code> will be deleted. * </p> * <p> * This method might trigger as many as two {@link ConfigurationEvent events}: * <ul> * <li>One when <code>fromVar</code> is removed.</li> * <li>One when <code>toVar</code> is set.</li> * </ul> * The removal event will always be triggered first. * </p> * @param fromVar fully qualified name of the variable to rename. * @param toVar fully qualified name of the variable that will receive <code>fromVar</code>'s value. */ public void renameVariable(String fromVar, String toVar) { setVariable(toVar, removeVariable(fromVar)); }
/** * Saves the muCommander CONFIGURATION. * @throws IOException if an I/O error occurs. * @throws ConfigurationException if a CONFIGURATION related error occurs. */ void write() throws IOException, ConfigurationException { if(configurationVersion != null && !configurationVersion.equals(RuntimeConstants.VERSION)) { // Clear the configuration before saving to drop preferences which are unused anymore Configuration conf = new Configuration(MuPreferencesFile.getPreferencesFile(), new VersionedXmlConfigurationReaderFactory(), new VersionedXmlConfigurationWriterFactory(ROOT_ELEMENT)); for (MuPreference preference : MuPreference.values()) conf.setVariable(preference.toString(), configuration.getVariable(preference.toString())); // Remove preferences which are not relevant if we're not using MAC if (!OsFamily.MAC_OS_X.isCurrent()) { conf.removeVariable(USE_BRUSHED_METAL); conf.removeVariable(USE_SCREEN_MENU_BAR); } configuration = conf; } configuration.write(); }