public class TaskItem extends Item
Modifier and Type | Field and Description |
---|---|
(package private) Menu |
menu |
(package private) Image |
overlayImage |
(package private) java.lang.String |
overlayText |
(package private) TaskBar |
parent |
(package private) int |
progress |
(package private) static int |
PROGRESS_MAX |
(package private) int |
progressState |
(package private) Shell |
shell |
(package private) boolean |
showingText |
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
TaskItem(TaskBar parent,
int style)
Constructs a new instance of this class given its parent
(which must be a
Tray ) and a style value
describing its behavior and appearance. |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
Menu |
getMenu()
Returns the receiver's pop up menu if it has one, or null
if it does not.
|
Image |
getOverlayImage()
Returns the receiver's overlay image if it has one, or null
if it does not.
|
java.lang.String |
getOverlayText()
Returns the receiver's overlay text, which will be an empty
string if it has never been set.
|
TaskBar |
getParent()
Returns the receiver's parent, which must be a
TaskBar . |
int |
getProgress()
Returns the receiver's progress.
|
int |
getProgressState()
Returns the receiver's progress state.
|
(package private) void |
recreate() |
(package private) void |
releaseHandle() |
(package private) void |
releaseWidget() |
void |
setMenu(Menu menu)
Sets the receiver's pop up menu to the argument.
|
void |
setOverlayImage(Image overlayImage)
Sets the receiver's overlay image, which may be null
indicating that no image should be displayed.
|
void |
setOverlayText(java.lang.String overlayText)
Sets the receiver's overlay text.
|
void |
setProgress(int progress)
Sets the receiver's progress, the progress represents a percentage and
should be in range from 0 to 100.
|
void |
setProgressState(int progressState)
Sets the receiver's progress state, the state can be one of
the following:
SWT.DEFAULT
SWT.NORMAL
SWT.PAUSED
SWT.ERROR
SWT.INDETERMINATE
The percentage of progress shown by the states SWT#NORMAL , SWT#PAUSED ,
SWT#ERROR is set with setProgress() . |
(package private) void |
setShell(Shell shell) |
(package private) void |
updateImage() |
(package private) void |
updateProgress() |
(package private) void |
updateProgressState() |
(package private) void |
updateText() |
getImage, getNameText, getText, setImage, setText
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mapEvent, new_GC, notifyListeners, postEvent, postEvent, release, releaseChildren, releaseParent, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendFocusEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, setTabItemFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
TaskBar parent
Shell shell
int progress
int progressState
Image overlayImage
java.lang.String overlayText
boolean showingText
Menu menu
static final int PROGRESS_MAX
TaskItem(TaskBar parent, int style)
Tray
) and a style value
describing its behavior and appearance. The item is added
to the end of the items maintained by its parent.
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
protected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite
and Canvas
when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass
in class Item
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Widget
Widget.dispose()
public Menu getMenu()
getMenu
in class Widget
SWTException
- public Image getOverlayImage()
SWTException
- public java.lang.String getOverlayText()
SWTException
- public TaskBar getParent()
TaskBar
.SWTException
- public int getProgress()
SWTException
- public int getProgressState()
SWTException
- void recreate()
void releaseHandle()
releaseHandle
in class Widget
void releaseWidget()
releaseWidget
in class Item
public void setMenu(Menu menu)
This feature might not be available for the receiver on all platforms. The application code can check if it is supported by calling the respective get method. When the feature is not available, the get method will always return the NULL.
For better cross platform support, the application code should
set this feature on the TaskItem
for application.
On Windows, this feature will only work on RCP applications.
The menu should be fully created before this method is called. Dynamic changes to the menu after the method is called will not be reflected in the native menu.
menu
- the new pop up menujava.lang.IllegalArgumentException
- SWTException
- public void setOverlayImage(Image overlayImage)
This feature might not be available for the receiver on all platforms. The application code can check if it is supported by calling the respective get method. When the feature is not available, the get method will always return the NULL.
For better cross platform support, the application code should
first try to set this feature on the TaskItem
for the
main shell then on the TaskItem
for the application.
overlayImage
- the new overlay image (may be null)java.lang.IllegalArgumentException
- SWTException
- public void setOverlayText(java.lang.String overlayText)
This feature might not be available for the receiver on all platforms. The application code can check if it is supported by calling the respective get method. When the feature is not available, the get method will always return an empty string.
For better cross platform support, the application code should
first try to set this feature on the TaskItem
for the
main shell then on the TaskItem
for the application.
overlayText
- the new overlay textjava.lang.IllegalArgumentException
- SWTException
- public void setProgress(int progress)
SWT#DEFAULT
.
This feature might not be available for the receiver on all platforms. The application code can check if it is supported by calling the respective get method. When the feature is not available, the get method will always return zero.
For better cross platform support, the application code should
first try to set this feature on the TaskItem
for the
main shell then on the TaskItem
for the application.
progress
- the new progressSWTException
- setProgressState(int)
public void setProgressState(int progressState)
SWT#NORMAL
, SWT#PAUSED
,
SWT#ERROR
is set with setProgress()
. SWT#DEFAULT
indicates that no progress should be shown.
This feature might not be available for the receiver on all
platforms. The application code can check if it is supported
by calling the respective get method. When the feature is not
available, the get method will always return SWT#DEFAULT
.
For better cross platform support, the application code should
first try to set this feature on the TaskItem
for the
main shell then on the TaskItem
for the application.
progressState
- the new progress stateSWTException
- setProgress(int)
void setShell(Shell shell)
void updateImage()
void updateProgress()
void updateProgressState()
void updateText()