< 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      * Has no effect if a window representation is not displayable in 
 278      * the task area. Whether it is displayable is dependent on all 
 279      * of window type, platform, and implementation.
 280      *
 281      * @param w window
 282      * @throws SecurityException if a security manager exists and it denies the
 283      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 284      * @throws UnsupportedOperationException if the current platform
 285      * does not support the {@link Taskbar.Feature#USER_ATTENTION_WINDOW} feature
 286      */
 287     public void requestWindowUserAttention(Window w) {
 288         checkEventsProcessingPermission();
 289         checkFeatureSupport(Feature.USER_ATTENTION_WINDOW);
 290         peer.requestWindowUserAttention(w);
 291     }
 292 
 293     /**
 294      * Attaches the contents of the provided PopupMenu to the application icon
 295      * in the task area.
 296      *
 297      * @param menu the PopupMenu to attach to this application
 298      * @throws SecurityException if a security manager exists and it denies the
 299      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 300      * @throws UnsupportedOperationException if the current platform


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