|
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.ApplicationAdapter
public class ApplicationAdapter
An abstract adapter class for receiving ApplicationEvents
.
The methods in this class are empty. This class exists as a convenience for creating listener objects.
ApplicationEvents
allow Java applications to handle basic Mac OS X Apple events.
Extend this class to create an ApplicationEvent
listener and override the methods for the events of interest. For example:
... public class QuitAdapter extends ApplicationAdapter { public void handleQuit(ApplicationEvent e) { //Check to see if user has unsaved changes, if not sete.setHandled(true)
//If user has unsaved changes sete.setHandled(false)
and move into code //that handles saving files. } } ...
Constructor Summary | |
---|---|
ApplicationAdapter()
|
Method Summary | |
---|---|
void |
handleAbout(ApplicationEvent event)
Called when the user selects the About item in the application menu. |
void |
handleOpenApplication(ApplicationEvent event)
Called when the application receives an Open Application event from the Finder or another application. |
void |
handleOpenFile(ApplicationEvent event)
Called when the application receives an Open Document event from the Finder or another application. |
void |
handlePreferences(ApplicationEvent event)
Called when the Preference item in the application menu is selected. |
void |
handlePrintFile(ApplicationEvent event)
Called when the application is sent a request to print a particular file or files. |
void |
handleQuit(ApplicationEvent event)
Called when the application is sent the Quit event. |
void |
handleReOpenApplication(ApplicationEvent event)
Called when the application receives a Reopen Application event from the Finder or another application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationAdapter()
Method Detail |
---|
public void handleAbout(ApplicationEvent event)
ApplicationListener
event
is not handled, by
setting isHandled(true)
, a default About window consisting of the application's name and icon is
displayed. To display a custom About window, designate the event
as being handled and display the
appropriate About window.
handleAbout
in interface ApplicationListener
event
- an ApplicationEvent initiated by the user choosing About in the application menupublic void handleOpenApplication(ApplicationEvent event)
ApplicationListener
handleOpenApplication
in interface ApplicationListener
event
- the Open Application eventpublic void handleOpenFile(ApplicationEvent event)
ApplicationListener
handleOpenFile
in interface ApplicationListener
event
- an Open Document event with reference to the file to be openedpublic void handlePreferences(ApplicationEvent event)
ApplicationListener
setEnabledPreferencesMenu(true)
in the
Application object and then display your Preferences window in this handler.
handlePreferences
in interface ApplicationListener
event
- triggered when the user selects Preferences from the application menupublic void handlePrintFile(ApplicationEvent event)
ApplicationListener
handlePrintFile
in interface ApplicationListener
event
- a Print Document event with a reference to the file(s) to be printedpublic void handleQuit(ApplicationEvent event)
ApplicationListener
isHandled(true)
for the
event
. To reject the quit, set isHandled(false)
.
handleQuit
in interface ApplicationListener
event
- a Quit Application eventpublic void handleReOpenApplication(ApplicationEvent event)
ApplicationListener
handleReOpenApplication
in interface ApplicationListener
event
- the Reopen Application event
|
Apple Java Extensions | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |