org.eclipse.ercp.swt.mobile
Class TaskTip

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.ercp.swt.mobile.TaskTip

public class TaskTip
extends Widget

This class provides feedback to the user about the state of a long-running task.

A TaskTip may contain text and an optional progress bar or another object to illustrate current task state. Like a MessageBox, the look and feel of TaskTip is platform-dependent, which means that there is no API level access to the UI components inside a TaskTip. Unlike a MessageBox, the TaskTip is a non-focusable window and will not change the current window's activation or focus.

When constructed without a style constant, a TaskTip displays plain text to indicate task progress.

A TaskTip becomes visible by calling setVisible(true) and remains visible until the application calls setVisible(false). When a new TaskTip is created before hiding or disposing of a prior TaskTip, the newest becomes the top-most one and obscures the prior ones, if any.

A TaskTip can not be positioned programmatically or by the user. The position is implementation-dependent.

Styles:
SMOOTH: displays a visual indicator of what portion of the progress is left to go
INDETERMINATE: displays a visual indicator that a long-running process is progressing
Events:
(none)

Note: The methods setMaximum, setMinimum, and setSelection, are silently ignored if the style is not SWT.SMOOTH.

See Also:
SWT.SMOOTH,

IMPORTANT: This class is not intended to be subclassed.


Constructor Summary
TaskTip(Shell shell)
          Constructs a TaskTip with plain text style.
TaskTip(Shell shell, int style)
          Constructs a TaskTip with a given style value.
 
Method Summary
 void setMaximum(int value)
          Sets the maximum value that the TaskTip will allow.
 void setMinimum(int value)
          Sets the minimum value that the TaskTip will allow.
 void setSelection(int value)
          Sets the position of the TaskTip's indicator to the provided value.
 void setText(java.lang.String string)
          Sets the label text.
 void setVisible(boolean visible)
          Makes the TaskTip visible and brings it to the front of the display.
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TaskTip

public TaskTip(Shell shell)
Constructs a TaskTip with plain text style. The default style displays plain text to indicate progress. The TaskTip is disposed if the parent Shell is disposed.

Parameters:
shell - The Shell the TaskTip is associated with
Throws:
java.lang.IllegalArgumentException -
SWTException -

TaskTip

public TaskTip(Shell shell,
               int style)
Constructs a TaskTip with a given style value. The TaskTip is disposed if the parent Shell is disposed.

Parameters:
shell - The Shell the TaskTip is associated with
style - style of TaskTip: NONE, SMOOTH or INDETERMINATE.
Throws:
java.lang.IllegalArgumentException -
SWTException -
See Also:
SWT.SMOOTH, SWT.INDETERMINATE
Method Detail

setMaximum

public void setMaximum(int value)
Sets the maximum value that the TaskTip will allow. If the new maximum is applied, the TaskTip's selection value is adjusted if necessary to fall within the new range. If a maximum value is not set, the default is 100.

This method works only for SWT.SMOOTH style. This method is silently ignored for other styles.

Parameters:
value - the new maximum, which must be positive and greater than or equal to the current minimum
Throws:
java.lang.IllegalArgumentException -
  • ERROR_INVALID_ARGUMENT - if the value is negative or less than the current minimum
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setMinimum

public void setMinimum(int value)
Sets the minimum value that the TaskTip will allow. If the new minimum is applied, the TaskTip's selection value is adjusted if necessary to fall within the new range. If a minimum value is not set, the default is 0.

This method works only for SWT.SMOOTH style. This method is silently ignored for other styles.

Parameters:
value - the new minimum, which must be positive and less than or equal to the current maximum
Throws:
java.lang.IllegalArgumentException -
  • ERROR_INVALID_ARGUMENT - if the value is negative or greater than the current maximum
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setSelection

public void setSelection(int value)
Sets the position of the TaskTip's indicator to the provided value. The value must fall in the range defined by setMinimum() and setMaximum(). If a value is not set, the default is 0.

This method works only for SWT.SMOOTH style. This method is silently ignored for other styles.

Parameters:
value - the new selection (must be zero or greater).
Throws:
java.lang.IllegalArgumentException -
  • ERROR_INVALID_ARGUMENT - if the value is not in between the current minimum and maximum
SWTException -
  • IllegalArgumentException - if the vlaue falls out of the range defined by setMinimum() and setMaximum()
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setText

public void setText(java.lang.String string)
Sets the label text.

This method sets a TaskTip's label . The label can be null. The label's position and the visibility of label text is platform-dependent.

Parameters:
string - the label text
Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setVisible

public void setVisible(boolean visible)
Makes the TaskTip visible and brings it to the front of the display.

This method will return immediately after showing or hiding the TaskTip.

Despite setting a TaskTip visible, it may not actually be displayed if the device's main screen is not active.

Parameters:
visible - the value to show or hide the TaskTip. The method will not return an error if the value matches the current visibility state.
Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the TaskTip has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver