use of org.zaproxy.zap.view.osxhandlers.OSXAboutHandler in project zaproxy by zaproxy.
the class OsXGui method setup.
/**
* Setups the GUI of ZAP for OSX.
* <p>
* Sets OS X related GUI properties and functionalities.
*/
public static void setup() {
// Set the various and sundry OS X-specific system properties
System.setProperty("apple.laf.useScreenMenuBar", "true");
// Broken and unfixed; thanks, Apple
System.setProperty("dock:name", "ZAP");
// more thx
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "ZAP");
// Override various handlers, so that About, Preferences, and Quit behave in an OS X typical fashion.
LOGGER.info("Initializing OS X specific settings, despite Apple's best efforts");
// Attempt to load the apple classes
Application app = Application.getApplication();
// Set the dock image icon
Image img = Toolkit.getDefaultToolkit().getImage(GuiBootstrap.class.getResource("/resource/zap1024x1024.png"));
app.setDockIconImage(img);
// Set handlers for About and Preferences
app.setAboutHandler(new OSXAboutHandler());
app.setPreferencesHandler(new OSXPreferencesHandler());
// Let's not forget to clean up our database mess when we Quit
OSXQuitHandler quitHandler = new OSXQuitHandler();
// quitHandler.removeZAPViewItem(view); // TODO
app.setQuitHandler(quitHandler);
}
Aggregations