|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.uif.osx.OSXApplicationMenu
public final class OSXApplicationMenu
Hooks existing about, preferences and quit action listeners into the Mac OS X application menu. Provides information which functions have been hooked into the application menu, so an application can request this if it conditionally builds menus. Reduces the effort to support these Mac OS X features in multi-platform applications.
The implementation first checks for a Mac OS X Java runtime
and does nothing if it runs on a different platform.
Next, it tries to load a subclass of the ApplicationAdapter
from the Mac Java extensions in package com.apple.eawt
.
OSXApplicationHandler
Method Summary | |
---|---|
static boolean |
isRegisteredAbout()
Checks and answers whether an about listener has been registered with the Mac OS X application menu. |
static boolean |
isRegisteredPreferences()
Checks and answers whether a preferences listener has been registered with the Mac OS X application menu. |
static boolean |
isRegisteredQuit()
Checks and answers whether a quit listener has been registered with the Mac OS X application menu. |
static boolean |
register(ActionListener about,
ActionListener preferences,
ActionListener quit)
Registers the given action listeners for about, preferences and quit with the Mac OS X application menu - if we're on OS X. |
static void |
setAboutName(String aboutName)
Sets the name that is used in the Mac OS X application menu as title and suffix for the about and quit actions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setAboutName(String aboutName)
Must be called before a windows is opened. And so, a good place
is the application's main method or the application startup.
AbstractUIFApplication
#load
calls this method.
aboutName
- the name to be usedpublic static boolean register(ActionListener about, ActionListener preferences, ActionListener quit)
about
- a listener that performs the about actionpreferences
- a listener that performs the preferences actionquit
- a listener that performs the quit action
public static boolean isRegisteredAbout()
public static boolean isRegisteredPreferences()
public static boolean isRegisteredQuit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |