Class ToolItem
- Styles:
- PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN
- Events:
- Selection
Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN may be specified.
IMPORTANT: This class is not intended to be subclassed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long(package private) Color(package private) longGTK4 only field, used to keep track of the containing box of the image invalid input: '&' label(package private) Control(package private) ImageThe image that is currently used by the tool item.(package private) Image(package private) Image(package private) boolean(package private) boolean(package private) long(package private) Color(package private) longGTK4 only field, used to keep track of the containing box of the image invalid input: '&' label(package private) Image(package private) long(package private) long(package private) booleanTrue iff map has been hooked for this ToolItem.(package private) ToolBar(package private) long(package private) long(package private) StringFields 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
ConstructorsConstructorDescriptionConstructs a new instance of this class given its parent (which must be aToolBar) and a style value describing its behavior and appearance.Constructs a new instance of this class given its parent (which must be aToolBar), a style value describing its behavior and appearance, and the index at which to place it in the items maintained by its parent. -
Method Summary
Modifier and TypeMethodDescriptionprivate void(package private) voidvoidaddSelectionListener(SelectionListener listener) Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.(package private) static intcheckStyle(int style) protected voidChecks that this class can be subclassed.(package private) Widget[](package private) voidcreateHandle(int index) (package private) voidcreateWidget(int index) (package private) voidvoiddispose()Disposes of the operating system resources associated with the receiver and all its descendants.private void(package private) longdpiChanged(long object, long arg0) Returns the receiver's background color.Returns a rectangle describing the receiver's size and location relative to its parent.Returns the control that is used to fill the bounds of the item when the item is aSEPARATOR.Returns the receiver's disabled image if it has one, or null if it does not.booleanReturnstrueif the receiver is enabled, andfalseotherwise.Returns the foreground color that the receiver will use to draw.Returns the receiver's hot image if it has one, or null if it does not.getImage()Returns the receiver's enabled image if it has one, or null if it does not.(package private) StringReturns the receiver's parent, which must be aToolBar.booleanReturnstrueif the receiver is selected, and false otherwise.Returns the receiver's tool tip text, or null if it has not been set.intgetWidth()Gets the width of the receiver.(package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_button_release_event(long widget, long event) (package private) longgtk_clicked(long widget) (package private) longgtk_create_menu_proxy(long widget) (package private) longgtk_enter_notify_event(long widget, long event) (package private) longgtk_focus_in_event(long widget, long event) (package private) longgtk_focus_out_event(long widget, long event) (package private) longgtk_leave_notify_event(long widget, long event) (package private) longgtk_map(long widget) (package private) longgtk_mnemonic_activate(long widget, long arg1) (package private) longgtk3_event_after(long widget, long gdkEvent) (package private) voidgtk4_enter_event(long controller, double x, double y, long event) (package private) voidgtk4_leave_event(long controller, long event) (package private) voidbooleanReturnstrueif the receiver is enabled and all of the receiver's ancestors are enabled, andfalseotherwise.(package private) booleanprivate void(package private) voidregister()(package private) void(package private) voidvoidremoveSelectionListener(SelectionListener listener) Removes the listener from the collection of listeners who will be notified when the control is selected by the user.(package private) void(package private) voidresizeHandle(int width, int height) (package private) voidvoidsetBackground(Color color) Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.voidsetControl(Control control) Sets the control that is used to fill the bounds of the item when the item is aSEPARATOR.voidsetDisabledImage(Image image) Sets the receiver's disabled image to the argument, which may be null indicating that no disabled image should be displayed.voidsetEnabled(boolean enabled) Enables the receiver if the argument istrue, and disables it otherwise.(package private) booleansetFocus()(package private) voidsetFontDescription(long font) voidsetForeground(Color color) Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.voidsetHotImage(Image image) Sets the receiver's hot image to the argument, which may be null indicating that no hot image should be displayed.voidSets the receiver's image to the argument, which may be null indicating that no image should be displayed.(package private) voidsetOrientation(boolean create) (package private) booleansetRadioSelection(boolean value) voidsetSelection(boolean selected) Sets the selection state of the receiver.(package private) booleansetTabItemFocus(boolean next) voidSets the receiver's text.voidsetToolTipText(String string) Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown.voidsetWidth(int width) Sets the width of the receiver, forSEPARATORToolItems.(package private) voidshowWidget(int index) (package private) voidMethods inherited from class Item
getText, updateTextDirectionMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkWidget, convertPangoFontDescriptionToCss, cssHandle, destroyWidget, 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_cell_renderer_get_preferred_size, gtk_change_value, gtk_changed, gtk_close_request, gtk_commit, gtk_configure_event, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_draw, gtk_expand_collapse_cursor_row, gtk_focus, gtk_gesture_press_event, gtk_gesture_release_event, gtk_grab_focus, gtk_hide, gtk_icon_release, gtk_input, gtk_insert_text, gtk_map_event, gtk_menu_popped_up, 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_key_press_event, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_draw, gtk4_focus_enter_event, gtk4_focus_leave_event, gtk4_focus_window_event, gtk4_key_press_event, gtk4_key_release_event, gtk4_motion_event, gtk4_scroll_event, hooks, hoverProc, isActive, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, notifyState, paintSurface, paintWindow, postEvent, postEvent, 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, setTabGroupFocus, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, topHandle, toString, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
arrowHandle
long arrowHandle -
labelHandle
long labelHandle -
imageHandle
long imageHandle -
eventHandle
long eventHandle -
proxyMenuItem
long proxyMenuItem -
provider
long provider -
boxHandle
long boxHandleGTK4 only field, used to keep track of the containing box of the image invalid input: '&' label -
groupHandle
long groupHandleGTK4 only field, used to keep track of the containing box of the image invalid input: '&' label -
parent
ToolBar parent -
control
Control control -
hotImage
Image hotImage -
disabledImage
Image disabledImage -
defaultDisableImage
Image defaultDisableImage -
background
Color background -
foreground
Color foreground -
toolTipText
String toolTipText -
drawHotImage
boolean drawHotImage -
mapHooked
boolean mapHookedTrue iff map has been hooked for this ToolItem. See bug 546914. -
enabled
boolean enabled -
currentImage
Image currentImageThe image that is currently used by the tool item. Either the image set by client code viasetImage(Image)orsetDisabledImage(Image), depending on button state. Or if the button is disabled but no disabled image is specified, a grayed out version of the "normal" image.
-
-
Constructor Details
-
ToolItem
Constructs a new instance of this class given its parent (which must be aToolBar) 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:
-
ToolItem
Constructs a new instance of this class given its parent (which must be aToolBar), a style value describing its behavior and appearance, and the index at which to place it in 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 constructindex- the zero-relative index to store the receiver in its parent- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)
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
-
addSelectionListener
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.When
widgetSelectedis called when the mouse is over the arrow portion of a drop-down tool, the event object detail field contains the valueSWT.ARROW.widgetDefaultSelectedis not called.When the
SWT.RADIOstyle bit is set, thewidgetSelectedmethod is also called when the receiver loses selection because another item in the same radio group was selected by the user. DuringwidgetSelectedthe application can usegetSelection()to determine the current selected state of the receiver.- Parameters:
listener- the listener which should be notified when the control is selected by the user,- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener 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
- See Also:
-
checkStyle
static int checkStyle(int style) -
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
-
createHandle
void createHandle(int index) - Overrides:
createHandlein classWidget
-
createWidget
void createWidget(int index) - Overrides:
createWidgetin classWidget
-
computeTabList
Widget[] computeTabList() -
deregister
void deregister()- Overrides:
deregisterin classWidget
-
dispose
public void dispose()Description copied from class:WidgetDisposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answertruewhen sent the messageisDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the
Disposeevent. -
getBackground
Returns the receiver's background color.Note: This operation is a hint and may be overridden by the platform. For example, on some versions of Windows the background of a TabFolder, is a gradient rather than a solid color.
- Returns:
- the background color
- 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
- Since:
- 3.120
-
getBounds
Returns a rectangle describing the receiver's size and location relative to its parent.- Returns:
- the receiver's bounding rectangle
- 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
-
getControl
Returns the control that is used to fill the bounds of the item when the item is aSEPARATOR.- Returns:
- the control
- 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
-
getDisabledImage
Returns the receiver's disabled image if it has one, or null if it does not.The disabled image is displayed when the receiver is disabled.
- Returns:
- the receiver's disabled 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
-
getEnabled
public boolean getEnabled()Returnstrueif the receiver is enabled, andfalseotherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled 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
- See Also:
-
getForeground
Returns the foreground color that the receiver will use to draw.- Returns:
- the receiver's foreground color
- 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
- Since:
- 3.120
-
getHotImage
Returns the receiver's hot image if it has one, or null if it does not.The hot image is displayed when the mouse enters the receiver.
- Returns:
- the receiver's hot 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
-
getImage
Returns the receiver's enabled image if it has one, or null if it does not.- Overrides:
getImagein classItem- Returns:
- the receiver's enabled 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
-
getParent
Returns the receiver's parent, which must be aToolBar.- 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
-
getSelection
public boolean getSelection()Returnstrueif the receiver is selected, and false otherwise.When the receiver is of type
CHECKorRADIO, it is selected when it is checked (which some platforms draw as a pushed in button). If the receiver is of any other type, this method returns false.- Returns:
- the selection 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
-
getToolTipText
Returns the receiver's tool tip text, or null if it has not been set.- Returns:
- the receiver's tool tip 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
-
getWidth
public int getWidth()Gets the width of the receiver.- Returns:
- the width
- 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
-
gtk_button_press_event
long gtk_button_press_event(long widget, long event) - Overrides:
gtk_button_press_eventin classWidget
-
gtk_button_release_event
long gtk_button_release_event(long widget, long event) - Overrides:
gtk_button_release_eventin classWidget
-
gtk_clicked
long gtk_clicked(long widget) - Overrides:
gtk_clickedin classWidget
-
gtk_enter_notify_event
long gtk_enter_notify_event(long widget, long event) - Overrides:
gtk_enter_notify_eventin classWidget
-
gtk4_enter_event
void gtk4_enter_event(long controller, double x, double y, long event) - Overrides:
gtk4_enter_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventx- x coordinate of pointer locationy- y coordinate of pointer locationevent- the GdkEvent captured
-
gtk3_event_after
long gtk3_event_after(long widget, long gdkEvent) - Overrides:
gtk3_event_afterin classWidget
-
gtk_focus_in_event
long gtk_focus_in_event(long widget, long event) - Overrides:
gtk_focus_in_eventin classWidget
-
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) - Overrides:
gtk_focus_out_eventin classWidget
-
gtk_leave_notify_event
long gtk_leave_notify_event(long widget, long event) - Overrides:
gtk_leave_notify_eventin classWidget
-
gtk4_leave_event
void gtk4_leave_event(long controller, long event) - Overrides:
gtk4_leave_eventin classWidget- Parameters:
controller- the corresponding controller responsible for capturing the eventevent- the GdkEvent captured
-
gtk_map
-
gtk_mnemonic_activate
long gtk_mnemonic_activate(long widget, long arg1) - Overrides:
gtk_mnemonic_activatein classWidget
-
hookEvents
void hookEvents()- Overrides:
hookEventsin classWidget
-
isEnabled
public boolean isEnabled()Returnstrueif the receiver is enabled and all of the receiver's ancestors are enabled, andfalseotherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled 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
- See Also:
-
isTabGroup
boolean isTabGroup() -
register
-
releaseHandle
void releaseHandle()- Overrides:
releaseHandlein classWidget
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classItem
-
removeSelectionListener
Removes the listener from the collection of listeners who will be notified when the control is selected by the user.- Parameters:
listener- the listener which should no longer be notified- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener 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
- See Also:
-
resizeControl
void resizeControl() -
resizeHandle
void resizeHandle(int width, int height) -
selectRadio
void selectRadio() -
setBackground
Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.Note: This operation is a hint and may be overridden by the platform.
- Parameters:
color- the new color (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument 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
- Since:
- 3.120
-
setControl
Sets the control that is used to fill the bounds of the item when the item is aSEPARATOR.- Parameters:
control- the new control- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the control has been disposed
- ERROR_INVALID_PARENT - if the control is not in the same widget tree
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setDisabledImage
Sets the receiver's disabled image to the argument, which may be null indicating that no disabled image should be displayed.The disabled image is displayed when the receiver is disabled.
- Parameters:
image- the disabled image to display on the receiver (may be null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the image 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
-
setEnabled
public void setEnabled(boolean enabled) Enables the receiver if the argument istrue, and disables it otherwise.A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
- Parameters:
enabled- the new enabled 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
-
_setEnabledOrDisabledImage
private void _setEnabledOrDisabledImage() -
setFocus
boolean setFocus() -
setFontDescription
void setFontDescription(long font) -
setForeground
Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.Note: This operation is a hint and may be overridden by the platform.
- Parameters:
color- the new color (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument 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
- Since:
- 3.120
-
setHotImage
Sets the receiver's hot image to the argument, which may be null indicating that no hot image should be displayed.The hot image is displayed when the mouse enters the receiver.
- Parameters:
image- the hot image to display on the receiver (may be null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the image 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
-
setImage
-
disposeDefault
private void disposeDefault() -
_setImage
-
setOrientation
void setOrientation(boolean create) - Overrides:
setOrientationin classWidget
-
setRadioSelection
boolean setRadioSelection(boolean value) -
setSelection
public void setSelection(boolean selected) Sets the selection state of the receiver.When the receiver is of type
CHECKorRADIO, it is selected when it is checked (which some platforms draw as a pushed in button).- Parameters:
selected- the new selection 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
-
setTabItemFocus
boolean setTabItemFocus(boolean next) - Overrides:
setTabItemFocusin classWidget
-
setText
Sets the receiver's text. The string may include the mnemonic character.Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. When the user presses a key sequence that matches the mnemonic, a selection event occurs. On most platforms, the mnemonic appears underlined but may be emphasised in a platform specific manner. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.
Note: If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.
- Overrides:
setTextin classItem- Parameters:
string- the new text- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the text 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
-
setToolTipText
Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
NOTE: This operation is a hint and behavior is platform specific, on Windows for CJK-style mnemonics of the form " (&C)" at the end of the tooltip text are not shown in tooltip.
- Parameters:
string- the new tool tip text (or null)- 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
-
setWidth
public void setWidth(int width) Sets the width of the receiver, forSEPARATORToolItems.- Parameters:
width- the new width. If the new value isSWT.DEFAULT, the width is a fixed-width area whose amount is determined by the platform. If the new value is 0 a vertical or horizontal line will be drawn, depending on the setting of the corresponding style bit (SWT.VERTICALorSWT.HORIZONTAL). If the new value isSWT.SEPARATOR_FILLa variable-width space is inserted that acts as a spring between the two adjoining items which will push them out to the extent of the containing ToolBar.- 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
-
showWidget
void showWidget(int index) -
updateStyle
void updateStyle() -
getNameText
String getNameText()- Overrides:
getNameTextin classItem
-
dpiChanged
long dpiChanged(long object, long arg0) - Overrides:
dpiChangedin classWidget
-
recreateMenuProxy
private void recreateMenuProxy()
-