public class Option
extends java.lang.Object
MenuItem
or a ToolItem
.Constructor and Description |
---|
Option(org.eclipse.swt.widgets.Menu parent,
int style)
|
Option(org.eclipse.swt.widgets.ToolBar parent,
int style)
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(OptionSelectedListener listener)
Adds given
OptionSelectedListener to Option 's
listener-pool. |
org.eclipse.swt.widgets.Widget |
getParent()
|
java.lang.String |
getText()
Returns the
Option 's text. |
void |
removeSelectionListener(OptionSelectedListener listener)
Removes given
OptionSelectedListener from Option 's
listener-pool. |
void |
setEnabled(boolean enabled)
Sets the
Option 's status (enabled / disabled) |
void |
setSelected(boolean selected)
Sets the
Option 's selected-status. |
void |
setText(java.lang.String text)
Sets text for the
Option |
public Option(org.eclipse.swt.widgets.Menu parent, int style)
parent
- Menu
in which the Option
is supposed to be
placed.style
- SWT-style applicable for MenuItem
public Option(org.eclipse.swt.widgets.ToolBar parent, int style)
parent
- ToolBar
in which the Option
is supposed to be
placed.style
- SWT-style applicable for ToolItem
public void addSelectionListener(OptionSelectedListener listener)
OptionSelectedListener
to Option
's
listener-pool.listener
- OptionSelectedListener
to be added.public void removeSelectionListener(OptionSelectedListener listener)
OptionSelectedListener
from Option
's
listener-pool.listener
- OptionSelectedListener
to be removed.public void setText(java.lang.String text)
Option
text
- to be addedpublic java.lang.String getText()
Option
's text.public void setSelected(boolean selected)
Option
's selected-status.public org.eclipse.swt.widgets.Widget getParent()