|
Apple Java Extensions | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ApplicationListener
The listener interface for receiving ApplicationEvents. Classes needing to process Application Events
implement this interface. Multiple listeners are allowed for each event. When an event is fired off, an
ApplicationEvent is sent to each listener in turn until one of the them sets isHandled
to true
.
Before being able to receive ApplicationEvents, the listener must register with the Application object's
addListener
method. A default implementation of this interface is provided in the ApplicationAdapter class.
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. |
Method Detail |
---|
void handleAbout(ApplicationEvent event)
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.
event
- an ApplicationEvent initiated by the user choosing About in the application menuvoid handleOpenApplication(ApplicationEvent event)
event
- the Open Application eventvoid handleOpenFile(ApplicationEvent event)
event
- an Open Document event with reference to the file to be openedvoid handlePreferences(ApplicationEvent event)
setEnabledPreferencesMenu(true)
in the
Application object and then display your Preferences window in this handler.
event
- triggered when the user selects Preferences from the application menuvoid handlePrintFile(ApplicationEvent event)
event
- a Print Document event with a reference to the file(s) to be printedvoid handleQuit(ApplicationEvent event)
isHandled(true)
for the
event
. To reject the quit, set isHandled(false)
.
event
- a Quit Application eventvoid handleReOpenApplication(ApplicationEvent event)
event
- the Reopen Application event
|
Apple Java Extensions | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |