|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.SComponent
org.wings.SComboBox
public class SComboBox
Combobox widget to be used inside SForm elements.
ComboBoxModel,
SListCellRenderer,
Serialized Form| Field Summary | |
|---|---|
protected String |
actionCommand
action command to fire |
protected ComboBoxModel |
dataModel
The model. |
protected int |
maximumRowCount
how many rows are displayed in the popup window |
protected SListCellRenderer |
renderer
The renderer used for cell rendering each cell. |
protected Object |
selectedItemReminder
This protected field is implementation specific. |
| Fields inherited from class org.wings.SComponent |
|---|
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME |
| Constructor Summary | |
|---|---|
SComboBox()
Creates a SComboBox with a default data model. |
|
SComboBox(ComboBoxModel model)
Creates a SComboBox that takes its items from an existing ComboBoxModel. |
|
SComboBox(Object[] items)
Creates a SComboBox that contains the elements in the specified array. |
|
SComboBox(Vector items)
Creates a SComboBox that contains the elements in the specified Vector. |
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener listener)
Adds an ActionListener. |
void |
addItem(Object object)
Adds an item to the item list. |
void |
addItemListener(ItemListener listener)
Adds an ItemListener. |
void |
contentsChanged(ListDataEvent e)
This method is public as an implementation side effect. |
protected void |
fireActionEvent()
Notify all listeners that have registered as ActionListeners if the selected item has changed |
void |
fireFinalEvents()
Internal event trigger used by CGs. |
void |
fireIntermediateEvents()
fire events which describes a "in progress" state change, like TreeWillExpand, or ListSelectionEvent with getIsAdjusting() true, ... |
protected void |
fireItemStateChanged(ItemEvent e)
Notify all listeners that have registered as ItemListeners. |
String |
getActionCommand()
Returns the action commnand that is included in the event sent to action listeners. |
ActionListener[] |
getActionListeners()
Returns an array of all the ActionListeners added to this SComboBox |
SCellRendererPane |
getCellRendererPane()
|
Object |
getItemAt(int index)
Returns the list item at the specified index. |
int |
getItemCount()
Returns the number of items in the list. |
ItemListener[] |
getItemListeners()
Returns an array of all the ItemListeners added to this SComboBox |
int |
getMaximumRowCount()
Returns the size-attribute |
ComboBoxModel |
getModel()
Returns the data model currently used by the SComboBox. |
SListCellRenderer |
getRenderer()
|
int |
getSelectedIndex()
Returns the index of the currently selected item in the list. |
Object |
getSelectedItem()
Returns the currently selected item. |
Object[] |
getSelectedObjects()
Returns an array containing the selected item. |
String |
getSelectionParameter(int index)
|
void |
insertItemAt(Object object,
int index)
Inserts an item into the item list at a given index. |
void |
intervalAdded(ListDataEvent e)
Invoked when items have been added to the internal data model. |
void |
intervalRemoved(ListDataEvent e)
Invoked when values have been removed from the data model. |
boolean |
isEpochCheckEnabled()
Asks the low-level event listener if epoch checking should be perfomed on it. |
void |
processLowLevelEvent(String action,
String[] values)
Deliver low level/http events (parameters). |
void |
removeActionListener(ActionListener listener)
Removes an ActionListener |
void |
removeAllItems()
Removes all items from the item list. |
void |
removeItem(Object object)
Removes an item from the item list. |
void |
removeItemAt(int index)
Removes the item at index |
void |
removeItemListener(ItemListener listener)
Removes an ItemListener |
protected void |
selectedItemChanged()
This protected method is implementation specific. |
void |
setActionCommand(String command)
Sets the action commnand that should be included in the event sent to action listeners. |
void |
setCG(ComboBoxCG cg)
|
void |
setEpochCheckEnabled(boolean epochCheckEnabled)
|
void |
setMaximumRowCount(int count)
Sets the maximum number of rows the SComboBox displays. |
void |
setModel(ComboBoxModel model)
Sets the data model that the SComboBox uses to obtain the list of items. |
void |
setParent(SContainer p)
Sets the parent container. |
protected void |
setParentFrame(SFrame f)
Sets the parent frame. |
void |
setRenderer(SListCellRenderer newRenderer)
|
void |
setSelectedIndex(int index)
Selects the item at index index. |
void |
setSelectedItem(Object object)
Sets the selected item in the SComboBox. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.wings.LowLevelEventListener |
|---|
getLowLevelEventId, getName, isEnabled |
| Field Detail |
|---|
protected ComboBoxModel dataModel
ComboBoxModelprotected SListCellRenderer renderer
SListCellRendererprotected int maximumRowCount
protected String actionCommand
protected Object selectedItemReminder
| Constructor Detail |
|---|
public SComboBox(ComboBoxModel model)
model - the ComboBoxModel that provides the displayed list of itemspublic SComboBox(Object[] items)
public SComboBox(Vector items)
public SComboBox()
addItem to add items.
| Method Detail |
|---|
public void setModel(ComboBoxModel model)
model - the ComboBoxModel that provides the displayed list of itemspublic final ComboBoxModel getModel()
public void setMaximumRowCount(int count)
count - size-attributepublic int getMaximumRowCount()
public void setRenderer(SListCellRenderer newRenderer)
newRenderer - the SListCellRenderer that displays the selected item.public SListCellRenderer getRenderer()
public void setSelectedItem(Object object)
object - the list object to selectpublic Object getSelectedItem()
public void setSelectedIndex(int index)
index.
index - the item to be selectedpublic int getSelectedIndex()
public void addItem(Object object)
object - the Object to add to the list
public void insertItemAt(Object object,
int index)
object - the Object to add to the listindex - an int specifying the position at which to add the itempublic void removeItem(Object object)
object - the object to remove from the item listpublic void removeItemAt(int index)
index
index - an int specifying the idex of the item to remove, where 0
indicates the first item in the listpublic void removeAllItems()
public void addItemListener(ItemListener listener)
addItemListener in interface ItemSelectablelistener - the ItemListener that is to be notifiedpublic void removeItemListener(ItemListener listener)
removeItemListener in interface ItemSelectablelistener - the ItemListener to removepublic ItemListener[] getItemListeners()
public void addActionListener(ActionListener listener)
listener - the ActionListener that is to be notifiedpublic void removeActionListener(ActionListener listener)
listener - the ActionListener to removepublic ActionListener[] getActionListeners()
public void setActionCommand(String command)
command - a string containing the "command" that is sent
to action listeners. The same listener can then
do different things depending on the command it
receives.public String getActionCommand()
protected void fireItemStateChanged(ItemEvent e)
EventListenerListprotected void fireActionEvent()
EventListenerListpublic Object[] getSelectedObjects()
getSelectedObjects in interface ItemSelectablepublic void contentsChanged(ListDataEvent e)
contentsChanged in interface ListDataListenerListDataListenerpublic void intervalAdded(ListDataEvent e)
intervalAdded in interface ListDataListenerListDataListenerpublic void intervalRemoved(ListDataEvent e)
intervalRemoved in interface ListDataListenerListDataListenerpublic int getItemCount()
public Object getItemAt(int index)
index - an int indicating the list position
protected void selectedItemChanged()
public void processLowLevelEvent(String action,
String[] values)
LowLevelEventListener
processLowLevelEvent in interface LowLevelEventListenerprocessLowLevelEvent in class SComponentaction - the name-value-pair's namevalues - the name-value-pair's valuespublic void setParent(SContainer p)
SComponent
setParent in class SComponentp - the containerprotected void setParentFrame(SFrame f)
SComponent
setParentFrame in class SComponentf - the framepublic void fireIntermediateEvents()
LowLevelEventListener
fireIntermediateEvents in interface LowLevelEventListenerpublic void fireFinalEvents()
SComponent
fireFinalEvents in interface LowLevelEventListenerfireFinalEvents in class SComponentpublic boolean isEpochCheckEnabled()
LowLevelEventListenertrue the Dispatcher will ignore request originating from old views
(typically iniated by triggering browser back and clicking somewhere.)
isEpochCheckEnabled in interface LowLevelEventListenertrue if epoch checking should be perfomed, false
if all request for this component should be processed.LowLevelEventListener.isEpochCheckEnabled()public void setEpochCheckEnabled(boolean epochCheckEnabled)
LowLevelEventListener.isEpochCheckEnabled()public final SCellRendererPane getCellRendererPane()
public void setCG(ComboBoxCG cg)
public String getSelectionParameter(int index)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||