Search in sources :

Example 21 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsStatsPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam optionsParam = (OptionsParam) obj;
    StatsParam statsParam = optionsParam.getParamSet(StatsParam.class);
    getInMemoryStatsEnabledField().setSelected(statsParam.isInMemoryEnabled());
    getStatsdStatsEnabledField().setSelected(statsParam.isStatsdEnabled());
    getStatsdHostField().setText(statsParam.getStatsdHost());
    getStatsdHostField().discardAllEdits();
    getStatsdPortField().setValue(statsParam.getStatsdPort());
    getStatsdPrefixField().setText(statsParam.getStatsdPrefix());
    getStatsdPrefixField().discardAllEdits();
    setStatsdFieldStates();
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 22 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsScriptPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam optionsParam = (OptionsParam) obj;
    ScriptParam param = optionsParam.getParamSet(ScriptParam.class);
    getScriptDirModel().setTokens(param.getScriptDirs());
    tokensOptionsPanel.setRemoveWithoutConfirmation(!param.isConfirmRemoveDir());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 23 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsScriptPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam optionsParam = (OptionsParam) obj;
    ScriptParam param = optionsParam.getParamSet(ScriptParam.class);
    // Work out whats changed..
    List<File> dirs = getScriptDirModel().getElements();
    // Look for removed ones
    for (File dir : param.getScriptDirs()) {
        if (!dirs.contains(dir)) {
            // Its been removed
            extension.removeScriptsFromDir(dir);
        }
    }
    // Look for added ones
    for (File dir : dirs) {
        if (!param.getScriptDirs().contains(dir)) {
            // Its been added
            extension.addScriptsFromDir(dir);
        }
    }
    param.setScriptDirs(dirs);
    param.setConfirmRemoveDir(!tokensOptionsPanel.isRemoveWithoutConfirmation());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) File(java.io.File)

Example 24 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsSearchPanel method initParam.

@Override
public void initParam(Object obj) {
    final OptionsParam options = (OptionsParam) obj;
    final SearchParam param = options.getParamSet(SearchParam.class);
    numberSpinnerMaxSearchResultsGUI.setValue(Integer.valueOf(param.getMaximumSearchResultsGUI()));
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 25 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsSearchPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    final OptionsParam options = (OptionsParam) obj;
    final SearchParam param = options.getParamSet(SearchParam.class);
    param.setMaximumSearchResultsGUI(numberSpinnerMaxSearchResultsGUI.getValue().intValue());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Aggregations

OptionsParam (org.parosproxy.paros.model.OptionsParam)56 ScannerParam (org.parosproxy.paros.core.scanner.ScannerParam)4 ConnectionParam (org.parosproxy.paros.network.ConnectionParam)4 File (java.io.File)3 ViewLocale (org.zaproxy.zap.view.ViewLocale)3 ProxyParam (org.parosproxy.paros.core.proxy.ProxyParam)2 Extension (org.parosproxy.paros.extension.Extension)2 SpiderParam (org.zaproxy.zap.spider.SpiderParam)2 HeadlessException (java.awt.HeadlessException)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 MissingResourceException (java.util.MissingResourceException)1 JButton (javax.swing.JButton)1 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 JXErrorPane (org.jdesktop.swingx.JXErrorPane)1 ErrorInfo (org.jdesktop.swingx.error.ErrorInfo)1