com.ccg.swing
Class LookupINIComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.ccg.swing.LookupINIComboBoxModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel, MutableComboBoxModel

public class LookupINIComboBoxModel
extends AbstractListModel
implements MutableComboBoxModel

A swing style "model wrapper" around the LookupINI class.

This object provides the standard swing style "model wrapper" for the LookupINI class. This allows one to pass LookupINI objects to JComboBox style swing components (probably list style components as well).

This then allows the user to select from the sections available in the associated LookupINI object.

This implementation also provides support for adding and removing sections (though the remove sections needs to be worked on a bit).

Since:
1.0
Version:
$Revision: 1.7 $
Author:
$Author: pkb $
See Also:
LookupINISectionEditor, Serialized Form

Field Summary
(package private)  Vector _SectionNames
           
(package private)  int _SelectedIndex
           
(package private)  String _SelectedObject
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
LookupINIComboBoxModel(LookupINI ini)
          Construct the object with an associated LookupINI object.
 
Method Summary
 void addElement(Object o)
           
 Object getElementAt(int i)
           
 LookupINI getLookupINI()
          Get the LookupINI object we are providing a model of
 Object getSelectedItem()
           
 int getSize()
           
 void insertElementAt(Object o, int i)
           
 void removeElement(Object o)
           
 void removeElementAt(int i)
           
 void removeRange(int i0, int i1)
           
 void setLookupINI(LookupINI ini)
          Reload with the contents of a new LookupINI object.
 void setSelectedItem(Object o)
           
 
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, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

_SectionNames

Vector _SectionNames

_SelectedIndex

int _SelectedIndex

_SelectedObject

String _SelectedObject
Constructor Detail

LookupINIComboBoxModel

public LookupINIComboBoxModel(LookupINI ini)
Construct the object with an associated LookupINI object.

This method is used to construct the model with an associated LookupINI object.

Parameters:
ini - The LookupINI object to associate with this object - must NOT be null.
Since:
1.0
See Also:
JComboBox
Method Detail

getLookupINI

public LookupINI getLookupINI()
Get the LookupINI object we are providing a model of

Returns:
Current LookupINI value assigned.

setLookupINI

public void setLookupINI(LookupINI ini)
Reload with the contents of a new LookupINI object.

This method is used to load the model with an associated LookupINI object.

Parameters:
ini - The LookupINI object to associate with this object - must NOT be null.
Since:
1.0
See Also:
JComboBox

getElementAt

public Object getElementAt(int i)
Specified by:
getElementAt in interface ListModel

getSize

public int getSize()
Specified by:
getSize in interface ListModel

addElement

public void addElement(Object o)
Specified by:
addElement in interface MutableComboBoxModel

removeElement

public void removeElement(Object o)
Specified by:
removeElement in interface MutableComboBoxModel

removeRange

public void removeRange(int i0,
                        int i1)

insertElementAt

public void insertElementAt(Object o,
                            int i)
Specified by:
insertElementAt in interface MutableComboBoxModel

removeElementAt

public void removeElementAt(int i)
Specified by:
removeElementAt in interface MutableComboBoxModel

setSelectedItem

public void setSelectedItem(Object o)
Specified by:
setSelectedItem in interface ComboBoxModel

getSelectedItem

public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel


Copyright 1998-1998-2006 null. All Rights Reserved.