yu.ac.bg.etf.javaqx.qswing
Class DefaultComboBoxModel

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.list.AbstractListModel
      extended byyu.ac.bg.etf.javaqx.qswing.DefaultComboBoxModel
All Implemented Interfaces:
ComboBoxModel, ListModel, MutableComboBoxModel

public class DefaultComboBoxModel
extends AbstractListModel
implements MutableComboBoxModel

Default ComboBox Model.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
protected  java.util.ArrayList items
           
protected  java.lang.Object selectedItem
           
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.list.AbstractListModel
listenerList
 
Constructor Summary
DefaultComboBoxModel()
          Constructs new DefaultComboBoxModel object.
DefaultComboBoxModel(java.util.ArrayList items)
          Constructs new DefaultComboBoxModel object.
DefaultComboBoxModel(java.lang.Object[] objects)
          Constructs new DefaultComboBoxModel object.
DefaultComboBoxModel(java.util.Vector vector)
          Constructs new DefaultComboBoxModel object.
 
Method Summary
 void addElement(java.lang.Object object)
          Adds specified object to the model.
 java.lang.Object getElementAt(int index)
          Returns the element at the specified index.
 int getIndexOf(java.lang.Object object)
          Returns the index of the specified element.
 java.lang.Object getSelectedItem()
          Returns selected item.
 int getSize()
          Returns the size of the list.
 void insertElementAt(java.lang.Object object, int index)
          Inserts specified object at the specified index.
 void removeAllElements()
          Removes all elements.
 void removeElement(java.lang.Object object)
          Removes specified object from the model.
 void removeElementAt(int index)
          Removes object specified by index.
 void setSelectedItem(java.lang.Object item)
          Selects item.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.list.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface yu.ac.bg.etf.javaqx.qswing.list.ListModel
addListDataListener, removeListDataListener
 

Field Detail

items

protected java.util.ArrayList items

selectedItem

protected java.lang.Object selectedItem
Constructor Detail

DefaultComboBoxModel

public DefaultComboBoxModel(java.lang.Object[] objects)
Constructs new DefaultComboBoxModel object.

Parameters:
objects - the objects

DefaultComboBoxModel

public DefaultComboBoxModel(java.util.Vector vector)
Constructs new DefaultComboBoxModel object.

Parameters:
vector - the vector

DefaultComboBoxModel

public DefaultComboBoxModel(java.util.ArrayList items)
Constructs new DefaultComboBoxModel object.

Parameters:
items - the items

DefaultComboBoxModel

public DefaultComboBoxModel()
Constructs new DefaultComboBoxModel object.

Method Detail

getIndexOf

public int getIndexOf(java.lang.Object object)
Returns the index of the specified element.

Parameters:
object - the element
Returns:
the index of the specified element

removeAllElements

public void removeAllElements()
Removes all elements.


getSize

public int getSize()
Returns the size of the list.

Specified by:
getSize in interface ListModel
Returns:
the size of the list

getElementAt

public java.lang.Object getElementAt(int index)
Returns the element at the specified index.

Specified by:
getElementAt in interface ListModel
Parameters:
index - the element index
Returns:
the element at the specified index

addElement

public void addElement(java.lang.Object object)
Adds specified object to the model.

Specified by:
addElement in interface MutableComboBoxModel
Parameters:
object - the object to be added

insertElementAt

public void insertElementAt(java.lang.Object object,
                            int index)
Inserts specified object at the specified index.

Specified by:
insertElementAt in interface MutableComboBoxModel
Parameters:
object - the object to insert
index - the object index

removeElementAt

public void removeElementAt(int index)
Removes object specified by index.

Specified by:
removeElementAt in interface MutableComboBoxModel
Parameters:
index - the object index

removeElement

public void removeElement(java.lang.Object object)
Removes specified object from the model.

Specified by:
removeElement in interface MutableComboBoxModel
Parameters:
object - the object to be removed

getSelectedItem

public java.lang.Object getSelectedItem()
Returns selected item.

Specified by:
getSelectedItem in interface ComboBoxModel
Returns:
selected item

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Selects item.

Specified by:
setSelectedItem in interface ComboBoxModel
Parameters:
item - the item


Copyright © 2007 ETF and contributors. All Rights Reserved.