--- old/src/java.desktop/share/classes/java/awt/Taskbar.java 2017-03-14 15:50:19.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/Taskbar.java 2017-03-14 15:50:19.000000000 +0300 @@ -91,7 +91,7 @@ /** * Represents a progress state feature for a specified window. - * @see #setWindowProgressState(java.awt.Window, State) + * @see #setWindowProgressState(java.awt.Frame, State) */ PROGRESS_STATE_WINDOW, @@ -103,7 +103,7 @@ /** * Represents a progress value feature for a specified window. - * @see #setWindowProgressValue(java.awt.Window, int) + * @see #setWindowProgressValue(java.awt.Frame, int) */ PROGRESS_VALUE_WINDOW, @@ -115,7 +115,7 @@ /** * Represents a user attention request feature for a specified window. - * @see #requestWindowUserAttention(java.awt.Window) + * @see #requestWindowUserAttention(java.awt.Frame) */ USER_ATTENTION_WINDOW } @@ -123,7 +123,7 @@ /** * Kinds of available window progress states. * - * @see #setWindowProgressState(java.awt.Window, java.awt.Taskbar.State) + * @see #setWindowProgressState(java.awt.Frame, java.awt.Taskbar.State) */ public static enum State { /** @@ -274,16 +274,18 @@ /** * Requests user attention to the specified window. * - * @param w window + * Has no effect if this window is not visible in the task area. + * + * @param f Frame * @throws SecurityException if a security manager exists and it denies the * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#USER_ATTENTION_WINDOW} feature */ - public void requestWindowUserAttention(Window w) { + public void requestWindowUserAttention(Frame f) { checkEventsProcessingPermission(); checkFeatureSupport(Feature.USER_ATTENTION_WINDOW); - peer.requestWindowUserAttention(w); + peer.requestWindowUserAttention(f); } /** @@ -375,18 +377,20 @@ * for the specified window. * It may be disabled by system settings. * - * @param w window to update + * Has no effect if this window is not visible in the task area. + * + * @param f frame to update * @param badge image to affix to the icon * @throws SecurityException if a security manager exists and it denies the * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#ICON_BADGE_IMAGE_WINDOW} feature */ - public void setWindowIconBadge(Window w, final Image badge) { + public void setWindowIconBadge(Frame f, final Image badge) { checkEventsProcessingPermission(); checkFeatureSupport(Feature.ICON_BADGE_IMAGE_WINDOW); - if (w != null) { - peer.setWindowIconBadge(w, badge); + if (f != null) { + peer.setWindowIconBadge(f, badge); } } @@ -409,6 +413,8 @@ /** * Displays a determinate progress bar in the task area for the specified * window. + * + * Has no effect if this window is not visible in the task area. *
* The visual behavior is platform and {@link State} dependent. *
@@ -418,25 +424,27 @@ * Note that when multiple windows is grouped in the task area * the behavior is platform specific. * - * @param w window to update + * @param f frame to update * @param value from 0 to 100, other to switch to {@link State#OFF} state * and disable progress indication - * @see #setWindowProgressState(java.awt.Window, State) + * @see #setWindowProgressState(java.awt.Frame, State) * @throws SecurityException if a security manager exists and it denies the * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#PROGRESS_VALUE_WINDOW} feature */ - public void setWindowProgressValue(Window w, int value) { + public void setWindowProgressValue(Frame f, int value) { checkEventsProcessingPermission(); checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW); - if (w != null) { - peer.setWindowProgressValue(w, value); + if (f != null) { + peer.setWindowProgressValue(f, value); } } /** * Sets a progress state for a specified window. + * + * Has no effect if this window is not visible in the task area. *
* Each state displays a progress in a platform-dependent way. *
@@ -444,24 +452,24 @@ * to any of determinate states may reset value set by * {@link #setWindowProgressValue(java.awt.Window, int) setWindowProgressValue} * - * @param w window + * @param f frame * @param state to change to * @see State#OFF * @see State#NORMAL * @see State#PAUSED * @see State#ERROR * @see State#INDETERMINATE - * @see #setWindowProgressValue(java.awt.Window, int) + * @see #setWindowProgressValue(java.awt.Frame, int) * @throws SecurityException if a security manager exists and it denies the * {@code RuntimePermission("canProcessApplicationEvents")} permission. * @throws UnsupportedOperationException if the current platform * does not support the {@link Taskbar.Feature#PROGRESS_STATE_WINDOW} feature */ - public void setWindowProgressState(Window w, State state) { + public void setWindowProgressState(Frame f, State state) { checkEventsProcessingPermission(); checkFeatureSupport(Feature.PROGRESS_STATE_WINDOW); - if (w != null) { - peer.setWindowProgressState(w, state); + if (f != null) { + peer.setWindowProgressState(f, state); } } } --- old/src/java.desktop/share/classes/java/awt/peer/TaskbarPeer.java 2017-03-14 15:50:20.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/peer/TaskbarPeer.java 2017-03-14 15:50:20.000000000 +0300 @@ -25,12 +25,12 @@ package java.awt.peer; +import java.awt.Frame; import java.awt.Image; import java.awt.PopupMenu; import java.awt.Taskbar; import java.awt.Taskbar.Feature; import java.awt.Taskbar.State; -import java.awt.Window; /** @@ -51,9 +51,9 @@ /** * Requests user attention to the specified window. * - * @param w window + * @param f frame */ - default void requestWindowUserAttention(Window w) {} + default void requestWindowUserAttention(Frame w) {} /** * Attaches the contents of the provided PopupMenu to the application icon @@ -96,27 +96,27 @@ * Affixes a small badge to this application's icon in task area * for the specified window. * - * @param w window to update + * @param f frame to update * @param badge image to affix to the icon */ - default void setWindowIconBadge(Window w, final Image badge) {} + default void setWindowIconBadge(Frame f, final Image badge) {} /** * Displays progress for specified window. * - * @param w window to update + * @param f frame to update * @param value from 0 to 100, other to disable progress indication */ - default void setWindowProgressValue(Window w, int value) {} + default void setWindowProgressValue(Frame f, int value) {} /** * Sets a progress state for a specified window. * - * @param w window + * @param f frame * @param state to change to * @see Taskbar#setWindowProgressState */ - default void setWindowProgressState(Window w, State state) {} + default void setWindowProgressState(Frame f, State state) {} /** * Affixes a small system-provided progress bar to this application's icon. --- old/src/java.desktop/windows/classes/sun/awt/windows/WTaskbarPeer.java 2017-03-14 15:50:21.000000000 +0300 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WTaskbarPeer.java 2017-03-14 15:50:20.000000000 +0300 @@ -25,12 +25,12 @@ package sun.awt.windows; import java.awt.AlphaComposite; +import java.awt.Frame; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Taskbar.Feature; import java.awt.Taskbar.State; import java.awt.peer.TaskbarPeer; -import java.awt.Window; import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; import sun.awt.AWTAccessor; @@ -96,8 +96,8 @@ } @Override - public void setWindowIconBadge(Window window, final Image image) { - WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window); + public void setWindowIconBadge(Frame frame, final Image image) { + WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(frame); if (wp != null) { int[] buffer = imageToArray(image); ShellFolder.invoke(() -> { @@ -110,16 +110,16 @@ } @Override - public void requestWindowUserAttention(Window window) { - WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window); + public void requestWindowUserAttention(Frame frame) { + WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(frame); if (wp != null) { flashWindow(wp.getHWnd()); } } @Override - public void setWindowProgressValue(Window window, int value) { - WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window); + public void setWindowProgressValue(Frame frame, int value) { + WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(frame); if (wp != null) { ShellFolder.invoke(() -> { setProgressValue(wp.getHWnd(), value); @@ -129,8 +129,8 @@ } @Override - public void setWindowProgressState(Window window, State state) { - WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window); + public void setWindowProgressState(Frame frame, State state) { + WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(frame); if (wp != null) { ShellFolder.invoke(() -> { setProgressState(wp.getHWnd(), state);