Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.cdm
Class DynamicListModel  view DynamicListModel download DynamicListModel.java

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byjavax.swing.DefaultListModel
          extended byorg.greenstone.gatherer.cdm.DynamicListModel
All Implemented Interfaces:
javax.swing.ComboBoxModel, javax.swing.ListModel, java.io.Serializable
Direct Known Subclasses:
MetadataSetManager, MetadataSetView

public class DynamicListModel
extends javax.swing.DefaultListModel
implements javax.swing.ComboBoxModel

This class extends the functionality of the DefaultListModel to include simple methods for refreshing the contents of this model if one of its elements changes.

Version:
2.3

Field Summary
private  boolean auto_order
           
private  java.lang.Object object
           
 
Fields inherited from class javax.swing.DefaultListModel
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
DynamicListModel()
           
 
Method Summary
 void addElement(java.lang.Object element)
          Inserts an element at the end of the list.
 java.lang.Object getSelectedItem()
          The method returns currently selected item in the combo box
 void refresh()
          Notify all controls that are based on this list model that its contents have changed, and they should repaint themselves.
 void setAutoOrder(boolean auto_order)
           
 void setSelectedItem(java.lang.Object object)
          This method sets the selected item in the combo box.
 
Methods inherited from class javax.swing.DefaultListModel
add, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Field Detail

auto_order

private boolean auto_order

object

private java.lang.Object object
Constructor Detail

DynamicListModel

public DynamicListModel()
Method Detail

addElement

public void addElement(java.lang.Object element)
Description copied from class: javax.swing.DefaultListModel
Inserts an element at the end of the list. This is equivalent to calling list.add(list.size(), element).


getSelectedItem

public java.lang.Object getSelectedItem()
Description copied from interface: javax.swing.ComboBoxModel
The method returns currently selected item in the combo box

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

refresh

public void refresh()
Notify all controls that are based on this list model that its contents have changed, and they should repaint themselves.


setAutoOrder

public void setAutoOrder(boolean auto_order)

setSelectedItem

public void setSelectedItem(java.lang.Object object)
Description copied from interface: javax.swing.ComboBoxModel
This method sets the selected item in the combo box. Class implementing this interface should fire ListDataEvents to all registered ListDataListeners to indicated that the selection has changed.

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel