org.tbee.swing.jdbc
Class JdbcComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.tbee.swing.jdbc.JdbcListModel
          extended by org.tbee.swing.jdbc.JdbcComboBoxModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel, TableModelValueWrapper.ValueWrapperFactory

public class JdbcComboBoxModel
extends JdbcListModel
implements ComboBoxModel

Extends the JdbcListModel for usage with the ComboBoxModel. Note: if this is used within a JTable, make sure it is registered as a ValueWrapper: table.setValueWrapper(c, comboBoxModel);

Version:
$Revision: 1.7 $
See Also:
Serialized Form

Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
JdbcComboBoxModel(Connection connection, String sql, boolean hideFirstColumn)
          Derrived from JdbcListModel
JdbcComboBoxModel(Connection connection, String sql, boolean hideFirstColumn, boolean cached)
          Derrived from JdbcListModel
 
Method Summary
 Object getSelectedItem()
          Implements the method in the ComboBoxModel interface
 void setSelectedItem(Object item)
          Implements the method in the ComboBoxModel interface This method receives the key of the
 
Methods inherited from class org.tbee.swing.jdbc.JdbcListModel
finalize, getElementAt, getSize, reload, wrap
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

JdbcComboBoxModel

public JdbcComboBoxModel(Connection connection,
                         String sql,
                         boolean hideFirstColumn)
                  throws SQLException
Derrived from JdbcListModel

Parameters:
connection -
sql -
hideFirstColumn -
Throws:
SQLException

JdbcComboBoxModel

public JdbcComboBoxModel(Connection connection,
                         String sql,
                         boolean hideFirstColumn,
                         boolean cached)
                  throws SQLException
Derrived from JdbcListModel

Parameters:
connection -
sql -
hideFirstColumn -
Throws:
SQLException
Method Detail

getSelectedItem

public Object getSelectedItem()
Implements the method in the ComboBoxModel interface

Specified by:
getSelectedItem in interface ComboBoxModel
Returns:
Object
See Also:
ComboBoxModel.getSelectedItem()

setSelectedItem

public void setSelectedItem(Object item)
Implements the method in the ComboBoxModel interface This method receives the key of the

Specified by:
setSelectedItem in interface ComboBoxModel
See Also:
ComboBoxModel.setSelectedItem(java.lang.Object)


Copyright © 2011 KnowledgePlaza. All Rights Reserved.