|
Apple Java Extensions | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apple.eawt.Application
public class Application
The Application class allows you to integrate your Java code with the native Mac OS X application environment. In conjunction with the ApplicationEvent and ApplicationHandler classes, you can simply wrap certain native application behaviors and functionality. As a JavaBeans implementation, it provides a mechanism to simply manipulate these features in modern integrated development environments. By implementing the features exposed in this class, and its associated classes, you can provide users with a greatly enhanced user experience on Mac OS X. For example, by implementing the event handlers exposed in this class you are also providing basic AppleScript compatibility that your Java application can be incorporated into Mac OS X workflow solutions that require interapplication communication.
Obtain a new Application object if you want to do any of the following tasks
Constructor Summary | |
---|---|
Application()
Creates an Application. |
Method Summary | |
---|---|
void |
addAboutMenuItem()
Adds the About item to the application menu if the item is not already present. |
void |
addApplicationListener(ApplicationListener listener)
Adds the specified ApplicationListener as a receiver of callbacks from this class. |
void |
addPreferencesMenuItem()
Adds the Preferences item to the application menu if the item is not already present. |
static Application |
getApplication()
|
boolean |
getEnabledAboutMenu()
Determines whether the About item of the application menu is enabled. |
boolean |
getEnabledPreferencesMenu()
Determines whether the Preferences item of the application menu is enabled. |
static java.awt.Point |
getMouseLocationOnScreen()
Deprecated. replaced by java.awt.MouseInfo.getPointerInfo().getLocation() . |
boolean |
isAboutMenuItemPresent()
Determines whether the About item of the application menu is present. |
boolean |
isPreferencesMenuItemPresent()
Determines whether the About Preferences of the application menu is present. |
void |
removeAboutMenuItem()
Removes the About item from the application menu if the item is present. |
void |
removeApplicationListener(ApplicationListener listener)
Removes the specified ApplicationListener from being a receiver of callbacks from this class. |
void |
removePreferencesMenuItem()
Removes the Preferences item from the application menu if that item is present. |
void |
setEnabledAboutMenu(boolean enable)
Enables the About item in the application menu. |
void |
setEnabledPreferencesMenu(boolean enable)
Enables the Preferences item in the application menu. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Application()
Method Detail |
---|
public static Application getApplication()
public void addApplicationListener(ApplicationListener listener)
listener
- an implementation of ApplicationListener that handles ApplicationEvents generated by this
classpublic void removeApplicationListener(ApplicationListener listener)
listener
- an implementation of ApplicationListener that had previously been registered to handle
ApplicationEvents generated by this classpublic void setEnabledPreferencesMenu(boolean enable)
true
. Because an application may not
have a preferences window, by default this is set to false
, meaning that the Preferences item in the application
menu is grayed out and unselectable.
If a Preferences item isn't present, this method adds and enables it.
enable
- specifies whether the Preferences item in the application menu should be enabled (true
) or not (false
)public void setEnabledAboutMenu(boolean enable)
true
. Because AWT supplies
a standard About window when an application may not, by default this is set to true
.
If the About item isn't present, this method adds and enables it.
enable
- specifies whether the About item in the application menu should be enabled (true
) or not (false
)public boolean getEnabledPreferencesMenu()
public boolean getEnabledAboutMenu()
public boolean isAboutMenuItemPresent()
public void addAboutMenuItem()
public void removeAboutMenuItem()
public boolean isPreferencesMenuItemPresent()
public void addPreferencesMenuItem()
public void removePreferencesMenuItem()
@Deprecated public static java.awt.Point getMouseLocationOnScreen()
java.awt.MouseInfo.getPointerInfo().getLocation()
.
|
Apple Java Extensions | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |