< prev index next >

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

Print this page




 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 progress for specified window.









 411      *
 412      * @param w window to update
 413      * @param value from 0 to 100, other to disable progress indication


 414      * @throws SecurityException if a security manager exists and it denies the
 415      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 416      * @throws UnsupportedOperationException if the current platform
 417      * does not support the {@link Taskbar.Feature#PROGRESS_VALUE_WINDOW} feature
 418      */
 419     public void setWindowProgressValue(Window w, int value) {
 420         checkEventsProcessingPermission();
 421         checkFeatureSupport(Feature.PROGRESS_VALUE_WINDOW);
 422         if (w != null) {
 423             peer.setWindowProgressValue(w, value);
 424         }
 425     }
 426 
 427     /**
 428      * Sets a progress state for a specified window.






 429      *
 430      * @param w window
 431      * @param state to change to
 432      * @see State#OFF
 433      * @see State#NORMAL
 434      * @see State#PAUSED
 435      * @see State#INDETERMINATE
 436      * @see State#ERROR


 437      * @throws SecurityException if a security manager exists and it denies the
 438      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 439      * @throws UnsupportedOperationException if the current platform
 440      * does not support the {@link Taskbar.Feature#PROGRESS_STATE_WINDOW} feature
 441      */
 442     public void setWindowProgressState(Window w, State state) {
 443         checkEventsProcessingPermission();
 444         checkFeatureSupport(Feature.PROGRESS_STATE_WINDOW);
 445         if (w != null) {
 446             peer.setWindowProgressState(w, state);
 447         }
 448     }
 449 }


 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 the behavior is undefined when multiple windows is grouped 
 419      * in the task area.
 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      */
 460     public void setWindowProgressState(Window w, State state) {
 461         checkEventsProcessingPermission();
 462         checkFeatureSupport(Feature.PROGRESS_STATE_WINDOW);
 463         if (w != null) {
 464             peer.setWindowProgressState(w, state);
 465         }
 466     }
 467 }
< prev index next >