8214823: Javadoc cleanup of java.awt.desktop package
Reviewed-by: prr
This commit is contained in:
parent
86cf7f8768
commit
5a612dd0df
src/java.desktop/share/classes/java/awt/desktop
AboutEvent.javaAboutHandler.javaAppEvent.javaAppForegroundEvent.javaAppForegroundListener.javaAppHiddenEvent.javaAppHiddenListener.javaAppReopenedEvent.javaAppReopenedListener.javaFilesEvent.javaOpenFilesEvent.javaOpenFilesHandler.javaOpenURIEvent.javaOpenURIHandler.javaPreferencesEvent.javaPreferencesHandler.javaPrintFilesEvent.javaPrintFilesHandler.javaQuitEvent.javaQuitHandler.javaQuitResponse.javaQuitStrategy.javaScreenSleepEvent.javaScreenSleepListener.javaSystemEventListener.javaSystemSleepEvent.javaSystemSleepListener.javaUserSessionEvent.javaUserSessionListener.java
@ -33,11 +33,13 @@ import java.awt.HeadlessException;
|
||||
* Event sent when the application is asked to open its about window.
|
||||
*
|
||||
* @see AboutHandler#handleAbout
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class AboutEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -5987180734802756477L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,8 +29,7 @@ package java.awt.desktop;
|
||||
* An implementer receives notification when the app is asked to show its about
|
||||
* dialog.
|
||||
*
|
||||
* @see java.awt.Desktop#setAboutHandler(java.awt.desktop.AboutHandler)
|
||||
*
|
||||
* @see java.awt.Desktop#setAboutHandler(AboutHandler)
|
||||
* @since 9
|
||||
*/
|
||||
public interface AboutHandler {
|
||||
@ -38,7 +37,7 @@ public interface AboutHandler {
|
||||
/**
|
||||
* Called when the application is asked to show its about dialog.
|
||||
*
|
||||
* @param e the request to show the about dialog.
|
||||
* @param e the request to show the about dialog
|
||||
*/
|
||||
public void handleAbout(final AboutEvent e);
|
||||
public void handleAbout(AboutEvent e);
|
||||
}
|
||||
|
@ -38,6 +38,9 @@ import java.util.EventObject;
|
||||
*/
|
||||
public class AppEvent extends EventObject {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -5958503993556009432L;
|
||||
|
||||
/**
|
||||
|
@ -35,11 +35,13 @@ import java.awt.HeadlessException;
|
||||
*
|
||||
* @see AppForegroundListener#appRaisedToForeground(AppForegroundEvent)
|
||||
* @see AppForegroundListener#appMovedToBackground(AppForegroundEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class AppForegroundEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -5513582555740533911L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,17 +34,19 @@ package java.awt.desktop;
|
||||
* @since 9
|
||||
*/
|
||||
public interface AppForegroundListener extends SystemEventListener {
|
||||
|
||||
/**
|
||||
* Called when the app becomes the foreground app.
|
||||
* @param e event
|
||||
*
|
||||
* @param e event
|
||||
*/
|
||||
public void appRaisedToForeground(final AppForegroundEvent e);
|
||||
public void appRaisedToForeground(AppForegroundEvent e);
|
||||
|
||||
/**
|
||||
* Called when the app becomes the background app and another app becomes
|
||||
* the foreground app.
|
||||
*
|
||||
* @param e event
|
||||
* @param e event
|
||||
*/
|
||||
public void appMovedToBackground(final AppForegroundEvent e);
|
||||
public void appMovedToBackground(AppForegroundEvent e);
|
||||
}
|
||||
|
@ -34,11 +34,13 @@ import java.awt.HeadlessException;
|
||||
*
|
||||
* @see AppHiddenListener#appHidden(AppHiddenEvent)
|
||||
* @see AppHiddenListener#appUnhidden(AppHiddenEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class AppHiddenEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 2637465279476429224L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,17 +35,17 @@ package java.awt.desktop;
|
||||
public interface AppHiddenListener extends SystemEventListener {
|
||||
|
||||
/**
|
||||
* Called the app is hidden.
|
||||
* Called when the app is hidden.
|
||||
*
|
||||
* @param e event
|
||||
* @param e event
|
||||
*/
|
||||
public void appHidden(final AppHiddenEvent e);
|
||||
public void appHidden(AppHiddenEvent e);
|
||||
|
||||
/**
|
||||
* Called when the hidden app is shown again (but not necessarily brought to
|
||||
* the foreground).
|
||||
*
|
||||
* @param e event
|
||||
* @param e event
|
||||
*/
|
||||
public void appUnhidden(final AppHiddenEvent e);
|
||||
public void appUnhidden(AppHiddenEvent e);
|
||||
}
|
||||
|
@ -33,11 +33,13 @@ import java.awt.HeadlessException;
|
||||
* Event sent when the application is asked to re-open itself.
|
||||
*
|
||||
* @see AppReopenedListener#appReopened(AppReopenedEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class AppReopenedEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 1503238361530407990L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,15 +27,18 @@ package java.awt.desktop;
|
||||
|
||||
/**
|
||||
* Implementors receive notification when the app has been asked to open again.
|
||||
*
|
||||
* This notification is useful for showing a new document when your app has no open windows.
|
||||
* <p>
|
||||
* This notification is useful for showing a new document when your app has no
|
||||
* open windows.
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public interface AppReopenedListener extends SystemEventListener {
|
||||
|
||||
/**
|
||||
* Called when the app has been reopened
|
||||
* @param e the request to reopen the app
|
||||
* Called when the app has been reopened.
|
||||
*
|
||||
* @param e the request to reopen the app
|
||||
*/
|
||||
public void appReopened(final AppReopenedEvent e);
|
||||
public void appReopened(AppReopenedEvent e);
|
||||
}
|
||||
|
@ -39,7 +39,14 @@ import java.util.List;
|
||||
*/
|
||||
public class FilesEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 5271763715462312871L;
|
||||
|
||||
/**
|
||||
* The list of files.
|
||||
*/
|
||||
final List<File> files;
|
||||
|
||||
/**
|
||||
|
@ -35,12 +35,18 @@ import java.util.List;
|
||||
* Event sent when the app is asked to open a list of files.
|
||||
*
|
||||
* @see OpenFilesHandler#openFiles
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class OpenFilesEvent extends FilesEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -3982871005867718956L;
|
||||
|
||||
/**
|
||||
* The search term used to find the files.
|
||||
*/
|
||||
final String searchTerm;
|
||||
|
||||
/**
|
||||
@ -63,10 +69,10 @@ public final class OpenFilesEvent extends FilesEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the search term. The platform may optionally provide the search
|
||||
* term that was used to find the files. This is for example the case
|
||||
* on Mac OS X, when the files were opened using the Spotlight search
|
||||
* menu or a Finder search window.
|
||||
* Gets the search term. The platform may optionally provide the search term
|
||||
* that was used to find the files. This is for example the case on MacOS,
|
||||
* when the files were opened using the Spotlight search menu or a Finder
|
||||
* search window.
|
||||
* <p>
|
||||
* This is useful for highlighting the search term in the documents when
|
||||
* they are opened.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,18 +25,20 @@
|
||||
|
||||
package java.awt.desktop;
|
||||
|
||||
|
||||
/**
|
||||
* An implementor is notified when the application is asked to open a list of files.
|
||||
*
|
||||
* @see java.awt.Desktop#setOpenFileHandler(java.awt.desktop.OpenFilesHandler)
|
||||
* An implementor is notified when the application is asked to open a list of
|
||||
* files.
|
||||
*
|
||||
* @see java.awt.Desktop#setOpenFileHandler(OpenFilesHandler)
|
||||
* @since 9
|
||||
*/
|
||||
public interface OpenFilesHandler {
|
||||
|
||||
/**
|
||||
* Called when the application is asked to open a list of files.
|
||||
* @param e the request to open a list of files, and the search term used to find them, if any.
|
||||
*
|
||||
* @param e the request to open a list of files, and the search term used
|
||||
* to find them, if any
|
||||
*/
|
||||
public void openFiles(final OpenFilesEvent e);
|
||||
public void openFiles(OpenFilesEvent e);
|
||||
}
|
||||
|
@ -34,12 +34,18 @@ import java.net.URI;
|
||||
* Event sent when the app is asked to open a {@code URI}.
|
||||
*
|
||||
* @see OpenURIHandler#openURI(OpenURIEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class OpenURIEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 221209100935933476L;
|
||||
|
||||
/**
|
||||
* The {@code URI} the app was asked to open.
|
||||
*/
|
||||
final URI uri;
|
||||
|
||||
/**
|
||||
@ -58,7 +64,8 @@ public final class OpenURIEvent extends AppEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@code URI} the app was asked to open
|
||||
* Get the {@code URI} the app was asked to open.
|
||||
*
|
||||
* @return the {@code URI}
|
||||
*/
|
||||
public URI getURI() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,14 +28,15 @@ package java.awt.desktop;
|
||||
/**
|
||||
* An implementor is notified when the application is asked to open a URI.
|
||||
*
|
||||
* @see java.awt.Desktop#setOpenURIHandler(java.awt.desktop.OpenURIHandler)
|
||||
*
|
||||
* @see java.awt.Desktop#setOpenURIHandler(OpenURIHandler)
|
||||
* @since 9
|
||||
*/
|
||||
public interface OpenURIHandler {
|
||||
|
||||
/**
|
||||
* Called when the application is asked to open a {@code URI}
|
||||
* @param e the request to open a {@code URI}
|
||||
* Called when the application is asked to open a {@code URI}.
|
||||
*
|
||||
* @param e the request to open a {@code URI}
|
||||
*/
|
||||
public void openURI(final OpenURIEvent e);
|
||||
public void openURI(OpenURIEvent e);
|
||||
}
|
||||
|
@ -33,11 +33,13 @@ import java.awt.HeadlessException;
|
||||
* Event sent when the application is asked to open its preferences window.
|
||||
*
|
||||
* @see PreferencesHandler#handlePreferences
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class PreferencesEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -6398607097086476160L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,14 +28,15 @@ package java.awt.desktop;
|
||||
/**
|
||||
* An implementor is notified when the app is asked to show its preferences UI.
|
||||
*
|
||||
* @see java.awt.Desktop#setPreferencesHandler(java.awt.desktop.PreferencesHandler)
|
||||
*
|
||||
* @see java.awt.Desktop#setPreferencesHandler(PreferencesHandler)
|
||||
* @since 9
|
||||
*/
|
||||
public interface PreferencesHandler {
|
||||
|
||||
/**
|
||||
* Called when the app is asked to show its preferences UI.
|
||||
* @param e the request to show preferences.
|
||||
*
|
||||
* @param e the request to show preferences
|
||||
*/
|
||||
public void handlePreferences(final PreferencesEvent e);
|
||||
public void handlePreferences(PreferencesEvent e);
|
||||
}
|
||||
|
@ -39,6 +39,9 @@ import java.util.List;
|
||||
*/
|
||||
public final class PrintFilesEvent extends FilesEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -5752560876153618618L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,16 +26,18 @@
|
||||
package java.awt.desktop;
|
||||
|
||||
/**
|
||||
* An implementor can respond to requests to print documents that the app has been registered to handle.
|
||||
*
|
||||
* @see java.awt.Desktop#setPrintFileHandler(java.awt.desktop.PrintFilesHandler)
|
||||
* An implementor can respond to requests to print documents that the app has
|
||||
* been registered to handle.
|
||||
*
|
||||
* @see java.awt.Desktop#setPrintFileHandler(PrintFilesHandler)
|
||||
* @since 9
|
||||
*/
|
||||
public interface PrintFilesHandler {
|
||||
|
||||
/**
|
||||
* Called when the application is asked to print a list of files.
|
||||
* @param e the request to print a list of files.
|
||||
*
|
||||
* @param e the request to print a list of files
|
||||
*/
|
||||
public void printFiles(final PrintFilesEvent e);
|
||||
public void printFiles(PrintFilesEvent e);
|
||||
}
|
||||
|
@ -33,11 +33,13 @@ import java.awt.HeadlessException;
|
||||
* Event sent when the application is asked to quit.
|
||||
*
|
||||
* @see QuitHandler#handleQuitRequestWith(QuitEvent, QuitResponse)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class QuitEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = -256100795532403146L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,26 +26,32 @@
|
||||
package java.awt.desktop;
|
||||
|
||||
/**
|
||||
* An implementor determines if requests to quit this application should proceed or cancel.
|
||||
*
|
||||
* @see java.awt.Desktop#setQuitHandler(java.awt.desktop.QuitHandler)
|
||||
* @see java.awt.Desktop#setQuitStrategy(java.awt.desktop.QuitStrategy)
|
||||
* An implementor determines if requests to quit this application should proceed
|
||||
* or cancel.
|
||||
*
|
||||
* @see java.awt.Desktop#setQuitHandler(QuitHandler)
|
||||
* @see java.awt.Desktop#setQuitStrategy(QuitStrategy)
|
||||
* @since 9
|
||||
*/
|
||||
public interface QuitHandler {
|
||||
|
||||
/**
|
||||
* Invoked when the application is asked to quit.
|
||||
* <p>
|
||||
* Implementors must call either {@link QuitResponse#cancelQuit()},
|
||||
* {@link QuitResponse#performQuit()}, or ensure the application terminates.
|
||||
* The process (or log-out) requesting this app to quit will be blocked
|
||||
* until the {@link QuitResponse} is handled. Apps that require complex UI
|
||||
* to shutdown may call the {@link QuitResponse} from any thread. Your app
|
||||
* may be asked to quit multiple times before you have responded to the
|
||||
* initial request. This handler is called each time a quit is requested,
|
||||
* and the same {@link QuitResponse} object is passed until it is handled.
|
||||
* Once used, the {@link QuitResponse} cannot be used again to change the
|
||||
* decision.
|
||||
*
|
||||
* Implementors must call either {@link QuitResponse#cancelQuit()}, {@link QuitResponse#performQuit()}, or ensure the application terminates.
|
||||
* The process (or log-out) requesting this app to quit will be blocked until the {@link QuitResponse} is handled.
|
||||
* Apps that require complex UI to shutdown may call the {@link QuitResponse} from any thread.
|
||||
* Your app may be asked to quit multiple times before you have responded to the initial request.
|
||||
* This handler is called each time a quit is requested, and the same {@link QuitResponse} object is passed until it is handled.
|
||||
* Once used, the {@link QuitResponse} cannot be used again to change the decision.
|
||||
*
|
||||
* @param e the request to quit this application.
|
||||
* @param response the one-shot response object used to cancel or proceed with the quit action.
|
||||
* @param e the request to quit this application
|
||||
* @param response the one-shot response object used to cancel or proceed
|
||||
* with the quit action
|
||||
*/
|
||||
public void handleQuitRequestWith(final QuitEvent e, final QuitResponse response);
|
||||
public void handleQuitRequestWith(QuitEvent e, QuitResponse response);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,21 +28,23 @@ package java.awt.desktop;
|
||||
/**
|
||||
* Used to respond to a request to quit the application.
|
||||
*
|
||||
* @see java.awt.Desktop#setQuitHandler(java.awt.desktop.QuitHandler)
|
||||
* @see java.awt.desktop.QuitHandler
|
||||
* @see java.awt.Desktop#setQuitStrategy(java.awt.desktop.QuitStrategy)
|
||||
*
|
||||
* @see java.awt.Desktop#setQuitHandler(QuitHandler)
|
||||
* @see QuitHandler
|
||||
* @see java.awt.Desktop#setQuitStrategy(QuitStrategy)
|
||||
* @since 9
|
||||
*/
|
||||
public interface QuitResponse {
|
||||
|
||||
/**
|
||||
* Notifies the external quit requester that the quit will proceed, and performs the default {@link java.awt.desktop.QuitStrategy}.
|
||||
* Notifies the external quit requester that the quit will proceed, and
|
||||
* performs the default {@link QuitStrategy}.
|
||||
*/
|
||||
public void performQuit();
|
||||
|
||||
/**
|
||||
* Notifies the external quit requester that the user has explicitly canceled the pending quit, and leaves the application running.
|
||||
* Notifies the external quit requester that the user has explicitly
|
||||
* canceled the pending quit, and leaves the application running.
|
||||
* <p>
|
||||
* <b>Note: this will cancel a pending log-out, restart, or shutdown.</b>
|
||||
*/
|
||||
public void cancelQuit();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,18 +26,19 @@
|
||||
package java.awt.desktop;
|
||||
|
||||
/**
|
||||
* The strategy used to shut down the application, if Sudden Termination is not enabled.
|
||||
* The strategy used to shut down the application, if Sudden Termination is not
|
||||
* enabled.
|
||||
*
|
||||
* @see java.awt.Desktop#setQuitHandler(java.awt.desktop.QuitHandler)
|
||||
* @see java.awt.Desktop#setQuitStrategy(java.awt.desktop.QuitStrategy)
|
||||
* @see java.awt.Desktop#setQuitHandler(QuitHandler)
|
||||
* @see java.awt.Desktop#setQuitStrategy(QuitStrategy)
|
||||
* @see java.awt.Desktop#enableSuddenTermination()
|
||||
* @see java.awt.Desktop#disableSuddenTermination()
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public enum QuitStrategy {
|
||||
/**
|
||||
* Shuts down the application by calling {@code System.exit(0)}. This is the default strategy.
|
||||
* Shuts down the application by calling {@code System.exit(0)}. This is the
|
||||
* default strategy.
|
||||
*/
|
||||
NORMAL_EXIT,
|
||||
|
||||
|
@ -35,11 +35,13 @@ import java.awt.HeadlessException;
|
||||
*
|
||||
* @see ScreenSleepListener#screenAboutToSleep(ScreenSleepEvent)
|
||||
* @see ScreenSleepListener#screenAwoke(ScreenSleepEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class ScreenSleepEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 7521606180376544150L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,9 +26,11 @@
|
||||
package java.awt.desktop;
|
||||
|
||||
/**
|
||||
* Implementors receive notification when the displays attached to the system have entered power save sleep.
|
||||
*
|
||||
* This notification is useful for discontinuing a costly animation, or indicating that the user is no longer present on a network service.
|
||||
* Implementors receive notification when the displays attached to the system
|
||||
* have entered power save sleep.
|
||||
* <p>
|
||||
* This notification is useful for discontinuing a costly animation, or
|
||||
* indicating that the user is no longer present on a network service.
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
@ -36,13 +38,15 @@ public interface ScreenSleepListener extends SystemEventListener {
|
||||
|
||||
/**
|
||||
* Called when the system displays have entered power save sleep.
|
||||
* @param e the screen sleep event
|
||||
*
|
||||
* @param e the screen sleep event
|
||||
*/
|
||||
public void screenAboutToSleep(final ScreenSleepEvent e);
|
||||
public void screenAboutToSleep(ScreenSleepEvent e);
|
||||
|
||||
/**
|
||||
* Called when the system displays have awoken from power save sleep.
|
||||
* @param e the screen sleep event
|
||||
*
|
||||
* @param e the screen sleep event
|
||||
*/
|
||||
public void screenAwoke(final ScreenSleepEvent e);
|
||||
public void screenAwoke(ScreenSleepEvent e);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,9 +28,8 @@ package java.awt.desktop;
|
||||
import java.util.EventListener;
|
||||
|
||||
/**
|
||||
* Common interface for all event listener sub-types.
|
||||
*
|
||||
* Implementors may implement multiple sub-types, but only need to call
|
||||
* Common interface for all event listener sub-types. Implementors may implement
|
||||
* multiple sub-types, but only need to call
|
||||
* {@link java.awt.Desktop#addAppEventListener(SystemEventListener)} once to
|
||||
* receive all notifications.
|
||||
*
|
||||
|
@ -34,11 +34,13 @@ import java.awt.HeadlessException;
|
||||
*
|
||||
* @see SystemSleepListener#systemAboutToSleep(SystemSleepEvent)
|
||||
* @see SystemSleepListener#systemAwoke(SystemSleepEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class SystemSleepEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 11372269824930549L;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,7 @@ package java.awt.desktop;
|
||||
/**
|
||||
* Implementors receive notification as the system is entering sleep, and after
|
||||
* the system wakes.
|
||||
*
|
||||
* <p>
|
||||
* This notification is useful for disconnecting from network services prior to
|
||||
* sleep, or re-establishing a connection if the network configuration has
|
||||
* changed during sleep.
|
||||
@ -42,14 +42,14 @@ public interface SystemSleepListener extends SystemEventListener {
|
||||
* delivered prior to the actual system sleep, and may be processed after
|
||||
* the corresponding wake has occurred.
|
||||
*
|
||||
* @param e the system sleep event
|
||||
* @param e the system sleep event
|
||||
*/
|
||||
public void systemAboutToSleep(final SystemSleepEvent e);
|
||||
public void systemAboutToSleep(SystemSleepEvent e);
|
||||
|
||||
/**
|
||||
* Called after the system has awoken from sleeping.
|
||||
*
|
||||
* @param e the system sleep event
|
||||
* @param e the system sleep event
|
||||
*/
|
||||
public void systemAwoke(final SystemSleepEvent e);
|
||||
public void systemAwoke(SystemSleepEvent e);
|
||||
}
|
||||
|
@ -30,19 +30,23 @@ import java.awt.GraphicsEnvironment;
|
||||
import java.awt.HeadlessException;
|
||||
|
||||
/**
|
||||
* Event sent when the user session has been changed.
|
||||
*
|
||||
* Some systems may provide a reason of a user session change.
|
||||
* Event sent when the user session has been changed. Some systems may provide a
|
||||
* reason of a user session change.
|
||||
*
|
||||
* @see UserSessionListener#userSessionActivated(UserSessionEvent)
|
||||
* @see UserSessionListener#userSessionDeactivated(UserSessionEvent)
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public final class UserSessionEvent extends AppEvent {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 9 for interoperability.
|
||||
*/
|
||||
private static final long serialVersionUID = 6747138462796569055L;
|
||||
|
||||
/**
|
||||
* The reason of the user session change.
|
||||
*/
|
||||
private final Reason reason;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,32 +25,33 @@
|
||||
|
||||
package java.awt.desktop;
|
||||
|
||||
|
||||
/**
|
||||
* Implementors receive notification when the user session changes.
|
||||
*
|
||||
* This notification is useful for discontinuing a costly animation,
|
||||
* or indicating that the user is no longer present on a network service.
|
||||
*
|
||||
* <p>
|
||||
* This notification is useful for discontinuing a costly animation, or
|
||||
* indicating that the user is no longer present on a network service.
|
||||
* <p>
|
||||
* Some systems may provide a reason of the user session change.
|
||||
*
|
||||
* @see UserSessionEvent.Reason#UNSPECIFIED
|
||||
* @see UserSessionEvent.Reason#CONSOLE
|
||||
* @see UserSessionEvent.Reason#REMOTE
|
||||
* @see UserSessionEvent.Reason#LOCK
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public interface UserSessionListener extends SystemEventListener {
|
||||
|
||||
/**
|
||||
* Called when the user session has been switched away.
|
||||
* @param e the user session switch event
|
||||
*
|
||||
* @param e the user session switch event
|
||||
*/
|
||||
public void userSessionDeactivated(final UserSessionEvent e);
|
||||
public void userSessionDeactivated(UserSessionEvent e);
|
||||
|
||||
/**
|
||||
* Called when the user session has been switched to.
|
||||
* @param e the user session switch event
|
||||
*
|
||||
* @param e the user session switch event
|
||||
*/
|
||||
public void userSessionActivated(final UserSessionEvent e);
|
||||
public void userSessionActivated(UserSessionEvent e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user