|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
wt.clients.widgets.BaseSelector
wt.clients.widgets.ListSelector
This is a List Selector. The selection of the list can be set to single/multi selection mode. ListSelection events are transmitted to all the registered ListSelectionListeners.
Supported API:true
Extendable:false
Nested Class Summary |
Nested classes inherited from class wt.clients.widgets.BaseSelector |
BaseSelector.SelectCancelPanel |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
private static boolean |
debug
|
protected ListSelectorList |
list
|
protected ListSelectorModel |
listModel
|
static String |
MAX_LEN
|
protected boolean |
notifyEnabled
|
static int |
NUM_VISIBLE_ROW
|
protected ListSelectorListRenderer |
renderer
|
Fields inherited from class wt.clients.widgets.BaseSelector |
BASE_RESOURCE, baseSelectorTitle, canceled, editorDialog, errorDialogTitle, id, modelDialogFlag, multiSelection, resource, selected, selectorListenerManager, statusBarHost, warningDialogTitle |
Fields inherited from class javax.swing.JPanel |
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ListSelector()
Constructs a ListSelector |
Method Summary | |
void |
addToList(Object obj)
Adds an item into the list |
void |
addValue(Object obj)
Add the object to the selector. |
void |
clearSelection()
Clears the selection |
private ListSelectorList |
createList()
Creates a JList |
protected ListSelectorModel |
createModel()
|
ListCellRenderer |
getCellRenderer()
Returns the current list cell renderer |
int |
getCount()
Returns the no of items in the list |
Object |
getFirstSelected()
Returns the value for the selected cell |
Font |
getListFont()
|
ListSelectorModel |
getModel()
|
int |
getSelectedIndex()
Returns the index of the selected item |
int[] |
getSelectedIndices()
Returns an array of the indices of the items selected |
Vector |
getSelectedValues()
Returns an array of values for the selected cells |
int |
getSelectionMode()
Returns the selection mode |
boolean |
isEmpty()
Checks if the list is empty |
boolean |
isEquivalent(Object obj1,
Object obj2)
|
boolean |
isSelectedIndex(int index)
Returns true if the specified index is selected |
void |
removeFromList(int index)
Removes an item from the list Remove the object from the list |
void |
removeFromList(Object obj)
Removes an item from the list Remove an element from the list |
void |
removeFromList(Vector objs)
Removes an item from the list Removes a Vector of objects from the list |
void |
removeValue(Object obj)
Remove the object from the selector. |
void |
setCellRenderer(ListCellRenderer renderer)
Sets the list cell renderer to the new one provided |
private void |
setComponents()
Places the list in a ScrollPane and registers all listSelectionListeners to the list's listSelectionEvent |
void |
setListData(Object[] listData)
|
void |
setListData(Vector listData)
Sets the items to be displayed in the list |
void |
setListFont(Font font)
Set the list font |
void |
setModel(ListSelectorModel model)
|
void |
setMultiSelect(boolean b)
Set the multi-select mode. |
void |
setSelectedIndex(int index)
Selects an item in the list |
void |
setSelectedIndices(int[] indices)
Selects a list of items in the list |
void |
setSelectedValue(Object object)
Select an item in the list and scroll to display the selected object |
void |
setSelectedValue(Object object,
boolean shouldScroll)
Select an item in the list |
void |
setSelectedValues(Vector v)
If the selector is set to have multiple selection, then the elements inside the vector will be selected in the selector. |
void |
setSelectionMode(int mode)
Determines whether single-item or multiple-item selections are allowed. |
void |
setVisibleRowCount(int numRow)
Set the preferred no of rows that is to be displayed without a scrollbar |
Methods inherited from class wt.clients.widgets.BaseSelector |
addSelectorListener, clearAllStatusMessages, fireSelectionChangedEvent, getContext, initResource, isModalDialog, isMultiSelect, removeSelectorListener, setBusy, setStatusBarHost, showAsModalSelectorDialog, showAsModalSelectorDialog, showAsModalSelectorDialog |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final boolean debug
protected ListSelectorList list
protected ListSelectorListRenderer renderer
protected ListSelectorModel listModel
protected boolean notifyEnabled
public static final String MAX_LEN
public static final int NUM_VISIBLE_ROW
Constructor Detail |
public ListSelector()
Method Detail |
private void setComponents()
public void setModel(ListSelectorModel model)
public ListSelectorModel getModel()
protected ListSelectorModel createModel()
private ListSelectorList createList()
public void setListData(Object[] listData)
public void setListData(Vector listData)
listData
- a Vector of Objects containing the items to display
in the listpublic boolean isEmpty()
public void addToList(Object obj)
public void removeFromList(Object obj)
public void removeFromList(Vector objs)
public void removeFromList(int index)
index
- from where the object is to be removedpublic int getCount()
public Object getFirstSelected()
getFirstSelected
in interface SelectorInterface
getFirstSelected
in class BaseSelector
public Vector getSelectedValues()
getSelectedValues
in interface SelectorInterface
getSelectedValues
in class BaseSelector
public ListCellRenderer getCellRenderer()
public void setCellRenderer(ListCellRenderer renderer)
public void setSelectionMode(int mode)
mode
- an int specifying the type of selections
Selection modes:
SINGLE_SELECTION ListSelectionModel.SINGLE_SELECTION
SINGLE_INTERVAL_SELECTION ListSelectionModel.SINGLE_INTERVAL_SELECTION
MULTIPLE_INTERVAL_SELECTION ListSelectionModel.MULTIPLE_INTERVAL_SELECTIONpublic int getSelectionMode()
public void setSelectedIndex(int index)
index
- The index of item that is to be selectedpublic int getSelectedIndex()
public void setSelectedIndices(int[] indices)
indices
- an array of indices to be selectedpublic int[] getSelectedIndices()
public boolean isSelectedIndex(int index)
public void setSelectedValue(Object object, boolean shouldScroll)
object
- the Object to selectshouldScroll
- true if the list should scroll to display
the selected objectpublic void setSelectedValue(Object object)
setSelectedValue
in interface SelectorInterface
setSelectedValue
in class BaseSelector
object
- the Object to selectpublic void setVisibleRowCount(int numRow)
numRow
- the no of rowspublic void clearSelection()
public void setListFont(Font font)
font
- list fontpublic Font getListFont()
public void addValue(Object obj)
SelectorInterface
addValue
in interface SelectorInterface
addValue
in class BaseSelector
public void removeValue(Object obj)
SelectorInterface
removeValue
in interface SelectorInterface
removeValue
in class BaseSelector
public void setSelectedValues(Vector v)
SelectorInterface
setSelectedValues
in interface SelectorInterface
setSelectedValues
in class BaseSelector
public void setMultiSelect(boolean b)
SelectorInterface
setMultiSelect
in interface SelectorInterface
setMultiSelect
in class BaseSelector
public boolean isEquivalent(Object obj1, Object obj2)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |