|
|||||||||
| Home >> All >> org >> eclipse >> swt >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.swt.widgets
Class ToolItem

java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Item
org.eclipse.swt.widgets.ToolItem
- public class ToolItem
- extends Item
Instances of this class represent a selectable user interface object that represents a button in a tool bar.
- 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.
| Field Summary | |
(package private) long |
arrowHandle
|
(package private) long |
boxHandle
|
(package private) Control |
control
|
(package private) org.eclipse.swt.graphics.Image |
disabledImage
|
(package private) boolean |
drawHotImage
|
(package private) org.eclipse.swt.graphics.Image |
hotImage
|
(package private) long |
imageHandle
|
(package private) long |
labelHandle
|
(package private) ToolBar |
parent
|
(package private) long |
separatorHandle
|
(package private) java.lang.String |
toolTipText
|
| Fields inherited from class org.eclipse.swt.widgets.Item |
image, text |
| Fields inherited from class org.eclipse.swt.widgets.Widget |
ACTIVATE, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, CANVAS, CHANGED, CLICKED, COMMIT, CONFIGURE_EVENT, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_RANGE, DELETE_TEXT, DISABLED, display, DISPOSED, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPOSE_EVENT, FOCUS, FOCUS_IN_EVENT, FOCUS_OUT_EVENT, handle, HANDLE, HIDE, INSERT_TEXT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, KEYED_DATA, LEAVE_NOTIFY_EVENT, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MOTION_NOTIFY_EVENT, OBSCURED, POPUP_MENU, PREEDIT_CHANGED, REALIZE, ROW_ACTIVATED, SCROLL_CHILD, SELECT, SHOW, SHOW_HELP, SIZE_ALLOCATE, state, style, STYLE_SET, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TOGGLED, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, VISIBILITY_NOTIFY_EVENT, WINDOW_STATE_EVENT |
| Constructor Summary | |
ToolItem(ToolBar parent,
int style)
Constructs a new instance of this class given its parent (which must be a ToolBar) and a style value
describing its behavior and appearance. |
|
ToolItem(ToolBar parent,
int style,
int index)
Constructs a new instance of this class given its parent (which must be a ToolBar), 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 | |
void |
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the control is selected, by sending it one of the messages defined in the SelectionListener
interface. |
(package private) static int |
checkStyle(int style)
|
(package private) void |
createHandle(int index)
|
(package private) void |
deregister()
|
org.eclipse.swt.graphics.Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location relative to its parent. |
Control |
getControl()
Returns the control that is used to fill the bounds of the item when the items is a SEPARATOR. |
org.eclipse.swt.graphics.Image |
getDisabledImage()
Returns the receiver's disabled image if it has one, or null if it does not. |
boolean |
getEnabled()
Returns true if the receiver is enabled, and
false otherwise. |
org.eclipse.swt.graphics.Image |
getHotImage()
Returns the receiver's hot image if it has one, or null if it does not. |
ToolBar |
getParent()
Returns the receiver's parent, which must be a ToolBar. |
boolean |
getSelection()
Returns true if the receiver is selected,
and false otherwise. |
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has not been set. |
int |
getWidth()
Gets the width of the receiver. |
(package private) long |
gtk_button_press_event(long widget,
long event)
|
(package private) long |
gtk_button_release_event(long widget,
long event)
|
(package private) long |
gtk_clicked(long widget)
|
(package private) long |
gtk_enter_notify_event(long widget,
long event)
|
(package private) long |
gtk_event_after(long widget,
long gdkEvent)
|
(package private) long |
gtk_focus_out_event(long widget,
long event)
|
(package private) long |
gtk_leave_notify_event(long widget,
long event)
|
(package private) long |
gtk_mnemonic_activate(long widget,
long arg1)
|
(package private) boolean |
hasFocus()
|
(package private) void |
hookEvents()
|
boolean |
isEnabled()
Returns true if the receiver is enabled and all
of the receiver's ancestors are enabled, and false
otherwise. |
(package private) void |
register()
|
(package private) void |
releaseHandle()
|
(package private) void |
releaseWidget()
|
void |
removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the control is selected. |
(package private) void |
selectRadio()
|
void |
setControl(Control control)
Sets the control that is used to fill the bounds of the item when the items is a SEPARATOR. |
void |
setDisabledImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's disabled image to the argument, which may be null indicating that no disabled image should be displayed. |
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is true,
and disables it otherwise. |
(package private) boolean |
setFocus()
|
(package private) void |
setFontDescription(long font)
|
(package private) void |
setForegroundColor(org.eclipse.swt.internal.gtk.GdkColor color)
|
void |
setHotImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's hot image to the argument, which may be null indicating that no hot image should be displayed. |
void |
setImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's image to the argument, which may be null indicating that no image should be displayed. |
(package private) boolean |
setRadioSelection(boolean value)
|
void |
setSelection(boolean selected)
Sets the selection state of the receiver. |
void |
setText(java.lang.String string)
Sets the receiver's text. |
void |
setToolTipText(java.lang.String string)
Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown. |
void |
setWidth(int width)
Sets the width of the receiver. |
| Methods inherited from class org.eclipse.swt.widgets.Item |
checkSubclass, getImage, getNameText, getText |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
boxHandle
long boxHandle
arrowHandle
long arrowHandle
separatorHandle
long separatorHandle
labelHandle
long labelHandle
imageHandle
long imageHandle
parent
ToolBar parent
control
Control control
hotImage
org.eclipse.swt.graphics.Image hotImage
disabledImage
org.eclipse.swt.graphics.Image disabledImage
toolTipText
java.lang.String toolTipText
drawHotImage
boolean drawHotImage
| Constructor Detail |
ToolItem
public ToolItem(ToolBar parent, int style)
- Constructs a new instance of this class given its parent
(which must be a
ToolBar) 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.
ToolItem
public ToolItem(ToolBar parent, int style, int index)
- Constructs a new instance of this class given its parent
(which must be a
ToolBar), 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.
| Method Detail |
addSelectionListener
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
- Adds the listener to the collection of listeners who will
be notified when the control is selected, by sending
it one of the messages defined in the
SelectionListenerinterface.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.
createHandle
void createHandle(int index)
- Overrides:
createHandlein classWidget
deregister
void deregister()
- Overrides:
deregisterin classWidget
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()
- Returns a rectangle describing the receiver's size and location
relative to its parent.
getControl
public Control getControl()
- Returns the control that is used to fill the bounds of
the item when the items is a
SEPARATOR.
getDisabledImage
public org.eclipse.swt.graphics.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
public boolean getEnabled()
- Returns
trueif the receiver is enabled, andfalseotherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
getHotImage
public org.eclipse.swt.graphics.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.
getParent
public ToolBar getParent()
- Returns the receiver's parent, which must be a
ToolBar.
getSelection
public boolean getSelection()
- Returns
trueif 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.
getToolTipText
public java.lang.String getToolTipText()
- Returns the receiver's tool tip text, or null if it has not been set.
getWidth
public int getWidth()
- Gets the width of 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
gtk_event_after
long gtk_event_after(long widget,
long gdkEvent)
- Overrides:
gtk_event_afterin 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
gtk_mnemonic_activate
long gtk_mnemonic_activate(long widget,
long arg1)
- Overrides:
gtk_mnemonic_activatein classWidget
hasFocus
boolean hasFocus()
hookEvents
void hookEvents()
- Overrides:
hookEventsin classWidget
isEnabled
public boolean isEnabled()
- Returns
trueif 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.
register
void register()
releaseHandle
void releaseHandle()
- Overrides:
releaseHandlein classWidget
releaseWidget
void releaseWidget()
- Overrides:
releaseWidgetin classItem
removeSelectionListener
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
- Removes the listener from the collection of listeners who will
be notified when the control is selected.
selectRadio
void selectRadio()
setControl
public void setControl(Control control)
- Sets the control that is used to fill the bounds of
the item when the items is a
SEPARATOR.
setDisabledImage
public void setDisabledImage(org.eclipse.swt.graphics.Image image)
- Sets the receiver's disabled image to the argument, which may be
null indicating that no disabled image should be displayed.
The disbled image is displayed when the receiver is disabled.
setEnabled
public void setEnabled(boolean enabled)
- Enables the receiver if the argument is
true, and disables it otherwise.A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
setFocus
boolean setFocus()
setFontDescription
void setFontDescription(long font)
setForegroundColor
void setForegroundColor(org.eclipse.swt.internal.gtk.GdkColor color)
setHotImage
public void setHotImage(org.eclipse.swt.graphics.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
public void setImage(org.eclipse.swt.graphics.Image image)
- Description copied from class:
Item - Sets the receiver's image to the argument, which may be
null indicating that no image should be displayed.
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).
setText
public void setText(java.lang.String string)
- 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.
setToolTipText
public void setToolTipText(java.lang.String string)
- Sets the receiver's tool tip text to the argument, which
may be null indicating that no tool tip text should be shown.
setWidth
public void setWidth(int width)
- Sets the width of the receiver.
checkStyle
static int checkStyle(int style)
|
|||||||||
| Home >> All >> org >> eclipse >> swt >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC