Search in sources :

Example 6 with OptionsParam

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

the class OptionsCheckForUpdatesPanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam options = (OptionsParam) obj;
    getChkCheckOnStart().setSelected(options.getCheckForUpdatesParam().isCheckOnStart());
    getChkDownloadNewRelease().setSelected(options.getCheckForUpdatesParam().isDownloadNewRelease());
    getChkCheckAddonUpdates().setSelected(options.getCheckForUpdatesParam().isCheckAddonUpdates());
    getChkInstallAddonUpdates().setSelected(options.getCheckForUpdatesParam().isInstallAddonUpdates());
    getChkInstallScannerRules().setSelected(options.getCheckForUpdatesParam().isInstallScannerRules());
    getChkReportReleaseAddons().setSelected(options.getCheckForUpdatesParam().isReportReleaseAddons());
    getChkReportBetaAddons().setSelected(options.getCheckForUpdatesParam().isReportBetaAddons());
    getChkReportAlphaAddons().setSelected(options.getCheckForUpdatesParam().isReportAlphaAddons());
    getScriptDirModel().setFiles(options.getCheckForUpdatesParam().getAddonDirectories());
    getDownloadDirCombo().setSelectedItem(options.getCheckForUpdatesParam().getDownloadDirectory().getAbsolutePath());
    setCheckBoxStates();
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 7 with OptionsParam

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

the class OptionsCheckForUpdatesPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam options = (OptionsParam) obj;
    options.getCheckForUpdatesParam().setCheckOnStart(getChkCheckOnStart().isSelected());
    options.getCheckForUpdatesParam().setDownloadNewRelease(getChkDownloadNewRelease().isSelected());
    options.getCheckForUpdatesParam().setCheckAddonUpdates(getChkCheckAddonUpdates().isSelected());
    options.getCheckForUpdatesParam().setInstallAddonUpdates(getChkInstallAddonUpdates().isSelected());
    options.getCheckForUpdatesParam().setInstallScannerRules(getChkInstallScannerRules().isSelected());
    options.getCheckForUpdatesParam().setReportReleaseAddons(getChkReportReleaseAddons().isSelected());
    options.getCheckForUpdatesParam().setReportBetaAddons(getChkReportBetaAddons().isSelected());
    options.getCheckForUpdatesParam().setReportAlphaAddons(getChkReportAlphaAddons().isSelected());
    options.getCheckForUpdatesParam().setAddonDirectories(getScriptDirModel().getElements());
    options.getCheckForUpdatesParam().setDownloadDirectory(new File(getDownloadDirCombo().getSelectedItem().toString()));
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) File(java.io.File)

Example 8 with OptionsParam

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

the class BreakpointsOptionsPanel method initParam.

@Override
public void initParam(Object obj) {
    final OptionsParam options = (OptionsParam) obj;
    final BreakpointsParam param = options.getParamSet(BreakpointsParam.class);
    getCheckBoxConfirmDropMessage().setSelected(param.isConfirmDropMessage());
    // Note param.alwaysOnTop will be null if the user hasnt specified a preference yet
    getCheckBoxAlwaysOnTop().setSelected(param.getAlwaysOnTop() != Boolean.FALSE);
    getCheckBoxInScopeOnly().setSelected(param.isInScopeOnly());
    getButtonMode().setSelectedIndex(param.getButtonMode() - 1);
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 9 with OptionsParam

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

the class BreakpointsOptionsPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    final OptionsParam options = (OptionsParam) obj;
    final BreakpointsParam param = options.getParamSet(BreakpointsParam.class);
    param.setConfirmDropMessage(getCheckBoxConfirmDropMessage().isSelected());
    if (param.getAlwaysOnTop() != null || !getCheckBoxAlwaysOnTop().isSelected()) {
        // Dont set the option if its not already set, unless the user has changed it
        // This is so that the warning message will still be shown the first time a breakpoint is hit
        param.setAlwaysOnTop(getCheckBoxAlwaysOnTop().isSelected());
    }
    param.setInScopeOnly(getCheckBoxInScopeOnly().isSelected());
    param.setButtonMode(this.getButtonMode().getSelectedIndex() + 1);
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 10 with OptionsParam

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

the class GuiBootstrap method init.

/**
     * Initialises the {@code Model}, {@code View} and {@code Control}.
     *
     * @param firstTime {@code true} if it's the first time ZAP is being started, {@code false} otherwise
     */
private void init(final boolean firstTime) {
    try {
        initModel();
        setupLookAndFeel();
    } catch (Exception e) {
        setupLookAndFeel();
        if (e instanceof FileNotFoundException) {
            JOptionPane.showMessageDialog(null, Constant.messages.getString("start.db.error"), Constant.messages.getString("start.title.error"), JOptionPane.ERROR_MESSAGE);
        }
        logger.fatal(e.getMessage(), e);
    }
    OptionsParam options = Model.getSingleton().getOptionsParam();
    OptionsParamView viewParam = options.getViewParam();
    FontUtils.setDefaultFont(viewParam.getFontName(), viewParam.getFontSize());
    setupLocale(options);
    View.getSingleton().showSplashScreen();
    promptForProxyDetailsIfNeeded(options);
    Thread bootstrap = new Thread(new Runnable() {

        @Override
        public void run() {
            try {
                initControlAndPostViewInit();
            } catch (Throwable e) {
                if (!Constant.isDevBuild()) {
                    ErrorInfo errorInfo = new ErrorInfo(Constant.messages.getString("start.gui.dialog.fatal.error.title"), Constant.messages.getString("start.gui.dialog.fatal.error.message"), null, null, e, null, null);
                    JXErrorPane errorPane = new JXErrorPane();
                    errorPane.setErrorInfo(errorInfo);
                    JXErrorPane.showDialog(View.getSingleton().getSplashScreen(), errorPane);
                }
                View.getSingleton().hideSplashScreen();
                logger.fatal("Failed to initialise GUI: ", e);
                // We must exit otherwise EDT would keep ZAP running.
                System.exit(1);
            }
            warnAddOnsAndExtensionsNoLongerRunnable();
            if (firstTime) {
            // Disabled for now - we have too many popups occuring when you
            // first start up
            // be nice to have a clean start up wizard...
            // ExtensionHelp.showHelp();
            } else {
                // Dont auto check for updates the first time, no chance of any
                // proxy having been set
                final ExtensionAutoUpdate eau = (ExtensionAutoUpdate) Control.getSingleton().getExtensionLoader().getExtension("ExtensionAutoUpdate");
                if (eau != null) {
                    eau.alertIfNewVersions();
                }
            }
        }
    });
    bootstrap.setName("ZAP-BootstrapGUI");
    bootstrap.setDaemon(false);
    bootstrap.start();
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) ExtensionAutoUpdate(org.zaproxy.zap.extension.autoupdate.ExtensionAutoUpdate) OptionsParamView(org.parosproxy.paros.extension.option.OptionsParamView) ErrorInfo(org.jdesktop.swingx.error.ErrorInfo) FileNotFoundException(java.io.FileNotFoundException) JXErrorPane(org.jdesktop.swingx.JXErrorPane) UnsupportedLookAndFeelException(javax.swing.UnsupportedLookAndFeelException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) ConfigurationException(org.apache.commons.configuration.ConfigurationException)

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