< prev index next >

src/java.desktop/share/classes/java/awt/Taskbar.java

Print this page




 257      * Other platforms may require an additional call
 258      * {@link #requestUserAttention} to dismiss this request
 259      * with {@code enabled} parameter set to false.
 260      *
 261      * @param enabled disables this request if false
 262      * @param critical if this is an important request
 263      * @throws SecurityException if a security manager exists and it denies the
 264      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 265      * @throws UnsupportedOperationException if the current platform
 266      * does not support the {@link Taskbar.Feature#USER_ATTENTION} feature
 267      */
 268     public void requestUserAttention(final boolean enabled, final boolean critical) {
 269         checkEventsProcessingPermission();
 270         checkFeatureSupport(Feature.USER_ATTENTION);
 271         peer.requestUserAttention(enabled, critical);
 272     }
 273 
 274     /**
 275      * Requests user attention to the specified window.
 276      *


 277      * @param w window
 278      * @throws SecurityException if a security manager exists and it denies the
 279      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 280      * @throws UnsupportedOperationException if the current platform
 281      * does not support the {@link Taskbar.Feature#USER_ATTENTION_WINDOW} feature
 282      */
 283     public void requestWindowUserAttention(Window w) {
 284         checkEventsProcessingPermission();
 285         checkFeatureSupport(Feature.USER_ATTENTION_WINDOW);
 286         peer.requestWindowUserAttention(w);
 287     }
 288 
 289     /**
 290      * Attaches the contents of the provided PopupMenu to the application icon
 291      * in the task area.
 292      *
 293      * @param menu the PopupMenu to attach to this application
 294      * @throws SecurityException if a security manager exists and it denies the
 295      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 296      * @throws UnsupportedOperationException if the current platform


 358      *
 359      * Passing {@code null} as parameter hides the badge.
 360      * @param badge label to affix to the icon
 361      * @throws SecurityException if a security manager exists and it denies the
 362      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 363      * @throws UnsupportedOperationException if the current platform
 364      * does not support the {@link Taskbar.Feature#ICON_BADGE_NUMBER}
 365      * or {@link Taskbar.Feature#ICON_BADGE_TEXT} feature
 366      */
 367     public void setIconBadge(final String badge) {
 368         checkEventsProcessingPermission();
 369         checkFeatureSupport(Feature.ICON_BADGE_NUMBER);
 370         peer.setIconBadge(badge);
 371     }
 372 
 373     /**
 374      * Affixes a small badge to this application's icon in the task area
 375      * for the specified window.
 376      * It may be disabled by system settings.
 377      *


 378      * @param w window to update
 379      * @param badge image to affix to the icon
 380      * @throws SecurityException if a security manager exists and it denies the
 381      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 382      * @throws UnsupportedOperationException if the current platform
 383      * does not support the {@link Taskbar.Feature#ICON_BADGE_IMAGE_WINDOW} feature
 384      */
 385     public void setWindowIconBadge(Window w, final Image badge) {
 386         checkEventsProcessingPermission();
 387         checkFeatureSupport(Feature.ICON_BADGE_IMAGE_WINDOW);
 388         if (w != null) {
 389             peer.setWindowIconBadge(w, badge);
 390         }
 391     }
 392 
 393 
 394     /**
 395      * Affixes a small system-provided progress bar to this application's icon.
 396      *
 397      * @param value from 0 to 100, other to disable progress indication
 398      * @throws SecurityException if a security manager exists and it denies the
 399      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 400      * @throws UnsupportedOperationException if the current platform
 401      * does not support the {@link Taskbar.Feature#PROGRESS_VALUE} feature
 402      */
 403     public void setProgressValue(int value) {
 404         checkEventsProcessingPermission();
 405         checkFeatureSupport(Feature.PROGRESS_VALUE);
 406         peer.setProgressValue(value);
 407     }
 408 
 409     /**
 410      * Displays a determinate progress bar in the task area for the specified
 411      * window.


 412      * <br>
 413      * The visual behavior is platform and {@link State} dependent.
 414      * <br>
 415      * This call cancels the {@link State#INDETERMINATE INDETERMINATE} state
 416      * of the window.
 417      * <br>
 418      * Note that when multiple windows is grouped in the task area
 419      * the behavior is platform specific.
 420      *
 421      * @param w window to update
 422      * @param value from 0 to 100, other to switch to {@link State#OFF} state
 423      *              and disable progress indication
 424      * @see #setWindowProgressState(java.awt.Window, State)
 425      * @throws SecurityException if a security manager exists and it denies the
 426      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 427      * @throws UnsupportedOperationException if the current platform
 428      * does not support the {@link Taskbar.Feature#PROGRESS_VALUE_WINDOW} feature
 429      */
 430     public void setWindowProgressValue(Window w, int value) {
 431         checkEventsProcessingPermission();
 432         checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW);
 433         if (w != null) {
 434             peer.setWindowProgressValue(w, value);
 435         }
 436     }
 437 
 438     /**
 439      * Sets a progress state for a specified window.


 440      * <br>
 441      * Each state displays a progress in a platform-dependent way.
 442      * <br>
 443      * Note than switching from {@link State#INDETERMINATE INDETERMINATE} state
 444      * to any of determinate states may reset value set by
 445      * {@link #setWindowProgressValue(java.awt.Window, int) setWindowProgressValue}
 446      *
 447      * @param w window
 448      * @param state to change to
 449      * @see State#OFF
 450      * @see State#NORMAL
 451      * @see State#PAUSED
 452      * @see State#ERROR
 453      * @see State#INDETERMINATE
 454      * @see #setWindowProgressValue(java.awt.Window, int)
 455      * @throws SecurityException if a security manager exists and it denies the
 456      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 457      * @throws UnsupportedOperationException if the current platform
 458      * does not support the {@link Taskbar.Feature#PROGRESS_STATE_WINDOW} feature
 459      */


 257      * Other platforms may require an additional call
 258      * {@link #requestUserAttention} to dismiss this request
 259      * with {@code enabled} parameter set to false.
 260      *
 261      * @param enabled disables this request if false
 262      * @param critical if this is an important request
 263      * @throws SecurityException if a security manager exists and it denies the
 264      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 265      * @throws UnsupportedOperationException if the current platform
 266      * does not support the {@link Taskbar.Feature#USER_ATTENTION} feature
 267      */
 268     public void requestUserAttention(final boolean enabled, final boolean critical) {
 269         checkEventsProcessingPermission();
 270         checkFeatureSupport(Feature.USER_ATTENTION);
 271         peer.requestUserAttention(enabled, critical);
 272     }
 273 
 274     /**
 275      * Requests user attention to the specified window.
 276      *
 277      * The specified window must be visible in the task area.
 278      *
 279      * @param w window
 280      * @throws SecurityException if a security manager exists and it denies the
 281      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 282      * @throws UnsupportedOperationException if the current platform
 283      * does not support the {@link Taskbar.Feature#USER_ATTENTION_WINDOW} feature
 284      */
 285     public void requestWindowUserAttention(Window w) {
 286         checkEventsProcessingPermission();
 287         checkFeatureSupport(Feature.USER_ATTENTION_WINDOW);
 288         peer.requestWindowUserAttention(w);
 289     }
 290 
 291     /**
 292      * Attaches the contents of the provided PopupMenu to the application icon
 293      * in the task area.
 294      *
 295      * @param menu the PopupMenu to attach to this application
 296      * @throws SecurityException if a security manager exists and it denies the
 297      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 298      * @throws UnsupportedOperationException if the current platform


 360      *
 361      * Passing {@code null} as parameter hides the badge.
 362      * @param badge label to affix to the icon
 363      * @throws SecurityException if a security manager exists and it denies the
 364      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 365      * @throws UnsupportedOperationException if the current platform
 366      * does not support the {@link Taskbar.Feature#ICON_BADGE_NUMBER}
 367      * or {@link Taskbar.Feature#ICON_BADGE_TEXT} feature
 368      */
 369     public void setIconBadge(final String badge) {
 370         checkEventsProcessingPermission();
 371         checkFeatureSupport(Feature.ICON_BADGE_NUMBER);
 372         peer.setIconBadge(badge);
 373     }
 374 
 375     /**
 376      * Affixes a small badge to this application's icon in the task area
 377      * for the specified window.
 378      * It may be disabled by system settings.
 379      *
 380      * The specified window must be visible in the task area.
 381      *
 382      * @param w window to update
 383      * @param badge image to affix to the icon
 384      * @throws SecurityException if a security manager exists and it denies the
 385      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 386      * @throws UnsupportedOperationException if the current platform
 387      * does not support the {@link Taskbar.Feature#ICON_BADGE_IMAGE_WINDOW} feature
 388      */
 389     public void setWindowIconBadge(Window w, final Image badge) {
 390         checkEventsProcessingPermission();
 391         checkFeatureSupport(Feature.ICON_BADGE_IMAGE_WINDOW);
 392         if (w != null) {
 393             peer.setWindowIconBadge(w, badge);
 394         }
 395     }
 396 
 397 
 398     /**
 399      * Affixes a small system-provided progress bar to this application's icon.
 400      *
 401      * @param value from 0 to 100, other to disable progress indication
 402      * @throws SecurityException if a security manager exists and it denies the
 403      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 404      * @throws UnsupportedOperationException if the current platform
 405      * does not support the {@link Taskbar.Feature#PROGRESS_VALUE} feature
 406      */
 407     public void setProgressValue(int value) {
 408         checkEventsProcessingPermission();
 409         checkFeatureSupport(Feature.PROGRESS_VALUE);
 410         peer.setProgressValue(value);
 411     }
 412 
 413     /**
 414      * Displays a determinate progress bar in the task area for the specified
 415      * window.
 416      *
 417      * The specified window must be visible in the task area.
 418      * <br>
 419      * The visual behavior is platform and {@link State} dependent.
 420      * <br>
 421      * This call cancels the {@link State#INDETERMINATE INDETERMINATE} state
 422      * of the window.
 423      * <br>
 424      * Note that when multiple windows is grouped in the task area
 425      * the behavior is platform specific.
 426      *
 427      * @param w window to update
 428      * @param value from 0 to 100, other to switch to {@link State#OFF} state
 429      *              and disable progress indication
 430      * @see #setWindowProgressState(java.awt.Window, State)
 431      * @throws SecurityException if a security manager exists and it denies the
 432      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 433      * @throws UnsupportedOperationException if the current platform
 434      * does not support the {@link Taskbar.Feature#PROGRESS_VALUE_WINDOW} feature
 435      */
 436     public void setWindowProgressValue(Window w, int value) {
 437         checkEventsProcessingPermission();
 438         checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW);
 439         if (w != null) {
 440             peer.setWindowProgressValue(w, value);
 441         }
 442     }
 443 
 444     /**
 445      * Sets a progress state for a specified window.
 446      *
 447      * The specified window must be visible in the task area.
 448      * <br>
 449      * Each state displays a progress in a platform-dependent way.
 450      * <br>
 451      * Note than switching from {@link State#INDETERMINATE INDETERMINATE} state
 452      * to any of determinate states may reset value set by
 453      * {@link #setWindowProgressValue(java.awt.Window, int) setWindowProgressValue}
 454      *
 455      * @param w window
 456      * @param state to change to
 457      * @see State#OFF
 458      * @see State#NORMAL
 459      * @see State#PAUSED
 460      * @see State#ERROR
 461      * @see State#INDETERMINATE
 462      * @see #setWindowProgressValue(java.awt.Window, int)
 463      * @throws SecurityException if a security manager exists and it denies the
 464      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 465      * @throws UnsupportedOperationException if the current platform
 466      * does not support the {@link Taskbar.Feature#PROGRESS_STATE_WINDOW} feature
 467      */
< prev index next >