public class ComponentListWidget<E extends ModelComponent> extends javax.swing.AbstractListModel implements SelectionListener, javax.swing.event.ListSelectionListener
Constructor and Description |
---|
ComponentListWidget(ListView<E> list,
CompositeComponent ancestor) |
Modifier and Type | Method and Description |
---|---|
E |
get(int idx)
Get the component at the specified position.
|
CompositeComponent |
getAncestor()
Returns the ancestor component associated with this component list.
|
java.lang.Object |
getElementAt(int idx)
Get the string name of the component at the specified location in the
list.
|
javax.swing.JList |
getJList() |
int |
getSize()
Returns the number of components in the list.
|
void |
selectionChanged(SelectionEvent e) |
void |
setAncestor(CompositeComponent ancestor)
Sets the ancestor component associated with this component list.
|
void |
setSelectionManager(SelectionManager manager) |
E[] |
toArray(E[] dummy)
Get an array of the components in the list.
|
void |
update() |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Handles selection events produced by the JList.
|
public ComponentListWidget(ListView<E> list, CompositeComponent ancestor)
public CompositeComponent getAncestor()
public void setAncestor(CompositeComponent ancestor)
ancestor
- new componentpublic java.lang.Object getElementAt(int idx)
getElementAt
in interface javax.swing.ListModel
public int getSize()
getSize
in interface javax.swing.ListModel
public E get(int idx)
idx
- The index of the component in the list.public void update()
public void setSelectionManager(SelectionManager manager)
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void selectionChanged(SelectionEvent e)
selectionChanged
in interface SelectionListener
public javax.swing.JList getJList()