|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.Component
nextapp.echo.SelectField
A component that is used to select one item from a drop-down list of items.
Nested Class Summary | |
private class |
SelectField.ListDataHandler
Local handler of ListDataEvents. |
Field Summary | |
private java.lang.String |
actionCommand
|
static java.lang.String |
CELL_RENDERER_CHANGED_PROPERTY
|
private ListCellRenderer |
cellRenderer
|
private ListDataListener |
dataListener
|
static java.lang.String |
LIST_DATA_CHANGED_PROPERTY
|
private SelectFieldModel |
model
|
static int |
PERCENT_UNITS
A constant for units-defining properties that represent percent-based units. |
static int |
PIXEL_UNITS
A constant for units-defining properties that represent pixel-based units. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
static java.lang.String |
STYLE_WIDTH_UNITS
A style constant for the Width Units property. |
private java.lang.String |
toolTipText
|
private int |
width
|
static java.lang.String |
WIDTH_CHANGED_PROPERTY
|
static java.lang.String |
WIDTH_UNITS_CHANGED_PROPERTY
|
private int |
widthUnits
|
Fields inherited from interface nextapp.echo.ToolTipSupport |
TOOL_TIP_TEXT_CHANGED_PROPERTY |
Constructor Summary | |
SelectField()
Creates a new, empty SelectField . |
|
SelectField(java.lang.Object[] items)
Creates a new SelectField that will initially contain the
provided array of items. |
|
SelectField(SelectFieldModel model)
Creates a new SelectField with the provided model. |
Method Summary | |
void |
addActionListener(ActionListener l)
Adds an ActionListener . |
void |
addItemListener(ItemListener l)
Adds an ItemListener . |
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style object. |
void |
fireActionEvent()
Notifies all listeners that an item has been selected. |
protected void |
fireItemStateChanged(ItemEvent e)
Notifies all listeners with the specified ItemEvent . |
java.lang.String |
getActionCommand()
Returns the action command of the SelectField . |
ListCellRenderer |
getCellRenderer()
Returns the renderer for items. |
SelectFieldModel |
getModel()
Returns the model of the SelectField . |
int |
getSelectedIndex()
Returns the index of the currently selected item. |
java.lang.Object |
getSelectedItem()
Returns the currently selected item. |
java.lang.String |
getToolTipText()
Returns the default tool tip text. |
int |
getWidth()
Returns the width of the SelectField . |
int |
getWidthUnits()
Returns the width units of the SelectField . |
boolean |
hasActionListeners()
Returns true if the select field has one or more action listeners. |
void |
removeActionListener(ActionListener l)
Removes an ActionListener . |
void |
removeItemListener(ItemListener l)
Removes an ItemListener . |
void |
setActionCommand(java.lang.String actionCommand)
Sets the action command of the SelectField . |
void |
setCellRenderer(ListCellRenderer newValue)
Sets the renderer for items. |
void |
setModel(SelectFieldModel newValue)
Sets the model of the SelectField . |
void |
setSelectedIndex(int index)
Sets the selected index. |
void |
setToolTipText(java.lang.String newValue)
Sets the default tool tip text. |
void |
setWidth(int newValue)
Sets the width of the SelectField . |
void |
setWidthUnits(int newValue)
Sets the width units of the SelectField . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PIXEL_UNITS
public static final int PERCENT_UNITS
public static final java.lang.String STYLE_WIDTH
public static final java.lang.String STYLE_WIDTH_UNITS
public static final java.lang.String CELL_RENDERER_CHANGED_PROPERTY
public static final java.lang.String LIST_DATA_CHANGED_PROPERTY
public static final java.lang.String WIDTH_CHANGED_PROPERTY
public static final java.lang.String WIDTH_UNITS_CHANGED_PROPERTY
private ListDataListener dataListener
private ListCellRenderer cellRenderer
private SelectFieldModel model
private java.lang.String actionCommand
private java.lang.String toolTipText
private int width
private int widthUnits
Constructor Detail |
public SelectField()
SelectField
.
public SelectField(java.lang.Object[] items)
SelectField
that will initially contain the
provided array of items.
items
- The items the SelectField
will initially
contain.public SelectField(SelectFieldModel model)
SelectField
with the provided model.
model
- The model for the SelectField
.Method Detail |
public void addActionListener(ActionListener l)
ActionListener
. The ActionListener
will be notified immediately when an item changes state.
l
- The ActionListener
to be added.public void addItemListener(ItemListener l)
ItemListener
.
l
- The ItemListener
to be added.public void applyStyle(Style style)
Component
Style
object. The version of this method in
Component
will set foreground and background colors
and the font from the style if they are present. Components
should override this method if they allow more properties to be
set from a style object, and should call super.applyStyle() if
necessary.
applyStyle
in class Component
style
- The style object from which to retrieve properties
for this Component
.Component.applyStyle(nextapp.echo.Style)
public void fireActionEvent()
protected void fireItemStateChanged(ItemEvent e)
ItemEvent
.
e
- The ItemEvent
of which to notify the listeners.public java.lang.String getActionCommand()
SelectField
.
public ListCellRenderer getCellRenderer()
public SelectFieldModel getModel()
SelectField
.
SelectField
.public java.lang.Object getSelectedItem()
public int getSelectedIndex()
public java.lang.String getToolTipText()
ToolTipSupport
getToolTipText
in interface ToolTipSupport
ToolTipSupport.getToolTipText()
public int getWidth()
SelectField
.
SelectField
.public int getWidthUnits()
SelectField
.
SelectField
,
one of the following values:
PIXEL_UNITS
(the default)PERCENT_UNITS
public boolean hasActionListeners()
public void removeActionListener(ActionListener l)
ActionListener
.
l
- The ActionListener
to be removed.public void removeItemListener(ItemListener l)
ItemListener
.
l
- The ItemListener
to be removed.public void setActionCommand(java.lang.String actionCommand)
SelectField
.
actionCommand
- The new action command.public void setCellRenderer(ListCellRenderer newValue)
newValue
- The new renderer for items.public void setModel(SelectFieldModel newValue)
SelectField
.
newValue
- The new model for the SelectField
.public void setSelectedIndex(int index)
index
- The new selected index.public void setToolTipText(java.lang.String newValue)
ToolTipSupport
setToolTipText
in interface ToolTipSupport
newValue
- The new tool tip text.ToolTipSupport.setToolTipText(String)
public void setWidth(int newValue)
SelectField
.
newValue
- The new width.public void setWidthUnits(int newValue)
SelectField
.
newValue
- The new width units, one of the following values:
PIXEL_UNITS
(the default)PERCENT_UNITS
|
NextApp Echo 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |