Search in sources :

Example 51 with OptionsParam

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

the class DynamicSSLPanel method initParam.

@Override
public void initParam(Object obj) {
    final OptionsParam options = (OptionsParam) obj;
    final DynSSLParam param = options.getParamSet(DynSSLParam.class);
    setRootca(param.getRootca());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 52 with OptionsParam

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

the class EncodeDecodeParamPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    final OptionsParam options = (OptionsParam) obj;
    final EncodeDecodeParam param = options.getParamSet(EncodeDecodeParam.class);
    param.setBase64Charset((String) comboBoxBase64Charset.getSelectedItem());
    param.setBase64DoBreakLines(checkBoxBase64DoBreakLines.isSelected());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 53 with OptionsParam

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

the class OptionsExtensionPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam optionsParam = (OptionsParam) obj;
    Map<String, Boolean> extensionsState = new HashMap<>();
    List<Extension> exts = extensionModel.getExtensions();
    for (Extension ext : exts) {
        extensionsState.put(ext.getName(), ext.isEnabled());
    }
    optionsParam.getExtensionParam().setExtensionsState(extensionsState);
}
Also used : Extension(org.parosproxy.paros.extension.Extension) OptionsParam(org.parosproxy.paros.model.OptionsParam) HashMap(java.util.HashMap)

Example 54 with OptionsParam

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

the class OptionsDialog method getExtraButtons.

@Override
public JButton[] getExtraButtons() {
    if (extraButtons == null) {
        JButton resetButton = new JButton(Constant.messages.getString("options.dialog.reset.button"));
        resetButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (View.getSingleton().showConfirmDialog(OptionsDialog.this, Constant.messages.getString("options.dialog.reset.warn")) == JOptionPane.OK_OPTION) {
                    try {
                        OptionsParam params = Model.getSingleton().getOptionsParam();
                        // Force the install files to be copied
                        Constant.getInstance().copyDefaultConfigs(new File(Constant.getInstance().FILE_CONFIG), true);
                        // Load them
                        params.load(Constant.getInstance().FILE_CONFIG);
                        // Force a reload in all of the option params
                        params.reloadConfigParamSets();
                        params.resetAll();
                        for (AbstractParamPanel panel : OptionsDialog.this.getPanels()) {
                            panel.reset();
                        }
                        // Reinit the dialog
                        OptionsDialog.this.initParam(params);
                    } catch (Exception e1) {
                        View.getSingleton().showWarningDialog(Constant.messages.getString("options.dialog.reset.error", e1.getMessage()));
                    }
                }
            }
        });
        extraButtons = new JButton[] { resetButton };
    }
    return extraButtons;
}
Also used : ActionListener(java.awt.event.ActionListener) OptionsParam(org.parosproxy.paros.model.OptionsParam) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) File(java.io.File) HeadlessException(java.awt.HeadlessException)

Example 55 with OptionsParam

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

the class OptionsGlobalExcludeURLPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam optionsParam = (OptionsParam) obj;
    GlobalExcludeURLParam param = optionsParam.getGlobalExcludeURLParam();
    getGlobalExcludeURLModel().setTokens(param.getTokens());
    tokensOptionsPanel.setRemoveWithoutConfirmation(!param.isConfirmRemoveToken());
}
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