< prev index next >

src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java

Print this page




  36  * @see PreferencesHandler
  37  * @see OpenURIHandler
  38  * @see OpenFilesHandler
  39  * @see PrintFilesHandler
  40  * @see QuitHandler
  41  *
  42  * @see AppReOpenedListener
  43  * @see AppForegroundListener
  44  * @see AppHiddenListener
  45  * @see UserSessionListener
  46  * @see ScreenSleepListener
  47  * @see SystemSleepListener
  48  *
  49  * @since 1.4
  50  * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}
  51  */
  52 @SuppressWarnings("deprecation")
  53 @Deprecated
  54 public interface ApplicationListener extends EventListener {
  55     /**
  56      * Called when the user selects the About item in the application menu. If <code>event</code> is not handled by
  57      * setting <code>isHandled(true)</code>, a default About window consisting of the application's name and icon is
  58      * displayed. To display a custom About window, designate the <code>event</code> as being handled and display the
  59      * appropriate About window.
  60      *
  61      * @param event an ApplicationEvent initiated by the user choosing About in the application menu
  62      * @deprecated use {@link AboutHandler}
  63      */
  64     @Deprecated
  65     public void handleAbout(ApplicationEvent event);
  66 
  67     /**
  68      * Called when the application receives an Open Application event from the Finder or another application. Usually
  69      * this will come from the Finder when a user double-clicks your application icon. If there is any special code
  70      * that you want to run when you user launches your application from the Finder or by sending an Open Application
  71      * event from another application, include that code as part of this handler. The Open Application event is sent
  72      * after AWT has been loaded.
  73      *
  74      * @param event the Open Application event
  75      * @deprecated no replacement
  76      */
  77     @Deprecated
  78     public void handleOpenApplication(ApplicationEvent event);


  82      * is generated when a user double-clicks a document in the Finder. If the document is registered as belonging
  83      * to your application, this event is sent to your application. Documents are bound to a particular application based
  84      * primarily on their suffix. In the Finder, a user selects a document and then from the File Menu chooses Get Info.
  85      * The Info window allows users to bind a document to a particular application.
  86      *
  87      * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
  88      * or CFBundleDocumentTypes.
  89      *
  90      * The ApplicationEvent sent to this handler holds a reference to the file being opened.
  91      *
  92      * @param event an Open Document event with reference to the file to be opened
  93      * @deprecated use {@link OpenFilesHandler}
  94      */
  95     @Deprecated
  96     public void handleOpenFile(ApplicationEvent event);
  97 
  98     /**
  99      * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their
 100      * Preferences window available through the application menu. Java applications are automatically given an application
 101      * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application
 102      * on Mac OS X, you should enable the preferences item with <code>setEnabledPreferencesMenu(true)</code> in the
 103      * Application object and then display your Preferences window in this handler.
 104      *
 105      * @param event triggered when the user selects Preferences from the application menu
 106      * @deprecated use {@link PreferencesHandler}
 107      */
 108     @Deprecated
 109     public void handlePreferences(ApplicationEvent event);
 110 
 111     /**
 112      * Called when the application is sent a request to print a particular file or files. You can allow other applications to
 113      * print files with your application by implementing this handler. If another application sends a Print Event along
 114      * with the name of a file that your application knows how to process, you can use this handler to determine what to
 115      * do with that request. You might open your entire application, or just invoke your printing classes.
 116      *
 117      * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
 118      * or CFBundleDocumentTypes.
 119      *
 120      * The ApplicationEvent sent to this handler holds a reference to the file being opened.
 121      *
 122      * @param event a Print Document event with a reference to the file(s) to be printed
 123      * @deprecated use {@link PrintFilesHandler}
 124      */
 125     @Deprecated
 126     public void handlePrintFile(ApplicationEvent event);
 127 
 128     /**
 129      * Called when the application is sent the Quit event. This event is generated when the user selects Quit from the
 130      * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the
 131      * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request
 132      * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your
 133      * application. To accept the request to quit, and terminate the application, set <code>isHandled(true)</code> for the
 134      * <code>event</code>. To reject the quit, set <code>isHandled(false)</code>.
 135      *
 136      * @param event a Quit Application event
 137      * @deprecated use {@link QuitHandler} and {@link QuitResponse}
 138      */
 139     @Deprecated
 140     public void handleQuit(ApplicationEvent event);
 141 
 142     /**
 143      * Called when the application receives a Reopen Application event from the Finder or another application. Usually
 144      * this will come when a user clicks on your application icon in the Dock. If there is any special code
 145      * that needs to run when your user clicks on your application icon in the Dock or when a Reopen Application
 146      * event is sent from another application, include that code as part of this handler.
 147      *
 148      * @param event the Reopen Application event
 149      * @deprecated use {@link AppReOpenedListener}
 150      */
 151     @Deprecated
 152     public void handleReOpenApplication(ApplicationEvent event);
 153 }


  36  * @see PreferencesHandler
  37  * @see OpenURIHandler
  38  * @see OpenFilesHandler
  39  * @see PrintFilesHandler
  40  * @see QuitHandler
  41  *
  42  * @see AppReOpenedListener
  43  * @see AppForegroundListener
  44  * @see AppHiddenListener
  45  * @see UserSessionListener
  46  * @see ScreenSleepListener
  47  * @see SystemSleepListener
  48  *
  49  * @since 1.4
  50  * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}
  51  */
  52 @SuppressWarnings("deprecation")
  53 @Deprecated
  54 public interface ApplicationListener extends EventListener {
  55     /**
  56      * Called when the user selects the About item in the application menu. If {@code event} is not handled by
  57      * setting {@code isHandled(true)}, a default About window consisting of the application's name and icon is
  58      * displayed. To display a custom About window, designate the {@code event} as being handled and display the
  59      * appropriate About window.
  60      *
  61      * @param event an ApplicationEvent initiated by the user choosing About in the application menu
  62      * @deprecated use {@link AboutHandler}
  63      */
  64     @Deprecated
  65     public void handleAbout(ApplicationEvent event);
  66 
  67     /**
  68      * Called when the application receives an Open Application event from the Finder or another application. Usually
  69      * this will come from the Finder when a user double-clicks your application icon. If there is any special code
  70      * that you want to run when you user launches your application from the Finder or by sending an Open Application
  71      * event from another application, include that code as part of this handler. The Open Application event is sent
  72      * after AWT has been loaded.
  73      *
  74      * @param event the Open Application event
  75      * @deprecated no replacement
  76      */
  77     @Deprecated
  78     public void handleOpenApplication(ApplicationEvent event);


  82      * is generated when a user double-clicks a document in the Finder. If the document is registered as belonging
  83      * to your application, this event is sent to your application. Documents are bound to a particular application based
  84      * primarily on their suffix. In the Finder, a user selects a document and then from the File Menu chooses Get Info.
  85      * The Info window allows users to bind a document to a particular application.
  86      *
  87      * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
  88      * or CFBundleDocumentTypes.
  89      *
  90      * The ApplicationEvent sent to this handler holds a reference to the file being opened.
  91      *
  92      * @param event an Open Document event with reference to the file to be opened
  93      * @deprecated use {@link OpenFilesHandler}
  94      */
  95     @Deprecated
  96     public void handleOpenFile(ApplicationEvent event);
  97 
  98     /**
  99      * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their
 100      * Preferences window available through the application menu. Java applications are automatically given an application
 101      * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application
 102      * on Mac OS X, you should enable the preferences item with {@code setEnabledPreferencesMenu(true)} in the
 103      * Application object and then display your Preferences window in this handler.
 104      *
 105      * @param event triggered when the user selects Preferences from the application menu
 106      * @deprecated use {@link PreferencesHandler}
 107      */
 108     @Deprecated
 109     public void handlePreferences(ApplicationEvent event);
 110 
 111     /**
 112      * Called when the application is sent a request to print a particular file or files. You can allow other applications to
 113      * print files with your application by implementing this handler. If another application sends a Print Event along
 114      * with the name of a file that your application knows how to process, you can use this handler to determine what to
 115      * do with that request. You might open your entire application, or just invoke your printing classes.
 116      *
 117      * These events are sent only if the bound application has file types listed in the Info.plist entries Document Types
 118      * or CFBundleDocumentTypes.
 119      *
 120      * The ApplicationEvent sent to this handler holds a reference to the file being opened.
 121      *
 122      * @param event a Print Document event with a reference to the file(s) to be printed
 123      * @deprecated use {@link PrintFilesHandler}
 124      */
 125     @Deprecated
 126     public void handlePrintFile(ApplicationEvent event);
 127 
 128     /**
 129      * Called when the application is sent the Quit event. This event is generated when the user selects Quit from the
 130      * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the
 131      * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request
 132      * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your
 133      * application. To accept the request to quit, and terminate the application, set {@code isHandled(true)} for the
 134      * {@code event}. To reject the quit, set {@code isHandled(false)}.
 135      *
 136      * @param event a Quit Application event
 137      * @deprecated use {@link QuitHandler} and {@link QuitResponse}
 138      */
 139     @Deprecated
 140     public void handleQuit(ApplicationEvent event);
 141 
 142     /**
 143      * Called when the application receives a Reopen Application event from the Finder or another application. Usually
 144      * this will come when a user clicks on your application icon in the Dock. If there is any special code
 145      * that needs to run when your user clicks on your application icon in the Dock or when a Reopen Application
 146      * event is sent from another application, include that code as part of this handler.
 147      *
 148      * @param event the Reopen Application event
 149      * @deprecated use {@link AppReOpenedListener}
 150      */
 151     @Deprecated
 152     public void handleReOpenApplication(ApplicationEvent event);
 153 }
< prev index next >