Class TaskItem
- Styles:
- (none)
- Events:
- (none)
- Since:
- 3.6
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
- 
Field SummaryFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoom
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidChecks that this class can be subclassed.getMenu()Returns the receiver's pop up menu if it has one, or null if it does not.Returns the receiver's overlay image if it has one, or null if it does not.Returns the receiver's overlay text, which will be an empty string if it has never been set.Returns the receiver's parent, which must be aTaskBar.intReturns the receiver's progress.intReturns the receiver's progress state.voidSets the receiver's pop up menu to the argument.voidsetOverlayImage(Image overlayImage) Sets the receiver's overlay image, which may be null indicating that no image should be displayed.voidsetOverlayText(String overlayText) Sets the receiver's overlay text.voidsetProgress(int progress) Sets the receiver's progress, the progress represents a percentage and should be in range from 0 to 100.voidsetProgressState(int progressState) Sets the receiver's progress state, the state can be one of the following:SWT.DEFAULTSWT.NORMALSWT.PAUSEDSWT.ERRORSWT.INDETERMINATEThe percentage of progress shown by the statesSWT#NORMAL,SWT#PAUSED,SWT#ERRORis set withsetProgress().Methods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
- 
Method Details- 
checkSubclassprotected void checkSubclass()Description copied from class:WidgetChecks that this class can be subclassed.The SWT class library is intended to be subclassed only at specific, controlled points (most notably, CompositeandCanvaswhen 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. - Overrides:
- checkSubclassin class- Item
 
- 
getMenuReturns the receiver's pop up menu if it has one, or null if it does not.- Returns:
- the receiver's menu
- 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
 
 
- 
getOverlayImageReturns the receiver's overlay image if it has one, or null if it does not.- Returns:
- the receiver's overlay image
- 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
 
 
- 
getOverlayTextReturns the receiver's overlay text, which will be an empty string if it has never been set.- Returns:
- the receiver's overlay 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
 
 
- 
getParentReturns the receiver's parent, which must be aTaskBar.- Returns:
- the receiver's parent
- 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
 
 
- 
getProgresspublic int getProgress()Returns the receiver's progress.- Returns:
- the receiver's progress
- 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
 
 
- 
getProgressStatepublic int getProgressState()Returns the receiver's progress state.- Returns:
- the receiver's progress state
- 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
 
 
- 
setMenuSets the receiver's pop up menu to the argument. The way the menu is shown is platform specific.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 TaskItemfor 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. - Parameters:
- menu- the new pop up menu
- Throws:
- IllegalArgumentException-- ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu
- ERROR_INVALID_ARGUMENT - if the menu has been disposed
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setOverlayImageSets the receiver's overlay image, which may be null indicating that no image should be displayed. The bounds for the overlay image is determined by the platform and in general it should be a small image.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 TaskItemfor the main shell then on theTaskItemfor the application.- Parameters:
- overlayImage- the new overlay image (may be null)
- Throws:
- IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the overlayImage has been disposed
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setOverlayTextSets the receiver's overlay text. The space available to display the overlay text is platform dependent and in general it should be no longer than a few characters.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 TaskItemfor the main shell then on theTaskItemfor the application.- Parameters:
- overlayText- the new overlay text
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the overlayText is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setProgresspublic void setProgress(int progress) Sets the receiver's progress, the progress represents a percentage and should be in range from 0 to 100. The progress is only shown when the progress state is different thanSWT#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 TaskItemfor the main shell then on theTaskItemfor the application.- Parameters:
- progress- the new progress
- 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
 - setProgressState(int)
 
- 
setProgressStatepublic void setProgressState(int progressState) Sets the receiver's progress state, the state can be one of the following: The percentage of progress shown by the statesSWT#NORMAL,SWT#PAUSED,SWT#ERRORis set withsetProgress().
 The stateSWT#DEFAULTindicates 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 TaskItemfor the main shell then on theTaskItemfor the application.- Parameters:
- progressState- the new progress state
- 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
 - setProgress(int)
 
 
-