Example usage for org.apache.commons.configuration FileConfiguration setAutoSave

List of usage examples for org.apache.commons.configuration FileConfiguration setAutoSave

Introduction

In this page you can find the example usage for org.apache.commons.configuration FileConfiguration setAutoSave.

Prototype

void setAutoSave(boolean autoSave);

Source Link

Document

Enable or disable the automatical saving of modified properties to the disk.

Usage

From source file:org.parosproxy.paros.view.AbstractFrame.java

private void storeLocation() {
    if (frameName == null) {
        return;/*  w w w . j  a  va2 s.  c  o m*/
    }

    FileConfiguration config = loadConfig();
    String configName = "ui." + frameName;
    Point location = getLocation();
    config.setAutoSave(true);
    config.setProperty(configName + PROP_LEFT, Integer.toString(location.x));
    config.setProperty(configName + PROP_TOP, Integer.toString(location.y));
    config.setProperty(configName + PROP_WIDTH, Integer.toString(getWidth()));
    config.setProperty(configName + PROP_HEIGHT, Integer.toString(getHeight()));

    try {
        config.save();
    } catch (ConfigurationException e) {
        e.printStackTrace();
    }

    System.out.println("STORE " + frameName + "  " + location.x + "  " + location.y + "  " + getWidth() + "  "
            + getHeight());

}