Note
Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN may be specified.
Important Note
This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | |
| pack-priv Color | |
| pack-priv long | boxHandle
GTK4 only field, used to keep track of the containing box of the image & label |
| pack-priv Control | |
| pack-priv Image | currentImage
The image that is currently used by the tool item. |
| pack-priv Image | |
| pack-priv Image | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv long | |
| pack-priv Color | |
| pack-priv long | groupHandle
GTK4 only field, used to keep track of the containing box of the image & label |
| pack-priv Image | |
| pack-priv long | |
| pack-priv long | |
| pack-priv boolean | mapHooked
True iff map has been hooked for this ToolItem. |
| pack-priv ToolBar | |
| pack-priv long | |
| pack-priv long | |
| pack-priv String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ToolItem(ToolBar
a composite control which will be the parent of the new instance (cannot be null) parent, int the style of control to construct style, int the zero-relative index to store the receiver in its parent index)Constructs a new instance of this class given its parent
(which must be a |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| pack-priv void | |
| public void | addSelectionListener(SelectionListener
the listener which should be notified when the control is selected by the user, 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 the |
| pack-priv static int | |
| protected void | checkSubclass()
Overrides org. |
| pack-priv Widget[] | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | dispose()
Overrides org. |
| private void | |
| pack-priv long | |
| public Color | |
| public Rectangle | Returns: the receiver's bounding rectangleReturns a rectangle describing the receiver's size and location relative to its parent. |
| pack-priv Rectangle | |
| public Control | Returns: the controlReturns the control that is used to fill the bounds of
the item when the item is a |
| public Image | Returns: the receiver's disabled imageReturns the receiver's disabled image if it has one, or null if it does not. |
| public boolean | Returns: the receiver's enabled stateReturns |
| public Color | Returns: the receiver's foreground colorReturns the foreground color that the receiver will use to draw. |
| public Image | Returns: the receiver's hot imageReturns the receiver's hot image if it has one, or null if it does not. |
| public Image | Returns: the receiver's enabled imageOverrides org. |
| pack-priv String | |
| public ToolBar | |
| public boolean | Returns: the selection stateReturns |
| public String | Returns: the receiver's tool tip textReturns the receiver's tool tip text, or null if it has not been set. |
| public int | |
| pack-priv int | |
| pack-priv long | gtk_button_press_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_button_release_event(long widget, long event)
Overrides org. |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | gtk_enter_notify_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_event_after(long widget, long gdkEvent)
|
| pack-priv long | gtk_focus_in_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_focus_out_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_leave_notify_event(long widget, long event)
Overrides org. |
| pack-priv long | |
| pack-priv long | gtk_mnemonic_activate(long widget, long arg1)
Overrides org. |
| pack-priv void | |
| public boolean | Returns: the receiver's enabled stateReturns |
| pack-priv boolean | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | removeSelectionListener(SelectionListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the control is selected by the user. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | setBackground(Color
the new color (or null) 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. |
| public void | setControl(Control
the new control control)Sets the control that is used to fill the bounds of
the item when the item is a |
| public void | setDisabledImage(Image
the disabled image to display on the receiver (may be null) image)Sets the receiver's disabled image to the argument, which may be null indicating that no disabled image should be displayed. |
| public void | setEnabled(boolean
the new enabled state enabled)Enables the receiver if the argument is |
| pack-priv boolean | |
| pack-priv void | |
| public void | setForeground(Color
the new color (or null) 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. |
| public void | setHotImage(Image
the hot image to display on the receiver (may be null) image)Sets the receiver's hot image to the argument, which may be null indicating that no hot image should be displayed. |
| public void | setImage(Image
the image to display on the receiver (may be null) image)Overrides org. |
| pack-priv void | |
| pack-priv boolean | |
| public void | |
| pack-priv boolean | |
| public void | setText(String
the new text string)Overrides org. |
| public void | setToolTipText(String
the new tool tip text (or null) 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. |
| public void | setWidth(int
the new width. If the new value is width)SWT.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.VERTICAL or
SWT.HORIZONTAL). If the new value is SWT.SEPARATOR_FILL
a 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.Sets the width of the receiver, for |
| pack-priv void | |
| pack-priv void | |
| pack-priv void |
| arrowHandle | back to summary |
|---|---|
| pack-priv long arrowHandle | |
| background | back to summary |
|---|---|
| pack-priv Color background | |
| boxHandle | back to summary |
|---|---|
| pack-priv long boxHandle GTK4 only field, used to keep track of the containing box of the image & label | |
| control | back to summary |
|---|---|
| pack-priv Control control | |
| currentImage | back to summary |
|---|---|
| pack-priv Image currentImage The image that is currently used by the tool item.
Either the image set by client code via | |
| defaultDisableImage | back to summary |
|---|---|
| pack-priv Image defaultDisableImage | |
| disabledImage | back to summary |
|---|---|
| pack-priv Image disabledImage | |
| drawHotImage | back to summary |
|---|---|
| pack-priv boolean drawHotImage | |
| enabled | back to summary |
|---|---|
| pack-priv boolean enabled | |
| eventHandle | back to summary |
|---|---|
| pack-priv long eventHandle | |
| foreground | back to summary |
|---|---|
| pack-priv Color foreground | |
| groupHandle | back to summary |
|---|---|
| pack-priv long groupHandle GTK4 only field, used to keep track of the containing box of the image & label | |
| hotImage | back to summary |
|---|---|
| pack-priv Image hotImage | |
| imageHandle | back to summary |
|---|---|
| pack-priv long imageHandle | |
| labelHandle | back to summary |
|---|---|
| pack-priv long labelHandle | |
| mapHooked | back to summary |
|---|---|
| pack-priv boolean mapHooked True iff map has been hooked for this ToolItem. See bug 546914. | |
| parent | back to summary |
|---|---|
| pack-priv ToolBar parent | |
| provider | back to summary |
|---|---|
| pack-priv long provider | |
| proxyMenuItem | back to summary |
|---|---|
| pack-priv long proxyMenuItem | |
| toolTipText | back to summary |
|---|---|
| pack-priv String toolTipText | |
| ToolItem | back to summary |
|---|---|
| public ToolItem(ToolBar parent, int style) Constructs a new instance of this class given its parent
(which must be a
The style value is either one of the style constants defined in
class
| |
| ToolItem | back to summary |
|---|---|
| public ToolItem(ToolBar parent, int style, int index) Constructs a new instance of this class given its parent
(which must be a
The style value is either one of the style constants defined in
class
| |
| _setEnabledOrDisabledImage | back to summary |
|---|---|
| private void _setEnabledOrDisabledImage() | |
| _setImage | back to summary |
|---|---|
| pack-priv void _setImage(Image image) | |
| addSelectionListener | back to summary |
|---|---|
| public void addSelectionListener(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 the
When
When the
| |
| checkStyle | back to summary |
|---|---|
| pack-priv static int checkStyle(int style) | |
| checkSubclass | back to summary |
|---|---|
| protected void checkSubclass() Overrides org. Doc from org. Checks that this class can be subclassed.
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Important Note 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.
| |
| computeTabList | back to summary |
|---|---|
| pack-priv Widget[] computeTabList() | |
| createHandle | back to summary |
|---|---|
| pack-priv void createHandle(int index) Overrides org.
| |
| createWidget | back to summary |
|---|---|
| pack-priv void createWidget(int index) Overrides org.
| |
| deregister | back to summary |
|---|---|
| pack-priv void deregister() Overrides org.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides org. Doc from org. Disposes 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 answer
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
| |
| disposeDefault | back to summary |
|---|---|
| private void disposeDefault() | |
| dpiChanged | back to summary |
|---|---|
| pack-priv long dpiChanged(long object, long arg0) Overrides org.
| |
| getBackground | back to summary |
|---|---|
| public Color 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.
| |
| getBounds | back to summary |
|---|---|
| public Rectangle getBounds() Returns a rectangle describing the receiver's size and location relative to its parent.
| |
| getBoundsInPixels | back to summary |
|---|---|
| pack-priv Rectangle getBoundsInPixels() | |
| getControl | back to summary |
|---|---|
| public Control getControl() Returns the control that is used to fill the bounds of
the item when the item is a
| |
| getDisabledImage | back to summary |
|---|---|
| public Image 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.
| |
| getEnabled | back to summary |
|---|---|
| public boolean getEnabled() Returns
| |
| getForeground | back to summary |
|---|---|
| public Color getForeground() Returns the foreground color that the receiver will use to draw.
| |
| getHotImage | back to summary |
|---|---|
| public Image 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.
| |
| getImage | back to summary |
|---|---|
| public Image getImage() Overrides org. Returns the receiver's enabled image if it has one, or null if it does not.
| |
| getNameText | back to summary |
|---|---|
| pack-priv String getNameText() Overrides org.
| |
| getParent | back to summary |
|---|---|
| public ToolBar getParent() Returns the receiver's parent, which must be a
| |
| getSelection | back to summary |
|---|---|
| public boolean getSelection() Returns
When the receiver is of type
| |
| getToolTipText | back to summary |
|---|---|
| public String getToolTipText() Returns the receiver's tool tip text, or null if it has not been set.
| |
| getWidth | back to summary |
|---|---|
| public int getWidth() Gets the width of the receiver.
| |
| getWidthInPixels | back to summary |
|---|---|
| pack-priv int getWidthInPixels() | |
| gtk_button_press_event | back to summary |
|---|---|
| pack-priv long gtk_button_press_event(long widget, long event) Overrides org.
| |
| gtk_button_release_event | back to summary |
|---|---|
| pack-priv long gtk_button_release_event(long widget, long event) Overrides org.
| |
| gtk_clicked | back to summary |
|---|---|
| pack-priv long gtk_clicked(long widget) Overrides org.
| |
| gtk_create_menu_proxy | back to summary |
|---|---|
| pack-priv long gtk_create_menu_proxy(long widget) Overrides org.
| |
| gtk_enter_notify_event | back to summary |
|---|---|
| pack-priv long gtk_enter_notify_event(long widget, long event) Overrides org.
| |
| gtk_event_after | back to summary |
|---|---|
| pack-priv long gtk_event_after(long widget, long gdkEvent) Overrides org.
| |
| gtk_focus_in_event | back to summary |
|---|---|
| pack-priv long gtk_focus_in_event(long widget, long event) Overrides org.
| |
| gtk_focus_out_event | back to summary |
|---|---|
| pack-priv long gtk_focus_out_event(long widget, long event) Overrides org.
| |
| gtk_leave_notify_event | back to summary |
|---|---|
| pack-priv long gtk_leave_notify_event(long widget, long event) Overrides org.
| |
| gtk_map | back to summary |
|---|---|
| pack-priv long gtk_map(long widget) Overrides org.
| |
| gtk_mnemonic_activate | back to summary |
|---|---|
| pack-priv long gtk_mnemonic_activate(long widget, long arg1) Overrides org.
| |
| hookEvents | back to summary |
|---|---|
| pack-priv void hookEvents() Overrides org.
| |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled() Returns
| |
| isTabGroup | back to summary |
|---|---|
| pack-priv boolean isTabGroup() | |
| recreateMenuProxy | back to summary |
|---|---|
| private void recreateMenuProxy() | |
| register | back to summary |
|---|---|
| pack-priv void register() Overrides org.
| |
| releaseHandle | back to summary |
|---|---|
| pack-priv void releaseHandle() Overrides org.
| |
| releaseWidget | back to summary |
|---|---|
| pack-priv void releaseWidget() Overrides org.
| |
| removeSelectionListener | back to summary |
|---|---|
| public void removeSelectionListener(SelectionListener listener) Removes the listener from the collection of listeners who will be notified when the control is selected by the user.
| |
| resizeControl | back to summary |
|---|---|
| pack-priv void resizeControl() | |
| resizeHandle | back to summary |
|---|---|
| pack-priv void resizeHandle(int width, int height) | |
| selectRadio | back to summary |
|---|---|
| pack-priv void selectRadio() | |
| setBackground | back to summary |
|---|---|
| public void setBackground(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. Note This operation is a hint and may be overridden by the platform.
| |
| setControl | back to summary |
|---|---|
| public void setControl(Control control) Sets the control that is used to fill the bounds of
the item when the item is a
| |
| setDisabledImage | back to summary |
|---|---|
| public void setDisabledImage(Image image) 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.
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean enabled) Enables the receiver if the argument is A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
| |
| setFocus | back to summary |
|---|---|
| pack-priv boolean setFocus() | |
| setFontDescription | back to summary |
|---|---|
| pack-priv void setFontDescription(long font) | |
| setForeground | back to summary |
|---|---|
| public void setForeground(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. Note This operation is a hint and may be overridden by the platform.
| |
| setHotImage | back to summary |
|---|---|
| public void setHotImage(Image image) 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.
| |
| setImage | back to summary |
|---|---|
| public void setImage(Image image) Overrides org. Doc from org. Sets the receiver's image to the argument, which may be null indicating that no image should be displayed. | |
| setOrientation | back to summary |
|---|---|
| pack-priv void setOrientation(boolean create) Overrides org.
| |
| setRadioSelection | back to summary |
|---|---|
| pack-priv boolean setRadioSelection(boolean value) | |
| setSelection | back to summary |
|---|---|
| public void setSelection(boolean selected) Sets the selection state of the receiver.
When the receiver is of type
| |
| setTabItemFocus | back to summary |
|---|---|
| pack-priv boolean setTabItemFocus(boolean next) Overrides org.
| |
| setText | back to summary |
|---|---|
| public void setText(String string) Overrides org. 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.
| |
| setToolTipText | back to summary |
|---|---|
| public void setToolTipText(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. 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.
| |
| setWidth | back to summary |
|---|---|
| public void setWidth(int width) Sets the width of the receiver, for
| |
| setWidthInPixels | back to summary |
|---|---|
| pack-priv void setWidthInPixels(int width) | |
| showWidget | back to summary |
|---|---|
| pack-priv void showWidget(int index) | |
| updateStyle | back to summary |
|---|---|
| pack-priv void updateStyle() | |