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();
}
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());
}
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());
}
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()));
}
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());
}
Aggregations