Class TaskItem
- Styles:
- (none)
- Events:
- (none)
- Since:
- 3.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Menu(package private) Image(package private) String(package private) TaskBar(package private) int(package private) static final int(package private) int(package private) ShellFields inherited from class Item
ELLIPSIS, image, text, TEXT_LIMITFields inherited from class Widget
ACTIVATE, ACTIVATE_INVERSE, AUTO_TEXT_DIRECTION, BACKGROUND, BACKSPACE, BACKSPACE_INVERSE, BUTTON_PRESS_EVENT, BUTTON_PRESS_EVENT_INVERSE, BUTTON_RELEASE_EVENT, BUTTON_RELEASE_EVENT_INVERSE, CANVAS, CHANGE_VALUE, CHANGED, CHECK_SUBWINDOW, CLICKED, CLOSE_REQUEST, COMMIT, COMPUTE_SIZE, CONFIGURE_EVENT, COPY_CLIPBOARD, COPY_CLIPBOARD_INVERSE, CREATE_MENU_PROXY, CUT_CLIPBOARD, CUT_CLIPBOARD_INVERSE, data, DAY_SELECTED, DAY_SELECTED_DOUBLE_CLICK, DECELERATE, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_FROM_CURSOR, DELETE_FROM_CURSOR_INVERSE, DELETE_RANGE, DELETE_TEXT, DIRECTION_CHANGED, DISABLED, display, DISPOSE_SENT, DISPOSED, DPI_CHANGED, DRAG_DETECT, DRAW, ENTER, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPAND_COLLAPSE_CURSOR_ROW, EXPOSE_EVENT, EXPOSE_EVENT_INVERSE, FOCUS, FOCUS_IN, FOCUS_IN_EVENT, FOCUS_OUT, FOCUS_OUT_EVENT, FONT, FOREGROUND, FOREIGN_HANDLE, gdkSeatGrabPrepareFunc, GESTURE_PRESSED, GESTURE_RELEASED, GRAB_FOCUS, handle, HANDLE, HAS_AUTO_DIRECTION, HIDDEN, HIDE, ICON_RELEASE, IM_UPDATE, INPUT, INSERT_TEXT, IS_ACTIVE, KEY_CHECK_SUBWINDOW, KEY_GTK_CSS, KEY_PRESS_EVENT, KEY_PRESSED, KEY_RELEASE_EVENT, KEY_RELEASED, KEYED_DATA, LAST_SIGNAL, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, LEAVE, LEAVE_NOTIFY_EVENT, MAP, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MONTH_CHANGED, MOTION, MOTION_INVERSE, MOTION_NOTIFY_EVENT, MOTION_NOTIFY_EVENT_INVERSE, MOVE_CURSOR, MOVE_CURSOR_INVERSE, MOVE_FOCUS, MOVED, NOTIFY_DEFAULT_HEIGHT, NOTIFY_DEFAULT_WIDTH, NOTIFY_MAXIMIZED, NOTIFY_STATE, OBSCURED, OUTPUT, PARENT_BACKGROUND, PASTE_CLIPBOARD, PASTE_CLIPBOARD_INVERSE, POPPED_UP, POPULATE_POPUP, POPUP_MENU, PREEDIT_CHANGED, REALIZE, RELEASED, RESIZED, ROW_ACTIVATED, ROW_DELETED, ROW_HAS_CHILD_TOGGLED, ROW_INSERTED, SCROLL, SCROLL_BEGIN, SCROLL_CHILD, SCROLL_END, SCROLL_EVENT, SELECT, SELECTION_DONE, SHOW, SHOW_HELP, SIZE_ALLOCATE, SIZE_ALLOCATE_GTK4, SKIN_NEEDED, START_INTERACTIVE_SEARCH, state, STATUS_ICON_POPUP_MENU, style, STYLE_UPDATED, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TEXT_BUFFER_INSERT_TEXT, THEME_BACKGROUND, TOGGLED, UNMAP, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, WINDOW_STATE_EVENT, ZERO_HEIGHT, ZERO_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidChecks that this class can be subclassed.(package private) voidgetMenu()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.(package private) void(package private) voidvoidSets 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 Item
getImage, getNameText, getText, setImage, setText, updateTextDirectionMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkWidget, convertPangoFontDescriptionToCss, createHandle, createWidget, cssHandle, deregister, dispose, dpiChanged, enterMotionProc, error, filterProc, filters, fixMnemonic, fixMnemonic, fixMnemonic, focusProc, fontHeight, gdk_event_free, gdk_event_get_state, gdk_event_get_surface_or_window, gdk_pointer_grab, gdk_pointer_ungrab, gdk_surface_get_size, gdk_window_get_size, GdkSeatGrabPrepareFunc, gesturePressReleaseProc, getData, getData, getDisplay, getListeners, getName, getStyle, getTypedListeners, gtk_activate, gtk_adjustment_get, gtk_box_new, gtk_box_pack_end, gtk_box_set_child_packing, gtk_button_press_event, gtk_button_release_event, gtk_cell_renderer_get_preferred_size, gtk_change_value, gtk_changed, gtk_clicked, gtk_close_request, gtk_commit, gtk_configure_event, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_create_menu_proxy, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_draw, gtk_enter_notify_event, gtk_expand_collapse_cursor_row, gtk_focus, gtk_focus_in_event, gtk_focus_out_event, gtk_gesture_press_event, gtk_gesture_release_event, gtk_grab_focus, gtk_hide, gtk_icon_release, gtk_input, gtk_insert_text, gtk_leave_notify_event, gtk_map, gtk_map_event, gtk_menu_popped_up, gtk_mnemonic_activate, gtk_month_changed, gtk_motion_notify_event, gtk_move_focus, gtk_output, gtk_populate_popup, gtk_preedit_changed, gtk_realize, gtk_row_activated, gtk_row_has_child_toggled, gtk_scroll_child, gtk_scroll_event, gtk_select, gtk_selection_done, gtk_show, gtk_size_allocate, gtk_start_interactive_search, gtk_status_icon_popup_menu, gtk_style_updated, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_text_buffer_insert_text, gtk_timer, gtk_toggled, gtk_tree_view_column_cell_get_position, gtk_unmap, gtk_unmap_event, gtk_unrealize, gtk_value_changed, gtk_widget_get_preferred_size, gtk_widget_get_surface, gtk_widget_get_window, gtk_widget_hide, gtk_widget_show, gtk_widget_size_allocate, gtk_window_state_event, gtk3_event_after, gtk3_key_press_event, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_draw, gtk4_enter_event, gtk4_focus_enter_event, gtk4_focus_leave_event, gtk4_focus_window_event, gtk4_key_press_event, gtk4_key_release_event, gtk4_leave_event, gtk4_motion_event, gtk4_scroll_event, hookEvents, hooks, hoverProc, isActive, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, notifyState, paintSurface, paintWindow, postEvent, postEvent, register, release, releaseChildren, releaseParent, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinChildren, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setOrientation, setTabGroupFocus, setTabItemFocus, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, topHandle, toString, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
Constructor Details
-
TaskItem
TaskItem(TaskBar parent, int style) Constructs a new instance of this class given its parent (which must be aTray) 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
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a composite control which will be the parent of the new instance (cannot be null)style- the style of control to construct- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
-
Method Details
-
checkSubclass
protected 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 classItem
-
destroyWidget
void destroyWidget()- Overrides:
destroyWidgetin classWidget
-
getMenu
Returns 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
-
getOverlayImage
Returns 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
-
getOverlayText
Returns 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
-
getParent
Returns 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
-
getProgress
public 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
-
getProgressState
public 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
-
releaseHandle
void releaseHandle()- Overrides:
releaseHandlein classWidget
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classItem
-
setMenu
Sets 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
-
setOverlayImage
Sets 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
-
setOverlayText
Sets 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
-
setProgressState
public 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)
-
setProgress
public 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)
-