use of org.parosproxy.paros.extension.option.OptionsParamView 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();
}
use of org.parosproxy.paros.extension.option.OptionsParamView in project zaproxy by zaproxy.
the class OptionsLangPanel method saveParam.
@Override
public void saveParam(Object obj) throws Exception {
OptionsParam options = (OptionsParam) obj;
OptionsParamView viewParam = options.getViewParam();
ViewLocale selectedLocale = (ViewLocale) localeSelect.getSelectedItem();
if (selectedLocale != null) {
viewParam.setLocale(selectedLocale.getLocale());
}
viewParam.setUseSystemsLocaleForFormat(getUseSystemsLocaleFormatCheckbox().isSelected());
}
use of org.parosproxy.paros.extension.option.OptionsParamView in project zaproxy by zaproxy.
the class OptionsLangPanel method initParam.
@Override
public void initParam(Object obj) {
OptionsParam options = (OptionsParam) obj;
OptionsParamView viewParam = options.getViewParam();
ViewLocale locale = LocaleUtils.getViewLocale(viewParam.getLocale());
localeSelect.setSelectedItem(locale);
useSystemsLocaleFormatCheckbox.setSelected(viewParam.isUseSystemsLocaleForFormat());
}
use of org.parosproxy.paros.extension.option.OptionsParamView in project zaproxy by zaproxy.
the class GuiBootstrap method init.
/**
* Initialises the {@code Model}, {@code View} and {@code Control}.
*/
private void init() {
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("Failed to initialise: " + e.getMessage(), e);
System.err.println(e.getMessage());
System.exit(1);
}
OptionsParam options = Model.getSingleton().getOptionsParam();
OptionsParamView viewParam = options.getViewParam();
for (FontUtils.FontType fontType : FontUtils.FontType.values()) {
FontUtils.setDefaultFont(fontType, viewParam.getFontName(fontType), viewParam.getFontSize(fontType));
}
setupLocale(options);
if (viewParam.isUseSystemsLocaleForFormat()) {
Locale.setDefault(Locale.Category.FORMAT, Constant.getSystemsLocale());
}
View.getSingleton().showSplashScreen();
promptForProxyDetailsIfNeeded(options);
Thread bootstrap = new Thread(new Runnable() {
@Override
public void run() {
try {
initControlAndPostViewInit();
} catch (IllegalStateException e) {
JOptionPane.showMessageDialog(View.getSingleton().getSplashScreen(), Constant.messages.getString("start.gui.dialog.fatal.error.init"), Constant.PROGRAM_NAME, JOptionPane.ERROR_MESSAGE);
System.exit(1);
} catch (Throwable e) {
if (!Constant.isDevMode()) {
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();
HeadlessBootstrap.checkForUpdates();
}
});
bootstrap.setName("ZAP-BootstrapGUI");
bootstrap.setDaemon(false);
bootstrap.start();
}
Aggregations