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

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

Introduction

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

Prototype

void setProperty(String key, Object value);

Source Link

Document

Set a property, this will replace any previously set values.

Usage

From source file:org.zaproxy.zap.extension.httppanel.component.HttpPanelComponentViewsManager.java

public void saveConfig(FileConfiguration fileConfiguration) {
    if (currentView != null) {
        fileConfiguration.setProperty(configurationKey + DEFAULT_VIEW_KEY, currentView.getName());
    }//from w  w  w.  ja  v  a2s. c o  m

    Iterator<HttpPanelView> it = views.values().iterator();
    while (it.hasNext()) {
        it.next().saveConfiguration(fileConfiguration);
    }
}

From source file:org.zaproxy.zap.extension.httppanel.HttpPanel.java

public void saveConfig(FileConfiguration fileConfiguration) {
    if (currentComponent != null) {
        fileConfiguration.setProperty(baseConfigurationKey + DEFAULT_COMPONENT_KEY, currentComponent.getName());
    }/*from  w  w  w . j  ava  2 s . com*/

    synchronized (components) {
        Iterator<HttpPanelComponentInterface> it = components.values().iterator();
        while (it.hasNext()) {
            it.next().saveConfig(fileConfiguration);
        }
    }
}

From source file:org.zaproxy.zap.extension.httppanel.view.syntaxhighlight.AutoDetectSyntaxHttpPanelTextArea.java

@Override
public void saveConfiguration(String key, FileConfiguration fileConfiguration) {
    super.saveConfiguration(key, fileConfiguration);

    fileConfiguration.setProperty(key + "syntax." + AUTO_DETECT, Boolean.valueOf(isAutoDetectSyntax));
}

From source file:org.zaproxy.zap.extension.httppanel.view.syntaxhighlight.HttpPanelSyntaxHighlightTextArea.java

public void saveConfiguration(String key, FileConfiguration fileConfiguration) {
    fileConfiguration.setProperty(key + ANTI_ALIASING, Boolean.valueOf(this.getAntiAliasingEnabled()));

    Component c = getParent();// w  w w . j a v  a  2 s .c  o  m
    if (c instanceof JViewport) {
        c = c.getParent();
        if (c instanceof RTextScrollPane) {
            final RTextScrollPane scrollPane = (RTextScrollPane) c;
            fileConfiguration.setProperty(key + SHOW_LINE_NUMBERS,
                    Boolean.valueOf(scrollPane.getLineNumbersEnabled()));
        }
    }

    fileConfiguration.setProperty(key + WORD_WRAP, Boolean.valueOf(this.getLineWrap()));

    fileConfiguration.setProperty(key + HIGHLIGHT_CURRENT_LINE,
            Boolean.valueOf(this.getHighlightCurrentLine()));
    fileConfiguration.setProperty(key + FADE_CURRENT_HIGHLIGHT_LINE,
            Boolean.valueOf(this.getFadeCurrentLineHighlight()));

    fileConfiguration.setProperty(key + SHOW_WHITESPACE_CHARACTERS,
            Boolean.valueOf(this.isWhitespaceVisible()));
    fileConfiguration.setProperty(key + SHOW_NEWLINE_CHARACTERS, Boolean.valueOf(this.getEOLMarkersVisible()));

    fileConfiguration.setProperty(key + MARK_OCCURRENCES, Boolean.valueOf(this.getMarkOccurrences()));

    fileConfiguration.setProperty(key + ROUNDED_SELECTION_EDGES,
            Boolean.valueOf(this.getRoundedSelectionEdges()));

    fileConfiguration.setProperty(key + BRACKET_MATCHING, Boolean.valueOf(this.isBracketMatchingEnabled()));
    fileConfiguration.setProperty(key + ANIMATED_BRACKET_MATCHING,
            Boolean.valueOf(this.getAnimateBracketMatching()));
}

From source file:org.zaproxy.zap.extension.scripts.SyntaxHighlightTextArea.java

public void saveConfiguration(String key, FileConfiguration fileConfiguration) {
    fileConfiguration.setProperty(key + ANTI_ALIASING, Boolean.valueOf(this.getAntiAliasingEnabled()));

    Component c = getParent();// w  w w.  j av a 2s.com
    if (c instanceof JViewport) {
        c = c.getParent();
        if (c instanceof RTextScrollPane) {
            final RTextScrollPane scrollPane = (RTextScrollPane) c;
            fileConfiguration.setProperty(key + SHOW_LINE_NUMBERS,
                    Boolean.valueOf(scrollPane.getLineNumbersEnabled()));
            fileConfiguration.setProperty(key + CODE_FOLDING, Boolean.valueOf(this.isCodeFoldingEnabled()));
        }
    }

    fileConfiguration.setProperty(key + WORD_WRAP, Boolean.valueOf(this.getLineWrap()));

    fileConfiguration.setProperty(key + HIGHLIGHT_CURRENT_LINE,
            Boolean.valueOf(this.getHighlightCurrentLine()));
    fileConfiguration.setProperty(key + FADE_CURRENT_HIGHLIGHT_LINE,
            Boolean.valueOf(this.getFadeCurrentLineHighlight()));

    fileConfiguration.setProperty(key + SHOW_WHITESPACE_CHARACTERS,
            Boolean.valueOf(this.isWhitespaceVisible()));
    fileConfiguration.setProperty(key + SHOW_NEWLINE_CHARACTERS, Boolean.valueOf(this.getEOLMarkersVisible()));

    fileConfiguration.setProperty(key + MARK_OCCURRENCES, Boolean.valueOf(this.getMarkOccurrences()));

    fileConfiguration.setProperty(key + ROUNDED_SELECTION_EDGES,
            Boolean.valueOf(this.getRoundedSelectionEdges()));

    fileConfiguration.setProperty(key + BRACKET_MATCHING, Boolean.valueOf(this.isBracketMatchingEnabled()));
    fileConfiguration.setProperty(key + ANIMATED_BRACKET_MATCHING,
            Boolean.valueOf(this.getAnimateBracketMatching()));
}

From source file:org.zaproxy.zap.view.MessagePanelsPositionController.java

public void saveState(MessagePanelsPosition currentPosition) {
    FileConfiguration configuration = Model.getSingleton().getOptionsParam().getConfig();

    configuration.setProperty(LAST_POSITION_CONFIG_KEY, currentPosition.toString());
}

From source file:umich.ms.batmass.gui.viewers.map2d.options.Map2DOptionsPanel.java

void store() throws ConfigurationException, IOException {
    updateConfigToUIState();//from   w w  w  .j a va 2 s .  c o  m

    FileConfiguration userConfig = BmConfig.forClass(BaseMap2D.class);
    for (Iterator<String> i = config.getKeys(); i.hasNext();) {
        String key = i.next();
        Object value = config.getProperty(key);
        userConfig.setProperty(key, value);
    }
    userConfig.save();
}