true
.
- *
- * If a Preferences item isn't present, this method adds and enables it.
- *
- * @param enable specifies whether the Preferences item in the application menu should be enabled (true
) or not (false
)
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public void setEnabledPreferencesMenu(final boolean enable) {
- menuBarHandler.setPreferencesMenuItemVisible(true);
- menuBarHandler.setPreferencesMenuItemEnabled(enable);
- }
-
- /**
- * Enables the About item in the application menu. The ApplicationListener receives a callback for
- * selection of the About item in the application menu only if this is set to 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.
- *
- * @param enable specifies whether the About item in the application menu should be enabled (true
) or not (false
)
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public void setEnabledAboutMenu(final boolean enable) {
- menuBarHandler.setAboutMenuItemEnabled(enable);
- }
-
- /**
- * Determines if the Preferences item of the application menu is enabled.
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public boolean getEnabledPreferencesMenu() {
- return menuBarHandler.isPreferencesMenuItemEnabled();
- }
-
- /**
- * Determines if the About item of the application menu is enabled.
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public boolean getEnabledAboutMenu() {
- return menuBarHandler.isAboutMenuItemEnabled();
- }
-
- /**
- * Determines if the About item of the application menu is present.
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public boolean isAboutMenuItemPresent() {
- return menuBarHandler.isAboutMenuItemVisible();
- }
-
- /**
- * Adds the About item to the application menu if the item is not already present.
- *
- * @deprecated use {@link #setAboutHandler(AboutHandler)} with a non-null {@link AboutHandler} parameter
- * @since 1.4
- */
- @Deprecated
- public void addAboutMenuItem() {
- menuBarHandler.setAboutMenuItemVisible(true);
- }
-
- /**
- * Removes the About item from the application menu if the item is present.
- *
- * @deprecated use {@link #setAboutHandler(AboutHandler)} with a null parameter
- * @since 1.4
- */
- @Deprecated
- public void removeAboutMenuItem() {
- menuBarHandler.setAboutMenuItemVisible(false);
- }
-
- /**
- * Determines if the About Preferences of the application menu is present. By default there is no Preferences menu item.
- *
- * @deprecated no replacement
- * @since 1.4
- */
- @Deprecated
- public boolean isPreferencesMenuItemPresent() {
- return menuBarHandler.isPreferencesMenuItemVisible();
- }
-
- /**
- * Adds the Preferences item to the application menu if the item is not already present.
- *
- * @deprecated use {@link #setPreferencesHandler(PreferencesHandler)} with a non-null {@link PreferencesHandler} parameter
- * @since 1.4
- */
- @Deprecated
- public void addPreferencesMenuItem() {
- menuBarHandler.setPreferencesMenuItemVisible(true);
- }
-
- /**
- * Removes the Preferences item from the application menu if that item is present.
- *
- * @deprecated use {@link #setPreferencesHandler(PreferencesHandler)} with a null parameter
- * @since 1.4
- */
- @Deprecated
- public void removePreferencesMenuItem() {
- menuBarHandler.setPreferencesMenuItemVisible(false);
- }
-
- /**
- * @deprecated Use java.awt.MouseInfo.getPointerInfo().getLocation()
.
- *
- * @since 1.4
- */
- @Deprecated
- public static Point getMouseLocationOnScreen() {
- return java.awt.MouseInfo.getPointerInfo().getLocation();
- }
}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java 2015-11-19 18:20:23.413553888 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java 2015-11-19 18:20:23.281553884 +0300
@@ -46,7 +46,7 @@
* @see ScreenSleepListener
* @see SystemSleepListener
*
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}.
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}.
* @since 1.4
*/
@SuppressWarnings("deprecation")
--- old/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java 2015-11-19 18:20:23.821553898 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java 2015-11-19 18:20:23.689553895 +0300
@@ -30,7 +30,7 @@
/**
* The class of events sent to the deprecated ApplicationListener callbacks.
*
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
* @since 1.4
*/
@Deprecated
--- old/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java 2015-11-19 18:20:24.237553909 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java 2015-11-19 18:20:24.105553906 +0300
@@ -47,7 +47,7 @@
* @see SystemSleepListener
*
* @since 1.4
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link QuitResponse}
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
*/
@SuppressWarnings("deprecation")
@Deprecated
@@ -134,7 +134,7 @@
* event
. To reject the quit, set isHandled(false)
.
*
* @param event a Quit Application event
- * @deprecated use {@link QuitHandler} and {@link QuitResponse}
+ * @deprecated use {@link QuitHandler} and {@link MacQuitResponse}
*/
@Deprecated
public void handleQuit(ApplicationEvent event);
--- old/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java 2015-11-19 18:20:24.641553919 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java 2015-11-19 18:20:24.521553916 +0300
@@ -25,7 +25,7 @@
package com.apple.eawt;
-import com.apple.eawt.AppEvent.FullScreenEvent;
+import java.awt.AppEvent.FullScreenEvent;
/**
* Abstract adapter class for receiving fullscreen events. This class is provided
--- old/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenHandler.java 2015-11-19 18:20:25.037553929 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenHandler.java 2015-11-19 18:20:24.913553926 +0300
@@ -31,7 +31,8 @@
import javax.swing.RootPaneContainer;
-import com.apple.eawt.AppEvent.FullScreenEvent;
+import java.awt.AppEvent.FullScreenEvent;
+import java.awt.desktop.FullScreenListener;
import sun.awt.SunToolkit;
import java.lang.annotation.Native;
--- old/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java 2015-11-19 18:20:25.453553940 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java 2015-11-19 18:20:25.325553937 +0300
@@ -32,6 +32,7 @@
import sun.lwawt.macosx.*;
import com.apple.eawt.event.GestureUtilities;
+import java.awt.desktop.FullScreenListener;
/**
* Utility class perform animated full screen actions to top-level {@link Window}s.
--- old/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java 2015-11-19 18:20:25.873553951 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/_AppDockIconHandler.java 2015-11-19 18:20:25.745553947 +0300
@@ -35,6 +35,7 @@
class _AppDockIconHandler {
private static native void nativeSetDockMenu(final long cmenu);
private static native void nativeSetDockIconImage(final long image);
+ private static native void nativeSetDockIconProgress(final int value);
private static native long nativeGetDockIconImage();
private static native void nativeSetDockIconBadge(final String badge);
@@ -92,6 +93,10 @@
void setDockIconBadge(final String badge) {
nativeSetDockIconBadge(badge);
}
+
+ void setDockIconProgress(int value) {
+ nativeSetDockIconProgress(value);
+ }
static Creator getCImageCreator() {
try {
--- old/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java 2015-11-19 18:20:26.293553962 +0300
+++ new/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java 2015-11-19 18:20:26.157553958 +0300
@@ -26,6 +26,7 @@
package com.apple.eawt;
import java.awt.*;
+import java.awt.desktop.*;
import java.awt.event.WindowEvent;
import java.io.File;
import java.net.*;
@@ -34,7 +35,7 @@
import sun.awt.AppContext;
import sun.awt.SunToolkit;
-import com.apple.eawt.AppEvent.*;
+import java.awt.AppEvent.*;
class _AppEventHandler {
private static final int NOTIFY_ABOUT = 1;
@@ -84,8 +85,6 @@
final _ScreenSleepDispatcher screenSleepDispatcher = new _ScreenSleepDispatcher();
final _SystemSleepDispatcher systemSleepDispatcher = new _SystemSleepDispatcher();
- final _AppEventLegacyHandler legacyHandler = new _AppEventLegacyHandler(this);
-
QuitStrategy defaultQuitAction = QuitStrategy.SYSTEM_EXIT_0;
_AppEventHandler() {
@@ -101,8 +100,8 @@
}
}
- void addListener(final AppEventListener listener) {
- if (listener instanceof AppReOpenedListener) reOpenAppDispatcher.addListener((AppReOpenedListener)listener);
+ void addListener(final SystemEventListener listener) {
+ if (listener instanceof AppReopenedListener) reOpenAppDispatcher.addListener((AppReopenedListener)listener);
if (listener instanceof AppForegroundListener) foregroundAppDispatcher.addListener((AppForegroundListener)listener);
if (listener instanceof AppHiddenListener) hiddenAppDispatcher.addListener((AppHiddenListener)listener);
if (listener instanceof UserSessionListener) userSessionDispatcher.addListener((UserSessionListener)listener);
@@ -110,8 +109,8 @@
if (listener instanceof SystemSleepListener) systemSleepDispatcher.addListener((SystemSleepListener)listener);
}
- void removeListener(final AppEventListener listener) {
- if (listener instanceof AppReOpenedListener) reOpenAppDispatcher.removeListener((AppReOpenedListener)listener);
+ void removeListener(final SystemEventListener listener) {
+ if (listener instanceof AppReopenedListener) reOpenAppDispatcher.removeListener((AppReopenedListener)listener);
if (listener instanceof AppForegroundListener) foregroundAppDispatcher.removeListener((AppForegroundListener)listener);
if (listener instanceof AppHiddenListener) hiddenAppDispatcher.removeListener((AppHiddenListener)listener);
if (listener instanceof UserSessionListener) userSessionDispatcher.removeListener((UserSessionListener)listener);
@@ -127,10 +126,10 @@
this.defaultQuitAction = defaultQuitAction;
}
- QuitResponse currentQuitResponse;
- synchronized QuitResponse obtainQuitResponse() {
+ MacQuitResponse currentQuitResponse;
+ synchronized MacQuitResponse obtainQuitResponse() {
if (currentQuitResponse != null) return currentQuitResponse;
- return currentQuitResponse = new QuitResponse(this);
+ return currentQuitResponse = new MacQuitResponse(this);
}
synchronized void cancelQuit() {
@@ -270,10 +269,10 @@
}
}
- class _AppReOpenedDispatcher extends _AppEventMultiplexorNote: when some action is invoked and the associated * application is executed, it will be executed on the same system as * the one on which the Java application was launched. + * + *
+ * Please note that for Mac OS notifications for
+ * {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)},
+ * {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} )} and
+ * {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)}
+ * are only sent if the Java app is a bundled application,
+ * with a
+ * Setting the {@link AboutHandler} to
+ * Setting the {@link PreferencesHandler} to
+ * Setting the {@link AboutHandler} to
+ * Setting the {@link PreferencesHandler} to
+ *
+ * In addition to file name suffixes, Mac OS X can use Finder attributes like file
+ * To identify the application that can handle a document, the Finder can look at the
+ * If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple
+ * Developer Connection to avoid collisions with codes used by other developers. You can register a codes online at the
+ * Creator Code Registration site.
+ */
+public abstract class FileManager {
+
+ /**
+ * The default.
+ */
+ public static final short kOnAppropriateDisk = -32767;
+
+ /**
+ * Read-only system hierarchy.
+ */
+ public static final short kSystemDomain = -32766;
+
+ /**
+ * All users of a single machine have access to these resources.
+ */
+ public static final short kLocalDomain = -32765;
+
+ /**
+ * All users configured to use a common network server has access to these
+ * resources.
+ */
+ public static final short kNetworkDomain = -32764;
+
+ /**
+ * Read/write. Resources that are private to the user.
+ */
+ public static final short kUserDomain = -32763;
+
+ /**
+ * Converts an OSType (e.g. "macs" from {@literal CFBundleDocumentTypes
array present in it's
+ * Info.plist. See the
+ * Info.plist
+ * Key Reference for more information about adding a
+ * CFBundleDocumentTypes
key to your app's Info.plist.
*
* @since 1.6
* @author Armin Chen
@@ -110,7 +123,124 @@
* Represents a "browse" action.
* @see Desktop#browse(java.net.URI)
*/
- BROWSE
+ BROWSE,
+
+ /**
+ * Represents a AppForegroundListener
+ * @see java.awt.desktop.AppForegroundListener
+ */
+ APP_EVENT_FOREGROUND,
+
+ /**
+ * Represents a AppHiddenListener
+ * @see java.awt.desktop.AppHiddenListener
+ */
+ APP_EVENT_HIDDEN,
+
+ /**
+ * Represents a AppReopenedListener
+ * @see java.awt.desktop.AppReopenedListener
+ */
+ APP_EVENT_REOPENED,
+
+ /**
+ * Represents a ScreenSleepListener
+ * @see java.awt.desktop.ScreenSleepListener
+ */
+ APP_EVENT_SCREEN_SLEEP,
+
+ /**
+ * Represents a SystemSleepListener
+ * @see java.awt.desktop.SystemSleepListener
+ */
+ APP_EVENT_SYSTEM_SLEEP,
+
+ /**
+ * Represents a UserSessionListener
+ * @see java.awt.desktop.UserSessionListener
+ */
+ APP_EVENT_USER_SESSION,
+
+ /**
+ * Represents a AboutHandler
+ * @see #setAboutHandler(java.awt.desktop.AboutHandler)
+ */
+ APP_ABOUT,
+
+ /**
+ * Represents a PreferencesHandler
+ * @see #setPreferencesHandler(java.awt.desktop.PreferencesHandler)
+ */
+ APP_PREFERENCES,
+
+ /**
+ * Represents a OpenFilesHandler
+ * @see #setOpenFileHandler(java.awt.desktop.OpenFilesHandler)
+ */
+ APP_OPEN_FILE,
+
+ /**
+ * Represents a PrintFilesHandler
+ * @see #setPrintFileHandler(java.awt.desktop.PrintFilesHandler)
+ */
+ APP_PRINT_FILE,
+
+ /**
+ * Represents a OpenURIHandler
+ * @see #setOpenURIHandler(java.awt.desktop.OpenURIHandler)
+ */
+ APP_OPEN_URI,
+
+ /**
+ * Represents a QuitHandler
+ * @see #setQuitHandler(java.awt.desktop.QuitHandler)
+ */
+ APP_QUIT_HANDLER,
+
+ /**
+ * Represents a QuitStrategy
+ * @see #setQuitStrategy(java.awt.desktop.QuitStrategy)
+ */
+ APP_QUIT_STRATEGY,
+
+ /**
+ * Represents a SuddenTermination
+ * @see #enableSuddenTermination()
+ */
+ APP_SUDDEN_TERMINATION,
+
+ /**
+ * Represents a requestForeground
+ * @see #requestForeground(boolean)
+ */
+ APP_REQUEST_FOREGROUND,
+
+ /**
+ * Represents a HelpViewer
+ * @see #openHelpViewer()
+ */
+ APP_HELP_VIEWER,
+
+ /**
+ * Represents a menu bar
+ * @see #setDefaultMenuBar(javax.swing.JMenuBar)
+ */
+ APP_MENU_BAR,
+
+ /**
+ * Represents a platform specific full screen
+ * @see #addWindowFullScreenListener(java.awt.Window, java.awt.desktop.FullScreenListener)
+ * @see #removeWindowFullScreenListener(java.awt.Window, java.awt.desktop.FullScreenListener)
+ * @see #setWindowCanFullScreen(java.awt.Window, boolean)
+ * @see #requestToggleFullScreen(java.awt.Window)
+ */
+ FULLSCREEN,
+
+ /**
+ * Represents a FileManager
+ * @see #getFileManager()
+ */
+ FILEMANAGER
};
private DesktopPeer peer;
@@ -208,7 +338,7 @@
if (!file.exists()) {
throw new IllegalArgumentException("The file: "
- + file.getPath() + " doesn't exist.");
+ + file.getPath() + " doesn't exist.");
}
file.canRead();
@@ -224,7 +354,7 @@
private void checkActionSupport(Action actionType){
if (!isSupported(actionType)) {
throw new UnsupportedOperationException("The " + actionType.name()
- + " action is not supported on the current platform!");
+ + " action is not supported on the current platform!");
}
}
@@ -238,7 +368,7 @@
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new AWTPermission(
- "showWindowWithoutWarningBanner"));
+ "showWindowWithoutWarningBanner"));
}
}
@@ -479,7 +609,273 @@
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new FilePermission("<null
reverts it to the
+ * default behavior.
+ *
+ * @param aboutHandler the handler to respond to the
+ * {@link AboutHandler#handleAbout} )} message
+ */
+ public void setAboutHandler(final AboutHandler aboutHandler) {
+ checkActionSupport(Action.APP_ABOUT);
+ peer.setAboutHandler(aboutHandler);
+ }
+
+ /**
+ * Installs a handler to show a custom Preferences window for your
+ * application.
+ * null
reverts it to
+ * the default behavior
+ *
+ * @param preferencesHandler the handler to respond to the
+ * {@link PreferencesHandler#handlePreferences(PreferencesEvent)}
+ */
+ public void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
+ checkActionSupport(Action.APP_PREFERENCES);
+ peer.setPreferencesHandler(preferencesHandler);
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * open a list of files.
+ *
+ * @param openFileHandler handler
+ */
+ public void setOpenFileHandler(final OpenFilesHandler openFileHandler) {
+ checkActionSupport(Action.APP_OPEN_FILE);
+ peer.setOpenFileHandler(openFileHandler);
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * print a list of files.
+ *
+ * @param printFileHandler handler
+ */
+ public void setPrintFileHandler(final PrintFilesHandler printFileHandler) {
+ checkActionSupport(Action.APP_PRINT_FILE);
+ peer.setPrintFileHandler(printFileHandler);
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * open a URL.
+ *
+ * Setting the handler to null
causes all
+ * {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be
+ * enqueued until another handler is set.
+ *
+ * @param openURIHandler handler
+ */
+ public void setOpenURIHandler(final OpenURIHandler openURIHandler) {
+ checkActionSupport(Action.APP_OPEN_URI);
+ peer.setOpenURIHandler(openURIHandler);
+ }
+
+ /**
+ * Installs the handler which determines if the application should quit. The
+ * handler is passed a one-shot {@link QuitResponse} which can cancel or
+ * proceed with the quit. Setting the handler to null
causes
+ * all quit requests to directly perform the default {@link QuitStrategy}.
+ *
+ * @param quitHandler the handler that is called when the application is
+ * asked to quit
+ */
+ public void setQuitHandler(final QuitHandler quitHandler) {
+ checkActionSupport(Action.APP_QUIT_HANDLER);
+ peer.setQuitHandler(quitHandler);
+ }
+
+ /**
+ * Sets the default strategy used to quit this application. The default is
+ * calling SYSTEM_EXIT_0.
+ *
+ * @param strategy the way this application should be shutdown
+ */
+ public void setQuitStrategy(final QuitStrategy strategy) {
+ checkActionSupport(Action.APP_QUIT_STRATEGY);
+ peer.setQuitStrategy(strategy);
+ }
+
+ /**
+ * Enables this application to be suddenly terminated.
+ *
+ * Call this method to indicate your application's state is saved, and
+ * requires no notification to be terminated. Letting your application
+ * remain terminatable improves the user experience by avoiding re-paging in
+ * your application when it's asked to quit.
+ *
+ * Note: enabling sudden termination will allow your application to be
+ * quit without notifying your QuitHandler, or running any shutdown
+ * hooks.
+ * E.g. user initiated Cmd-Q, logout, restart, or shutdown requests will
+ * effectively "kill -KILL" your application.
+ *
+ * @see #disableSuddenTermination()
+ */
+ public void enableSuddenTermination() {
+ checkActionSupport(Action.APP_SUDDEN_TERMINATION);
+ peer.enableSuddenTermination();
+ }
+
+ /**
+ * Prevents this application from being suddenly terminated.
+ *
+ * Call this method to indicate that your application has unsaved state, and
+ * may not be terminated without notification.
+ *
+ * @see #enableSuddenTermination()
+ */
+ public void disableSuddenTermination() {
+ checkActionSupport(Action.APP_SUDDEN_TERMINATION);
+ peer.disableSuddenTermination();
+ }
+
+ /**
+ * Requests this application to move to the foreground.
+ *
+ * @param allWindows if all windows of this application should be moved to
+ * the foreground, or only the foremost one
+ */
+ public void requestForeground(final boolean allWindows) {
+ checkActionSupport(Action.APP_REQUEST_FOREGROUND);
+ peer.requestForeground(allWindows);
+ }
+
+ /**
+ * Opens the native help viewer application.
+ */
+ public void openHelpViewer() {
+ checkActionSupport(Action.APP_HELP_VIEWER);
+ peer.openHelpViewer();
+ }
+
+ /**
+ * Sets the default menu bar to use when there are no active frames.
+ *
+ * Note, Aqua Look and Feel should be active to support this on Mac OS.
+ *
+ * @param menuBar to use when no other frames are active
+ */
+ public void setDefaultMenuBar(final JMenuBar menuBar) {
+ checkActionSupport(Action.APP_MENU_BAR);
+ peer.setDefaultMenuBar(menuBar);
+ }
+
+ /**
+ * Attaches a {@link FullScreenListener} to the specified top-level
+ * {@link Window}.
+ *
+ * @param window to attach the {@link FullScreenListener} to
+ * @param listener to be notified when a full screen event occurs
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ public void addWindowFullScreenListener(final Window window,
+ final FullScreenListener listener) {
+ checkActionSupport(Action.FULLSCREEN);
+ peer.addWindowFullScreenListener(window, listener);
+ }
+
+ /**
+ * Removes a {@link FullScreenListener} from the specified top-level
+ * {@link Window}.
+ *
+ * @param window to remove the {@link FullScreenListener} from
+ * @param listener to be removed
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ public void removeWindowFullScreenListener(final Window window,
+ final FullScreenListener listener) {
+ checkActionSupport(Action.FULLSCREEN);
+ peer.removeWindowFullScreenListener(window, listener);
+ }
+
+ /**
+ * Marks a {@link Window} as able to animate into or out of full screen
+ * mode.
+ *
+ * Only top-level {@link Window}s which are {@link RootPaneContainer}s are
+ * able to be animated into and out of full screen mode. The {@link Window}
+ * must be marked as full screen-able before the native peer is created with
+ * {@link Component#addNotify()}.
+ *
+ * @param window window
+ * @param canFullScreen flag
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ public void setWindowCanFullScreen(final Window window, final boolean canFullScreen) {
+ checkActionSupport(Action.FULLSCREEN);
+ peer.setWindowCanFullScreen(window, canFullScreen);
+ }
+
+ /**
+ * Requests that a {@link Window} should get into or out of full screen
+ * mode. Only {@link Window}s marked as full screenable by
+ * {@link #setWindowCanFullScreen(Window, boolean)} can be toggled.
+ *
+ * @param window to animate into or out of full screen mode
+ */
+ public void requestToggleFullScreen(final Window window) {
+ checkActionSupport(Action.FULLSCREEN);
+ peer.requestToggleFullScreen(window);
+ }
+
+ /**
+ * Returns the mac specific FileManager.
+ * @return FileManager
+ * @see FileManager
+ */
+ public FileManager getFileManager() {
+ checkActionSupport(Action.FILEMANAGER);
+ return peer.getFileManager();
+ }
+
}
--- old/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java 2015-11-19 18:20:29.717554049 +0300
+++ new/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java 2015-11-19 18:20:29.593554046 +0300
@@ -22,14 +22,25 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-
package java.awt.peer;
-
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.awt.Desktop.Action;
+import java.awt.Window;
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.FileManager;
+import java.awt.desktop.FullScreenListener;
+import java.awt.desktop.SystemEventListener;
+import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.PrintFilesHandler;
+import java.awt.desktop.QuitHandler;
+import java.awt.desktop.QuitStrategy;
+import javax.swing.JMenuBar;
+import javax.swing.RootPaneContainer;
/**
* The {@code DesktopPeer} interface provides methods for the operation
@@ -104,4 +115,228 @@
* or it fails to be launched.
*/
void browse(URI uri) throws IOException;
+
+ /**
+ * Adds sub-types of {@link SystemEventListener} to listen for notifications
+ * from the native system.
+ *
+ * @param listener listener
+ * @see java.awt.desktop.AppForegroundListener
+ * @see java.awt.desktop.AppHiddenListener
+ * @see java.awt.desktop.AppReopenedListener
+ * @see java.awt.desktop.ScreenSleepListener
+ * @see java.awt.desktop.SystemSleepListener
+ * @see java.awt.desktop.UserSessionListener
+ */
+ default void addAppEventListener(final SystemEventListener listener) {
+ }
+
+ /**
+ * Removes sub-types of {@link SystemEventListener} to listen for notifications
+ * from the native system.
+ *
+ * @param listener listener
+ * @see java.awt.desktop.AppForegroundListener
+ * @see java.awt.desktop.AppHiddenListener
+ * @see java.awt.desktop.AppReopenedListener
+ * @see java.awt.desktop.ScreenSleepListener
+ * @see java.awt.desktop.SystemSleepListener
+ * @see java.awt.desktop.UserSessionListener
+ */
+ default void removeAppEventListener(final SystemEventListener listener) {
+ }
+
+ /**
+ * Installs a handler to show a custom About window for your application.
+ * null
reverts it to the
+ * default behavior.
+ *
+ * @param aboutHandler the handler to respond to the
+ * {@link AboutHandler#handleAbout} )} message
+ */
+ default void setAboutHandler(final AboutHandler aboutHandler) {
+ }
+
+ /**
+ * Installs a handler to show a custom Preferences window for your
+ * application.
+ * null
reverts it to
+ * the default behavior
+ *
+ * @param preferencesHandler the handler to respond to the
+ * {@link PreferencesHandler#handlePreferences(PreferencesEvent)}
+ */
+ default void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * open a list of files.
+ *
+ * @param openFileHandler handler
+ */
+ default void setOpenFileHandler(final OpenFilesHandler openFileHandler) {
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * print a list of files.
+ *
+ * @param printFileHandler handler
+ */
+ default void setPrintFileHandler(final PrintFilesHandler printFileHandler) {
+ }
+
+ /**
+ * Installs the handler which is notified when the application is asked to
+ * open a URL.
+ *
+ * Setting the handler to null
causes all
+ * {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be
+ * enqueued until another handler is set.
+ *
+ * @param openURIHandler handler
+ */
+ default void setOpenURIHandler(final OpenURIHandler openURIHandler) {
+ }
+
+ /**
+ * Installs the handler which determines if the application should quit. The
+ * handler is passed a one-shot {@link QuitResponse} which can cancel or
+ * proceed with the quit. Setting the handler to null
causes
+ * all quit requests to directly perform the default {@link QuitStrategy}.
+ *
+ * @param quitHandler the handler that is called when the application is
+ * asked to quit
+ */
+ default void setQuitHandler(final QuitHandler quitHandler) {
+ }
+
+ /**
+ * Sets the default strategy used to quit this application. The default is
+ * calling SYSTEM_EXIT_0.
+ *
+ * @param strategy the way this application should be shutdown
+ */
+ default void setQuitStrategy(final QuitStrategy strategy) {
+ }
+
+ /**
+ * Enables this application to be suddenly terminated.
+ *
+ * Call this method to indicate your application's state is saved, and
+ * requires no notification to be terminated. Letting your application
+ * remain terminatable improves the user experience by avoiding re-paging in
+ * your application when it's asked to quit.
+ *
+ * Note: enabling sudden termination will allow your application to be
+ * quit without notifying your QuitHandler, or running any shutdown
+ * hooks.
+ * E.g. user initiated Cmd-Q, logout, restart, or shutdown requests will
+ * effectively "kill -KILL" your application.
+ *
+ * @see #disableSuddenTermination()
+ */
+ default void enableSuddenTermination() {
+ }
+
+ /**
+ * Prevents this application from being suddenly terminated.
+ *
+ * Call this method to indicate that your application has unsaved state, and
+ * may not be terminated without notification.
+ *
+ * @see #enableSuddenTermination()
+ */
+ default void disableSuddenTermination() {
+ }
+
+ /**
+ * Requests this application to move to the foreground.
+ *
+ * @param allWindows if all windows of this application should be moved to
+ * the foreground, or only the foremost one
+ */
+ default void requestForeground(final boolean allWindows) {
+ }
+
+ /**
+ * Opens the native help viewer application.
+ */
+ default void openHelpViewer() {
+ }
+
+ /**
+ * Sets the default menu bar to use when there are no active frames.
+ *
+ * @param menuBar to use when no other frames are active
+ */
+ default void setDefaultMenuBar(final JMenuBar menuBar) {
+ }
+
+ /**
+ * Attaches a {@link FullScreenListener} to the specified top-level
+ * {@link Window}.
+ *
+ * @param window to attach the {@link FullScreenListener} to
+ * @param listener to be notified when a full screen event occurs
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ default void addWindowFullScreenListener(final Window window,
+ final FullScreenListener listener) {
+ }
+
+ /**
+ * Removes a {@link FullScreenListener} from the specified top-level
+ * {@link Window}.
+ *
+ * @param window to remove the {@link FullScreenListener} from
+ * @param listener to be removed
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ default void removeWindowFullScreenListener(final Window window,
+ final FullScreenListener listener) {
+ }
+
+ /**
+ * Marks a {@link Window} as able to animate into or out of full screen
+ * mode.
+ *
+ * Only top-level {@link Window}s which are {@link RootPaneContainer}s are
+ * able to be animated into and out of full screen mode. The {@link Window}
+ * must be marked as full screen-able before the native peer is created with
+ * {@link Component#addNotify()}.
+ *
+ * @param window window
+ * @param canFullScreen flag
+ * @throws IllegalArgumentException if window is not a
+ * {@link RootPaneContainer}
+ */
+ default void setWindowCanFullScreen(final Window window,
+ final boolean canFullScreen) {
+ }
+
+ /**
+ * Requests that a {@link Window} should get into or out of full screen
+ * mode. Only {@link Window}s marked as full screenable by
+ * {@link #setWindowCanFullScreen(Window, boolean)} can be toggled.
+ *
+ * @param window to animate into or out of full screen mode
+ */
+ default void requestToggleFullScreen(final Window window) {
+ }
+
+ /**
+ * Returns the Mac specific FileManager.
+ * @return FileManager
+ * @see FileManager
+ */
+ default FileManager getFileManager() {
+ return null;
+ }
+
}
--- old/src/java.desktop/share/classes/sun/awt/ComponentFactory.java 2015-11-19 18:20:30.141554060 +0300
+++ new/src/java.desktop/share/classes/sun/awt/ComponentFactory.java 2015-11-19 18:20:30.013554057 +0300
@@ -73,6 +73,23 @@
default DesktopPeer createDesktopPeer(Desktop target) {
throw new HeadlessException();
}
+
+ /**
+ * Creates this toolkit's implementation of the {@code Taskbar} using the
+ * specified peer interface.
+ *
+ * @param target the taskbar to be implemented
+ * @return this toolkit's implementation of the {@code Taskbar}
+ * @throws HeadlessException if GraphicsEnvironment.isHeadless() returns
+ * true
+ * @see java.awt.GraphicsEnvironment#isHeadless
+ * @see java.awt.Taskbar
+ * @see java.awt.peer.TaskbarPeer
+ * @since 1.9
+ */
+ default TaskbarPeer createTaskbarPeer(Taskbar target) {
+ throw new HeadlessException();
+ }
/**
* Creates this toolkit's implementation of {@code Button} using the
--- old/src/java.desktop/share/classes/sun/awt/HToolkit.java 2015-11-19 18:20:30.569554071 +0300
+++ new/src/java.desktop/share/classes/sun/awt/HToolkit.java 2015-11-19 18:20:30.445554068 +0300
@@ -281,10 +281,16 @@
return false;
}
+
@Override
public boolean isDesktopSupported() {
return false;
}
+
+ @Override
+ public boolean isTaskbarSupported() {
+ return false;
+ }
public boolean isWindowOpacityControlSupported() {
return false;
--- old/src/java.desktop/share/classes/sun/awt/SunToolkit.java 2015-11-19 18:20:30.989554082 +0300
+++ new/src/java.desktop/share/classes/sun/awt/SunToolkit.java 2015-11-19 18:20:30.865554079 +0300
@@ -1792,6 +1792,7 @@
public abstract boolean isDesktopSupported();
+ public abstract boolean isTaskbarSupported();
/*
* consumeNextKeyTyped() method is not currently used,
--- old/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java 2015-11-19 18:20:31.445554093 +0300
+++ new/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java 2015-11-19 18:20:31.309554090 +0300
@@ -2567,6 +2567,16 @@
}
@Override
+ public boolean isTaskbarSupported(){
+ return XTaskbarPeer.isTaskbarSupported();
+ }
+
+ @Override
+ public TaskbarPeer createTaskbarPeer(Taskbar target){
+ return new XTaskbarPeer();
+ }
+
+ @Override
public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
return areExtraMouseButtonsEnabled;
}
--- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c 2015-11-19 18:20:31.897554105 +0300
+++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c 2015-11-19 18:20:31.765554102 +0300
@@ -831,6 +831,10 @@
fp_gtk_separator_tool_item_new =
dl_symbol("gtk_vseparator_new");
}
+
+ fp_g_list_append = dl_symbol("g_list_append");
+ fp_g_list_free = dl_symbol("g_list_free");
+ fp_g_list_free_full = dl_symbol("g_list_free_full");
}
/* Now we have only one kind of exceptions: NO_SYMBOL_EXCEPTION
* Otherwise we can check the return value of setjmp method.
--- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2015-11-19 18:20:32.357554117 +0300
+++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2015-11-19 18:20:32.237554114 +0300
@@ -289,6 +289,15 @@
GSList *next;
};
+typedef struct _GList GList;
+
+struct _GList
+{
+ gpointer data;
+ GList *next;
+ GList *prev;
+};
+
typedef void GdkColormap;
typedef void GdkDrawable;
typedef void GdkGC;
@@ -841,6 +850,11 @@
gchar* (*fp_g_path_get_dirname) (const gchar *file_name);
XID (*fp_gdk_x11_drawable_get_xid) (GdkWindow *drawable);
+
+GList* (*fp_g_list_append) (GList *list, gpointer data);
+void (*fp_g_list_free) (GList *list);
+void (*fp_g_list_free_full) (GList *list, GDestroyNotify free_func);
+
/**
* This function is available for GLIB > 2.20, so it MUST be
* called within GLIB_CHECK_VERSION(2, 20, 0) check.
--- old/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java 2015-11-19 18:20:32.785554128 +0300
+++ new/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java 2015-11-19 18:20:32.657554124 +0300
@@ -26,11 +26,18 @@
package sun.awt.windows;
+import java.awt.AppEvent;
import java.awt.Desktop.Action;
+import java.awt.EventQueue;
+import java.awt.desktop.SystemEventListener;
+import java.awt.desktop.SystemSleepListener;
+import java.awt.desktop.UserSessionListener;
import java.awt.peer.DesktopPeer;
import java.io.File;
import java.io.IOException;
import java.net.URI;
+import javax.swing.event.EventListenerList;
+import sun.awt.OSInfo;
/**
@@ -44,11 +51,32 @@
private static String ACTION_OPEN_VERB = "open";
private static String ACTION_EDIT_VERB = "edit";
private static String ACTION_PRINT_VERB = "print";
-
+
+ private static boolean isEventUserSessionSupported = false;
+
+ private static native void init();
+
+ WDesktopPeer() {
+ init();
+ isEventUserSessionSupported = OSInfo.getWindowsVersion()
+ .compareTo(OSInfo.WINDOWS_VISTA) >= 0;
+ }
+
@Override
public boolean isSupported(Action action) {
- // OPEN, EDIT, PRINT, MAIL, BROWSE all supported on windows.
- return true;
+ switch(action) {
+ case OPEN:
+ case EDIT:
+ case PRINT:
+ case MAIL:
+ case BROWSE:
+ case APP_EVENT_SYSTEM_SLEEP:
+ return true;
+ case APP_EVENT_USER_SESSION:
+ return isEventUserSessionSupported;
+ default:
+ return false;
+ }
}
@Override
@@ -93,5 +121,52 @@
}
private static native String ShellExecute(String fileOrUri, String verb);
-
+
+ private static final EventListenerList listenerList = new EventListenerList();
+
+ @Override
+ public void addAppEventListener(final SystemEventListener listener) {
+ if (listener instanceof UserSessionListener) {
+ listenerList.add(UserSessionListener.class, (UserSessionListener) listener);
+ }
+ if (listener instanceof SystemSleepListener) {
+ listenerList.add(SystemSleepListener.class, (SystemSleepListener) listener);
+ }
+ }
+
+ @Override
+ public void removeAppEventListener(final SystemEventListener listener) {
+ if (listener instanceof UserSessionListener) {
+ listenerList.remove(UserSessionListener.class, (UserSessionListener) listener);
+ }
+ if (listener instanceof SystemSleepListener) {
+ listenerList.remove(SystemSleepListener.class, (SystemSleepListener) listener);
+ }
+ }
+
+ private static void userSessionCallback(boolean activated) {
+ UserSessionListener[] listeners = listenerList.getListeners(UserSessionListener.class);
+ for (UserSessionListener use : listeners) {
+ EventQueue.invokeLater(() -> {
+ if (activated) {
+ use.userSessionActivated(new AppEvent.UserSessionEvent());
+ } else {
+ use.userSessionDeactivated(new AppEvent.UserSessionEvent());
+ }
+ });
+ }
+ }
+
+ private static void systemSleepCallback(boolean resumed) {
+ SystemSleepListener[] listeners = listenerList.getListeners(SystemSleepListener.class);
+ for (SystemSleepListener ssl : listeners) {
+ EventQueue.invokeLater(() -> {
+ if (resumed) {
+ ssl.systemAwoke(new AppEvent.SystemSleepEvent());
+ } else {
+ ssl.systemAboutToSleep(new AppEvent.SystemSleepEvent());
+ }
+ });
+ }
+ }
}
--- old/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java 2015-11-19 18:20:33.233554139 +0300
+++ new/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java 2015-11-19 18:20:33.073554135 +0300
@@ -1110,16 +1110,27 @@
@Override
public native boolean syncNativeQueue(final long timeout);
+
@Override
public boolean isDesktopSupported() {
return true;
}
-
+
@Override
public DesktopPeer createDesktopPeer(Desktop target) {
return new WDesktopPeer();
}
+ @Override
+ public boolean isTaskbarSupported() {
+ return WTaskbarPeer.isTaskbarSupported();
+ }
+
+ @Override
+ public TaskbarPeer createTaskbarPeer(Taskbar target) {
+ return new WTaskbarPeer();
+ }
+
private static native void setExtraMouseButtonsEnabledNative(boolean enable);
@Override
--- old/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp 2015-11-19 18:20:33.689554151 +0300
+++ new/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp 2015-11-19 18:20:33.561554148 +0300
@@ -28,6 +28,13 @@
#include Taskbar
instance of the current
+ * browser context. On some platforms the Taskbar API may not be
+ * supported; use the {@link #isTaskbarSupported} method to
+ * determine if the current taskbar is supported.
+ * @return the Taskbar instance of the current browser context
+ * @throws HeadlessException if {@link
+ * GraphicsEnvironment#isHeadless()} returns {@code true}
+ * @throws UnsupportedOperationException if this class is not
+ * supported on the current platform
+ * @see #isTaskbarSupported()
+ * @see java.awt.GraphicsEnvironment#isHeadless
+ */
+ public static synchronized Taskbar getTaskbar(){
+ if (GraphicsEnvironment.isHeadless()) throw new HeadlessException();
+
+ if (!Taskbar.isTaskbarSupported()) {
+ throw new UnsupportedOperationException("Taskbar API is not " +
+ "supported on the current platform");
+ }
+
+ sun.awt.AppContext context = sun.awt.AppContext.getAppContext();
+ Taskbar taskbar = (Taskbar)context.get(Taskbar.class);
+
+ if (taskbar == null) {
+ taskbar = new Taskbar();
+ context.put(Taskbar.class, taskbar);
+ }
+
+ return taskbar;
+ }
+
+ /**
+ * Tests whether this class is supported on the current platform.
+ * If it's supported, use {@link #getTaskbar()} to retrieve an
+ * instance.
+ *
+ * @return true
if this class is supported on the
+ * current platform; false
otherwise
+ * @see #getTaskbar()
+ */
+ public static boolean isTaskbarSupported(){
+ Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
+ if (defaultToolkit instanceof SunToolkit) {
+ return ((SunToolkit)defaultToolkit).isTaskbarSupported();
+ }
+ return false;
+ }
+
+ /**
+ * Requests user attention to this application.
+ *
+ * Depending on platform, this may be visually indicated by bouncing
+ * or flashing icon in task area. It may has no effect on an already active
+ * application.
+ *
+ * On some platforms(e.g. Mac OS) this effect may disappear upon app activation
+ * and cannot be dismissed by setting {@code enabled} to false.
+ * On other platforms may require additional call to
+ * {@link #requestUserAttention} to dismiss this request
+ * with {@code enabled} parameter set to false.
+ *
+ * @param enabled disables this request if false
+ * @param critical if this is an important request
+ */
+ public void requestUserAttention(final boolean enabled, final boolean critical) {
+ checkFeatureSupport(Feature.USER_ATTENTION);
+ peer.requestUserAttention(enabled, critical);
+ }
+
+ /**
+ * Requests user attention to the specified window until it is activated.
+ *
+ * On an already active window requesting attention does nothing.
+ *
+ * @param w window
+ */
+ public void requestWindowUserAttention(Window w) {
+ checkFeatureSupport(Feature.USER_ATTENTION_WINDOW);
+ peer.requestWindowUserAttention(w);
+ }
+
+ /**
+ * Attaches the contents of the provided PopupMenu to the application icon
+ * in system task area.
+ *
+ * @param menu the PopupMenu to attach to this application
+ */
+ public void setMenu(final PopupMenu menu) {
+ checkFeatureSupport(Feature.MENU);
+ peer.setMenu(menu);
+ }
+
+ /**
+ * Gets PopupMenu used to add items to this application's icon in system task area.
+ *
+ * @return the PopupMenu
+ */
+ public PopupMenu getMenu() {
+ checkFeatureSupport(Feature.MENU);
+ return peer.getMenu();
+ }
+
+ /**
+ * Changes this application's icon to the provided image.
+ *
+ * @param image to change
+ */
+ public void setIconImage(final Image image) {
+ checkFeatureSupport(Feature.ICON_IMAGE);
+ peer.setIconImage(image);
+ }
+
+ /**
+ * Obtains an image of this application's icon.
+ *
+ * @return an image of this application's icon
+ */
+ public Image getIconImage() {
+ checkFeatureSupport(Feature.ICON_IMAGE);
+ return peer.getIconImage();
+ }
+
+ /**
+ * Affixes a small system provided badge to this application's icon.
+ * Usually a number.
+ *
+ * Some platforms does not support string values and accepts only integer
+ * values. In this case pass an integer represented as string as a parameter.
+ * This can be tested by {@code Feature.ICON_BADGE_STRING} and
+ * {@code Feature.ICON_BADGE_NUMBER}.
+ *
+ * Passing {@code null} as parameter hides the badge.
+ * @param badge label to affix to the icon
+ */
+ public void setIconBadge(final String badge) {
+ checkFeatureSupport(Feature.ICON_BADGE_NUMBER);
+ peer.setIconBadge(badge);
+ }
+
+ /**
+ * Affixes a small badge to this application's icon in task area
+ * for the specified window.
+ * It may be disabled by system settings.
+ *
+ * @param w window to update
+ * @param badge image to affix to the icon
+ */
+ public void setWindowIconBadge(Window w, final Image badge) {
+ checkFeatureSupport(Feature.ICON_BADGE_IMAGE_WINDOW);
+ if (w != null) {
+ peer.setWindowIconBadge(w, badge);
+ }
+ }
+
+
+ /**
+ * Affixes a small system provided progress bar to this application's icon.
+ *
+ * @param value from 0 to 100, other to disable progress indication
+ */
+ public void setProgressValue(int value) {
+ checkFeatureSupport(Feature.PROGRESS_VALUE);
+ peer.setProgressValue(value);
+ }
+
+ /**
+ * Displays progress for specified window.
+ *
+ * @param w window to update
+ * @param value from 0 to 100, other to disable progress indication
+ */
+ public void setWindowProgressValue(Window w, int value) {
+ checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW);
+ if (w != null) {
+ peer.setWindowProgressValue(w, value);
+ }
+ }
+
+ /**
+ * Sets a progress state for a specified window.
+ *
+ * @param w window
+ * @param state to change to
+ * @see #STATE_OFF
+ * @see #STATE_NORMAL
+ * @see #STATE_PAUSED
+ * @see #STATE_INDETERMINATE
+ * @see #STATE_ERROR
+ */
+ public void setWindowProgressState(Window w, int state) {
+ checkFeatureSupport(Feature.PROGRESS_STATE_WINDOW);
+ if (state < STATE_OFF && state > STATE_ERROR) {
+ throw new IllegalArgumentException("Invalid state value");
+ }
+ if (w != null) {
+ peer.setWindowProgressState(w, state);
+ }
+ }
+
+ private native void initIDs();
+
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/TaskbarPeer.java 2015-11-19 18:20:37.233554242 +0300
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt;
+
+import java.awt.Taskbar.Feature;
+
+
+/**
+ * The {@code TaskbarPeer} interface provides methods for interacting with
+ * system task area.
+ */
+public interface TaskbarPeer {
+
+ /**
+ * Requests user attention to this application.
+ *
+ * @param enabled disables this request if false
+ * @param critical if this is an important request
+ * @see Taskbar#requestUserAttention
+ */
+ default void requestUserAttention(boolean enabled, final boolean critical) {}
+
+ /**
+ * Requests user attention to the specified window until it is activated.
+ *
+ * On an already active window requesting attention does nothing.
+ *
+ * @param w window
+ */
+ default void requestWindowUserAttention(Window w) {}
+
+ /**
+ * Attaches the contents of the provided PopupMenu to the application icon
+ * in system task area.
+ *
+ * @param menu the PopupMenu to attach to this application
+ */
+ default void setMenu(final PopupMenu menu) {}
+
+ /**
+ * Gets PopupMenu used to add items to this application's icon in system task area.
+ *
+ * @return the PopupMenu
+ */
+ default PopupMenu getMenu() { return null; }
+
+ /**
+ * Changes this application's icon to the provided image.
+ *
+ * @param image to change
+ */
+ default void setIconImage(final Image image) {}
+
+ /**
+ * Obtains an image of this application's icon.
+ *
+ * @return an image of this application's icon
+ */
+ default Image getIconImage() { return null; }
+
+ /**
+ * Affixes a small system provided badge to this application's icon.
+ * Usually a number.
+ *
+ * @param badge label to affix to the icon
+ */
+ default void setIconBadge(final String badge) {}
+
+ /**
+ * Affixes a small badge to this application's icon in task area
+ * for the specified window.
+ *
+ * @param w window to update
+ * @param badge image to affix to the icon
+ */
+ default void setWindowIconBadge(Window w, final Image badge) {}
+
+ /**
+ * Displays progress for specified window.
+ *
+ * @param w window to update
+ * @param value from 0 to 100, other to disable progress indication
+ */
+ default void setWindowProgressValue(Window w, int value) {}
+
+ /**
+ * Sets a progress state for a specified window.
+ *
+ * @param w window
+ * @param state to change to
+ * @see Taskbar#setWindowProgressState
+ */
+ default void setWindowProgressState(Window w, int state) {}
+
+ /**
+ * Affixes a small system provided progress bar to this application's icon.
+ *
+ * @param value from 0 to 100, other to disable progress indication
+ */
+ default void setProgressValue(int value) {}
+
+ /**
+ * Tests support of {@code Feature} on current platform.
+ * @param f feature to test
+ * @return true if feature supported supported
+ */
+ default public boolean isSupported(Feature f) { return false; }
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/AboutHandler.java 2015-11-19 18:20:37.749554255 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.AboutEvent;
+
+/**
+ * An implementer receives notification when the app is asked to show it's about dialog.
+ *
+ * @see java.awt.Desktop#setAboutHandler(java.awt.desktop.AboutHandler)
+ */
+public interface AboutHandler {
+ /**
+ * Called when the application is asked to show it's about dialog.
+ * @param e the request to show the about dialog.
+ */
+ public void handleAbout(final AboutEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/AppForegroundListener.java 2015-11-19 18:20:38.237554267 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.AppForegroundEvent;
+
+/**
+ * Implementors are notified when the app becomes the foreground app and when it resigns being the foreground app.
+ * This notification is useful for hiding and showing transient UI like palette windows which should be hidden when the app is in the background.
+ */
+public interface AppForegroundListener extends SystemEventListener {
+ /**
+ * Called when the app becomes the foreground app.
+ * @param e the app became foreground notification.
+ */
+ public void appRaisedToForeground(final AppForegroundEvent e);
+
+ /**
+ * Called when the app resigns to the background and another app becomes the foreground app.
+ * @param e the app resigned foreground notification.
+ */
+ public void appMovedToBackground(final AppForegroundEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/AppHiddenListener.java 2015-11-19 18:20:38.717554280 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.AppHiddenEvent;
+
+/**
+ * Implementors are notified when the app is hidden or shown by the user.
+ * This notification is helpful for discontinuing a costly animation if it's not visible to the user.
+ */
+public interface AppHiddenListener extends SystemEventListener {
+ /**
+ * Called the app is hidden.
+ * @param e event
+ */
+ public void appHidden(final AppHiddenEvent e);
+
+ /**
+ * Called when the hidden app is shown again (but not necessarily brought to the foreground).
+ * @param e event
+ */
+ public void appUnhidden(final AppHiddenEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/AppReopenedListener.java 2015-11-19 18:20:39.169554291 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.AppReopenedEvent;
+
+/**
+ * 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.
+ */
+public interface AppReopenedListener extends SystemEventListener {
+ /**
+ * Called when the app has been re-opened
+ * @param e the request to re-open the app
+ */
+ public void appReopened(final AppReopenedEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/FileManager.java 2015-11-19 18:20:39.657554304 +0300
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.awt.desktop;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * Provides functionality to query and modify Mac-specific file attributes. The methods in this class are based on Finder
+ * attributes. These attributes in turn are dependent on HFS and HFS+ file systems. As such, it is important to recognize
+ * their limitation when writing code that must function well across multiple platforms.type
and creator
codes to
+ * identify and handle files. These codes are unique 4-byte identifiers. The file type
is a string that describes the
+ * contents of a file. For example, the file type APPL
identifies the file as an application and therefore
+ * executable. A file type of TEXT
means that the file contains raw text. Any application that can read raw
+ * text can open a file of type TEXT
. Applications that use proprietary file types might assign their files a proprietary
+ * file type
code.
+ * creator
. For example, if a user
+ * double-clicks on a document with the ttxt
creator
, it opens up in Text Edit, the application registered
+ * with the ttxt
creator
code. Note that the creator
+ * code can be set to any application, not necessarily the application that created it. For example, if you
+ * use an editor to create an HTML document, you might want to assign a browser's creator
code for the file rather than
+ * the HTML editor's creator
code. Double-clicking on the document then opens the appropriate browser rather than the
+ *HTML editor.
+ *type
and creator
codes for a file
+ * or folder.
+ *
+ * @param filename file name
+ * @param type of a file
+ * @param creator for a file
+ * @throws java.io.IOException if an I/O exception occurs
+ */
+ public abstract void setFileTypeAndCreator(String filename, int type, int creator) throws IOException;
+
+ /**
+ * Sets the file type
code for a file or folder.
+ *
+ * @param filename file name
+ * @param type of a file
+ * @throws java.io.IOException if an I/O exception occurs
+ */
+ public abstract void setFileType(String filename, int type) throws IOException;
+
+ /**
+ * Sets the file creator
code for a file or folder.
+ *
+ * @param filename file name
+ * @param creator for a file
+ * @throws java.io.IOException if an I/O exception occurs
+ */
+ public abstract void setFileCreator(String filename, int creator) throws IOException;
+
+ /**
+ * Obtains the file type
code for a file or folder.
+ *
+ * @param filename file name
+ * @return file or folder type
+ * @throws java.io.IOException if an I/O exception occurs
+ */
+ public abstract int getFileType(String filename) throws IOException;
+
+ /**
+ * Obtains the file creator
code for a file or folder.
+ *
+ * @param filename file name
+ * @return creator for a file or folder
+ * @throws java.io.IOException if an I/O exception occurs
+ */
+ public abstract int getFileCreator(String filename) throws IOException;
+
+ /**
+ * Locates a folder of a particular type. Mac OS X recognizes certain
+ * specific folders that have distinct purposes. For example, the user's
+ * desktop or temporary folder. These folders have corresponding codes.
+ * Given one of these codes, this method returns the path to that particular
+ * folder. Certain folders of a given type may appear in more than one
+ * domain. For example, although there is only one root
folder,
+ * there are multiple pref
folders. If this method is called to
+ * find the pref
folder, it will return the first one it finds,
+ * the user's preferences folder in ~/Library/Preferences
. To
+ * explicitly locate a folder in a certain domain use
+ * findFolder(short domain, int folderType)
or findFolder(short domain, int folderType,
+ * boolean createIfNeeded)
.
+ *
+ * @param folderType folder type
+ * @return the path to the folder searched for
+ * @throws java.io.FileNotFoundException if the folder does not exist
+ */
+ public abstract String findFolder(int folderType) throws FileNotFoundException;
+
+ /**
+ * Locates a folder of a particular type, within a given domain. Similar to
+ * findFolder(int folderType)
except that the domain to look in
+ * can be specified. Valid values for domain
include:
+ *
+ *
+ *
+ * @param domain domain
+ * @param folderType folder type
+ * @return the path to the folder searched for
+ * @throws java.io.FileNotFoundException if the folder does not exist
+ */
+ public abstract String findFolder(short domain, int folderType) throws FileNotFoundException;
+
+ /**
+ * Locates a folder of a particular type within a given domain and
+ * optionally creating the folder if it does not exist. The behavior is
+ * similar to findFolder(int folderType)
and
+ * findFolder(short domain, int folderType)
except that it can
+ * create the folder if it does not already exist.
+ *
+ * @param domain domain
+ * @param folderType folder type
+ * @param createIfNeeded set to true
, by setting to
+ * false
the behavior will be the same as
+ * findFolder(short domain, int folderType, boolean createIfNeeded)
+ * @return the path to the folder searched for
+ * @throws java.io.FileNotFoundException if the folder does not exist
+ */
+ public abstract String findFolder(short domain, int folderType,
+ boolean createIfNeeded) throws FileNotFoundException;
+
+
+ /**
+ * Returns full pathname for the resource identified by a given name.
+ *
+ * @param resourceName resource name
+ * @return full pathname
+ * @throws java.io.FileNotFoundException if the resource does not exist
+ */
+ public abstract String getResource(String resourceName) throws FileNotFoundException;
+
+ /**
+ * Returns full pathname for the resource identified by a given name and
+ * located in the specified bundle subdirectory.
+ *
+ * @param resourceName resource name
+ * @param subDirName subdirectory name
+ * @return full pathname
+ * @throws java.io.FileNotFoundException if the resource does not exist
+ */
+ public abstract String getResource(String resourceName, String subDirName)
+ throws FileNotFoundException;
+
+ /**
+ * Returns the full pathname for the resource identified by the given name
+ * and file extension and located in the specified bundle subdirectory.
+ *
+ * If extension is an empty string or null, the returned pathname is the
+ * first one encountered where the file name exactly matches name.
+ *
+ * If subpath is null, this method searches the top-level nonlocalized
+ * resource directory (typically Resources) and the top-level of any
+ * language-specific directories. For example, suppose you have a modern
+ * bundle and specify "Documentation" for the subpath parameter. This method
+ * would first look in the Contents/Resources/Documentation directory of the
+ * bundle, followed by the Documentation subdirectories of each
+ * language-specific .lproj directory. (The search order for the
+ * language-specific directories corresponds to the user's preferences.)
+ * This method does not recurse through any other subdirectories at any of
+ * these locations. For more details see the AppKit NSBundle documentation.
+ *
+ * @param resourceName the name of the resource file
+ * @param subDirName subdirectory
+ * @param type type
+ * @return full pathname for the resource identified by the given name and
+ * file extension and located in the specified bundle subdirectory.
+ * @throws java.io.FileNotFoundException if the resource does not exist
+ */
+ public abstract String getResource(String resourceName, String subDirName,
+ String type) throws FileNotFoundException;
+
+ /**
+ * Obtains the path to the current application's NSBundle, may not return a
+ * valid path if Java was launched from the command line.
+ *
+ * @return full pathname of the NSBundle of the current application
+ * executable.
+ */
+ public abstract String getPathToApplicationBundle();
+
+ /**
+ * Moves the specified file to the Trash
+ *
+ * @param file the file
+ * @return returns true if the NSFileManager successfully moved the file to
+ * the Trash.
+ * @throws FileNotFoundException if the file does not exist
+ */
+ public abstract boolean moveToTrash(final File file) throws FileNotFoundException;
+
+ /**
+ * Reveals the specified file in the Finder
+ *
+ * @param file the file to reveal
+ * @return returns true if the NSFileManager successfully revealed the file
+ * in the Finder.
+ * @throws FileNotFoundException if the file does not exist
+ */
+ public abstract boolean revealInFinder(final File file) throws FileNotFoundException;
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/FullScreenListener.java 2015-11-19 18:20:40.165554317 +0300
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.awt.desktop;
+
+import java.util.EventListener;
+
+import java.awt.AppEvent.FullScreenEvent;
+
+/**
+ * An implementor is notified when a window is entering/exiting or
+ * has entered/exited full screen state.
+ */
+public interface FullScreenListener extends EventListener {
+
+ /**
+ * Invoked when a window has started to enter full screen.
+ *
+ * @param e containing the specific window entering full screen.
+ */
+ default public void windowEnteringFullScreen(final FullScreenEvent e) {}
+
+ /**
+ * Invoked when a window has fully entered full screen.
+ *
+ * @param e containing the specific window which has entered full screen.
+ */
+ default public void windowEnteredFullScreen(final FullScreenEvent e) {}
+
+ /**
+ * Invoked when a window has started to exit full screen.
+ *
+ * @param e containing the specific window exiting full screen.
+ */
+ default public void windowExitingFullScreen(final FullScreenEvent e) {}
+
+ /**
+ * Invoked when a window has fully exited full screen.
+ *
+ * @param e containing the specific window which has exited full screen.
+ */
+ default public void windowExitedFullScreen(final FullScreenEvent e) {}
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/OpenFilesHandler.java 2015-11-19 18:20:40.717554331 +0300
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.OpenFilesEvent;
+
+/**
+ * An implementor is notified when the application is asked to open a list of files.
+ * This message is only sent if the application has registered that it handles CFBundleDocumentTypes in it's Info.plist.
+ *
+ * @see java.awt.Desktop#setOpenFileHandler(java.awt.desktop.OpenFilesHandler)
+ */
+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.
+ */
+ public void openFiles(final OpenFilesEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/OpenURIHandler.java 2015-11-19 18:20:41.209554343 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.OpenURIEvent;
+
+/**
+ * An implementor is notified when the application is asked to open a URI.
+ *
+ * @see java.awt.Desktop#setOpenURIHandler(java.awt.desktop.OpenURIHandler)
+ */
+public interface OpenURIHandler {
+ /**
+ * Called when the application is asked to open a URI
+ * @param e the request to open a URI
+ */
+ public void openURI(final OpenURIEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/PreferencesHandler.java 2015-11-19 18:20:41.693554356 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.PreferencesEvent;
+
+/**
+ * An implementor is notified when the app is asked to show it's preferences UI.
+ *
+ * @see java.awt.Desktop#setPreferencesHandler(java.awt.desktop.PreferencesHandler)
+ */
+public interface PreferencesHandler {
+ /**
+ * Called when the app is asked to show it's preferences UI.
+ * @param e the request to show preferences.
+ */
+ public void handlePreferences(final PreferencesEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/PrintFilesHandler.java 2015-11-19 18:20:42.169554368 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.PrintFilesEvent;
+
+/**
+ * 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)
+ */
+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.
+ */
+ public void printFiles(final PrintFilesEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/QuitHandler.java 2015-11-19 18:20:42.661554381 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.QuitEvent;
+
+/**
+ * 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)
+ */
+public interface QuitHandler {
+ /**
+ * Invoked when the application is asked to quit.
+ *
+ * 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.
+ */
+ public void handleQuitRequestWith(final QuitEvent e, final QuitResponse response);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/QuitResponse.java 2015-11-19 18:20:43.177554394 +0300
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+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)
+ */
+public interface QuitResponse {
+
+ /**
+ * Notifies the external quit requester that the quit will proceed, and performs the default {@link java.awt.desktop.QuitStrategy}.
+ */
+ public void performQuit();
+
+ /**
+ * Notifies the external quit requester that the user has explicitly canceled the pending quit, and leaves the application running.
+ * Note: this will cancel a pending log-out, restart, or shutdown.
+ */
+ public void cancelQuit();
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/QuitStrategy.java 2015-11-19 18:20:43.665554406 +0300
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+/**
+ * The strategy use 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#enableSuddenTermination()
+ * @see java.awt.Desktop#disableSuddenTermination()
+ *
+ */
+public enum QuitStrategy {
+ /**
+ * Shuts down the application by calling System.exit(0)
. This is the default strategy.
+ */
+ SYSTEM_EXIT_0,
+
+ /**
+ * Shuts down the application by closing each window from back-to-front.
+ */
+ CLOSE_ALL_WINDOWS
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepListener.java 2015-11-19 18:20:44.221554421 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.ScreenSleepEvent;
+
+/**
+ * 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.
+ *
+ */
+public interface ScreenSleepListener extends SystemEventListener {
+
+ /**
+ * Called when the system displays have entered power save sleep.
+ * @param e the screen sleep event
+ */
+ public void screenAboutToSleep(final ScreenSleepEvent e);
+
+ /**
+ * Called when the system displays have awoke from power save sleep.
+ * @param e the screen sleep event
+ */
+ public void screenAwoke(final ScreenSleepEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/SystemEventListener.java 2015-11-19 18:20:44.797554435 +0300
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+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
+ * {@link java.awt.Desktop#addAppEventListener(SystemEventListener)} once to
+ * receive all notifications.
+ *
+ */
+public interface SystemEventListener extends EventListener{}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/SystemSleepListener.java 2015-11-19 18:20:45.281554448 +0300
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.SystemSleepEvent;
+
+/**
+ * Implementors receive notification as the system is entering sleep, and after the system wakes.
+ *
+ * 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.
+ */
+public interface SystemSleepListener extends SystemEventListener {
+ /**
+ * Called when the system is about to sleep.
+ * Note: This message may not be delivered prior to the actual system sleep, and may be processed after the corresponding wake has occurred.
+ * @param e the system sleep event
+ */
+ public void systemAboutToSleep(final SystemSleepEvent e);
+
+ /**
+ * Called after the system has awoke from sleeping.
+ * @param e the system sleep event
+ */
+ public void systemAwoke(final SystemSleepEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/share/classes/java/awt/desktop/UserSessionListener.java 2015-11-19 18:20:45.765554460 +0300
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.awt.desktop;
+
+import java.awt.AppEvent.UserSessionEvent;
+
+/**
+ * Implementors receive notification when Fast User Switching changes the user session.
+ *
+ * This notification is useful for discontinuing a costly animation, or indicating that the user is no longer present on a network service.
+ *
+ */
+public interface UserSessionListener extends SystemEventListener {
+ /**
+ * Called when the user session has been switched away.
+ * @param e the user session switch event
+ */
+ public void userSessionDeactivated(final UserSessionEvent e);
+
+ /**
+ * Called when the user session has been switched to.
+ * @param e the user session switch event
+ */
+ public void userSessionActivated(final UserSessionEvent e);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java 2015-11-19 18:20:46.329554475 +0300
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.awt.X11;
+
+import java.awt.MenuItem;
+import java.awt.PopupMenu;
+import java.awt.Taskbar.Feature;
+import java.awt.TaskbarPeer;
+import java.awt.event.ActionEvent;
+import sun.misc.ManagedLocalsThread;
+import java.security.AccessController;
+import sun.security.action.GetPropertyAction;
+
+final class XTaskbarPeer implements TaskbarPeer {
+
+ private static boolean nativeLibraryLoaded = false;
+ private static boolean initExecuted = false;
+
+ private PopupMenu menu = null;
+
+ private static void initWithLock() {
+ XToolkit.awtLock();
+ try {
+ if (!initExecuted) {
+ String dname = AccessController.doPrivileged(
+ new GetPropertyAction("java.desktop.appName", ""));
+ nativeLibraryLoaded = init(dname);
+ if (nativeLibraryLoaded) {
+ ManagedLocalsThread t
+ = new ManagedLocalsThread(() -> {
+ runloop();
+ });
+ t.setDaemon(true);
+ t.start();
+ }
+ }
+ } finally {
+ initExecuted = true;
+ XToolkit.awtUnlock();
+ }
+ }
+
+ XTaskbarPeer() {
+ initWithLock();
+ }
+
+ static boolean isTaskbarSupported() {
+ initWithLock();
+ return nativeLibraryLoaded;
+ }
+
+ @Override
+ public boolean isSupported(Feature feature) {
+ switch (feature) {
+ case ICON_BADGE_NUMBER:
+ case MENU:
+ case PROGRESS_VALUE:
+ case USER_ATTENTION:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ @Override
+ public void setProgressValue(int value) {
+ boolean visible
+ = value >= 0
+ && value <= 100;
+
+ double v = visible
+ ? (double) value / 100
+ : 0d;
+
+ updateProgress(v, visible);
+ }
+
+ @Override
+ public void setIconBadge(String badge) {
+ boolean visible = false;
+ long val = 0;
+ if (badge != null) {
+ try {
+ val = Long.parseLong(badge);
+ visible = true;
+ } catch (NumberFormatException e) {
+ }
+ }
+ setBadge(val, visible);
+ }
+
+ @Override
+ public PopupMenu getMenu() {
+ return menu;
+ }
+
+ @Override
+ public synchronized void setMenu(PopupMenu m) {
+ this.menu = m;
+
+ if (menu != null && menu.getItemCount() > 0) {
+ int msize = menu.getItemCount();
+ MenuItem[] items = new MenuItem[msize];
+ for (int i = 0; i < msize; i++) {
+ items[i] = menu.getItem(i);
+ }
+ setNativeMenu(items);
+ } else {
+ setNativeMenu(null);
+ }
+ }
+
+ @Override
+ public void requestUserAttention(boolean enabled, boolean critical) {
+ setUrgent(enabled);
+ }
+
+ private static void menuItemCallback(MenuItem mi) {
+ if (mi != null) {
+ ActionEvent ae = new ActionEvent(mi, ActionEvent.ACTION_PERFORMED,
+ mi.getActionCommand());
+ try {
+ XToolkit.awtLock();
+ XToolkit.postEvent(XToolkit.targetToAppContext(ae.getSource()), ae);
+ } finally {
+ XToolkit.awtUnlock();
+ }
+ }
+ }
+
+ private static native boolean init(String name);
+
+ private static native void runloop();
+
+ private native void setBadge(long value, boolean visible);
+
+ private native void updateProgress(double value, boolean visible);
+
+ private native void setUrgent(boolean urgent);
+
+ private native void setNativeMenu(MenuItem[] items);
+}
--- /dev/null 2015-11-09 12:41:48.570911013 +0300
+++ new/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c 2015-11-19 18:20:46.857554488 +0300
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include CFBundleURLTypes
entry.
- * See the Info.plist Key Reference for more information about adding a CFBundleURLTypes
key to your app's Info.plist.
- *
- * @see Application#setOpenURIHandler(OpenURIHandler)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface OpenURIHandler {
- /**
- * Called when the application is asked to open a URI
- * @param e the request to open a URI
- */
- public void openURI(final OpenURIEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/PreferencesHandler.java 2015-11-19 18:20:51.781554614 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.PreferencesEvent;
-
-/**
- * An implementor is notified when the app is asked to show it's preferences UI.
- *
- * @see Application#setPreferencesHandler(PreferencesHandler)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface PreferencesHandler {
- /**
- * Called when the app is asked to show it's preferences UI.
- * @param e the request to show preferences.
- */
- public void handlePreferences(final PreferencesEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/PrintFilesHandler.java 2015-11-19 18:20:52.077554622 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.PrintFilesEvent;
-
-/**
- * An implementor can respond to requests to print documents that the app has been registered to handle.
- *
- * @see Application#setPrintFileHandler(PrintFilesHandler)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-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.
- */
- public void printFiles(final PrintFilesEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/QuitHandler.java 2015-11-19 18:20:52.365554629 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.QuitEvent;
-
-/**
- * An implementor determines if requests to quit this application should proceed or cancel.
- *
- * @see Application#setQuitHandler(QuitHandler)
- * @see Application#setQuitStrategy(QuitStrategy)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface QuitHandler {
- /**
- * Invoked when the application is asked to quit.
- *
- * 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.
- */
- public void handleQuitRequestWith(final QuitEvent e, final QuitResponse response);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/QuitResponse.java 2015-11-19 18:20:52.641554636 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-/**
- * Used to respond to a request to quit the application.
- * The QuitResponse may be used after the {@link QuitHandler#handleQuitRequestWith(AppEvent.QuitEvent, QuitResponse)} method has returned, and may be used from any thread.
- *
- * @see Application#setQuitHandler(QuitHandler)
- * @see QuitHandler
- * @see Application#setQuitStrategy(QuitStrategy)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public class QuitResponse {
- final _AppEventHandler appEventHandler;
-
- QuitResponse(final _AppEventHandler appEventHandler) {
- this.appEventHandler = appEventHandler;
- }
-
- /**
- * Notifies the external quit requester that the quit will proceed, and performs the default {@link QuitStrategy}.
- */
- public void performQuit() {
- if (appEventHandler.currentQuitResponse != this) return;
- appEventHandler.performQuit();
- }
-
- /**
- * Notifies the external quit requester that the user has explicitly canceled the pending quit, and leaves the application running.
- * Note: this will cancel a pending log-out, restart, or shutdown.
- */
- public void cancelQuit() {
- if (appEventHandler.currentQuitResponse != this) return;
- appEventHandler.cancelQuit();
- }
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java 2015-11-19 18:20:52.929554644 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-/**
- * The strategy use to shut down the application, if Sudden Termination is not enabled.
- *
- * @see Application#setQuitHandler(QuitHandler)
- * @see Application#setQuitStrategy(QuitStrategy)
- * @see Application#enableSuddenTermination()
- * @see Application#disableSuddenTermination()
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public enum QuitStrategy {
- /**
- * Shuts down the application by calling System.exit(0)
. This is the default strategy.
- */
- SYSTEM_EXIT_0,
-
- /**
- * Shuts down the application by closing each window from back-to-front.
- */
- CLOSE_ALL_WINDOWS
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/ScreenSleepListener.java 2015-11-19 18:20:53.197554650 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.ScreenSleepEvent;
-
-/**
- * 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.
- *
- * This message is not sent on Mac OS X versions prior to 10.6.
- *
- * @see Application#addAppEventListener(AppEventListener)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface ScreenSleepListener extends AppEventListener {
- /**
- * Called when the system displays have entered power save sleep.
- * @param e the screen sleep event
- */
- public void screenAboutToSleep(final ScreenSleepEvent e);
-
- /**
- * Called when the system displays have awoke from power save sleep.
- * @param e the screen sleep event
- */
- public void screenAwoke(final ScreenSleepEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/SystemSleepListener.java 2015-11-19 18:20:53.469554657 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.SystemSleepEvent;
-
-/**
- * Implementors receive notification as the system is entering sleep, and after the system wakes.
- *
- * 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.
- *
- * @see Application#addAppEventListener(AppEventListener)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface SystemSleepListener extends AppEventListener {
- /**
- * Called when the system is about to sleep.
- * Note: This message may not be delivered prior to the actual system sleep, and may be processed after the corresponding wake has occurred.
- * @param e the system sleep event
- */
- public void systemAboutToSleep(final SystemSleepEvent e);
-
- /**
- * Called after the system has awoke from sleeping.
- * @param e the system sleep event
- */
- public void systemAwoke(final SystemSleepEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/UserSessionListener.java 2015-11-19 18:20:53.729554664 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import com.apple.eawt.AppEvent.UserSessionEvent;
-
-/**
- * Implementors receive notification when Fast User Switching changes the user session.
- *
- * This notification is useful for discontinuing a costly animation, or indicating that the user is no longer present on a network service.
- *
- * @see Application#addAppEventListener(AppEventListener)
- *
- * @since Java for Mac OS X 10.6 Update 3
- * @since Java for Mac OS X 10.5 Update 8
- */
-public interface UserSessionListener extends AppEventListener {
- /**
- * Called when the user session has been switched away.
- * @param e the user session switch event
- */
- public void userSessionDeactivated(final UserSessionEvent e);
-
- /**
- * Called when the user session has been switched to.
- * @param e the user session switch event
- */
- public void userSessionActivated(final UserSessionEvent e);
-}
--- old/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java 2015-11-19 18:20:53.985554671 +0300
+++ /dev/null 2015-11-09 12:41:48.570911013 +0300
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.apple.eawt;
-
-import java.awt.Toolkit;
-import java.io.File;
-import java.util.*;
-
-import com.apple.eawt.AppEvent.*;
-
-@SuppressWarnings("deprecation")
-class _AppEventLegacyHandler implements AboutHandler, PreferencesHandler, _OpenAppHandler, AppReOpenedListener, OpenFilesHandler, PrintFilesHandler, QuitHandler {
- final _AppEventHandler parent;
- final Vector