com.nqadmin.swingSet.formatting.helpers
Class SSFormattedComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.nqadmin.swingSet.formatting.helpers.SSFormattedComboBoxModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.MutableComboBoxModel

public class SSFormattedComboBoxModel
extends javax.swing.AbstractListModel
implements javax.swing.MutableComboBoxModel, java.io.Serializable

It is not recommended to use this class as there could be drastic changes to this classes API.

Author:
dags
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
SSFormattedComboBoxModel()
          Creates a new instance of FormattedComboBoxModel
SSFormattedComboBoxModel(SSConnection ssConnection, java.lang.String table, java.lang.String dataColumn, java.lang.String listColumn, java.lang.String orderBy)
           
SSFormattedComboBoxModel(java.lang.String table, java.lang.String dataColumn, java.lang.String listColumn)
           
SSFormattedComboBoxModel(java.lang.String table, java.lang.String dataColumn, java.lang.String listColumn, java.lang.String orderBy)
           
 
Method Summary
 void addElement(java.lang.Object ob)
           
 void execute()
           
 java.lang.String getDataColumn()
          Getter for property dataColumn.
 java.lang.Object getElementAt(int index)
           
 java.lang.String getListColumn()
          Getter for property listColumn.
 java.lang.String getOrderBy()
           
 java.lang.Object getSelectedBoundData(int index)
           
 java.lang.Object getSelectedItem()
           
 java.lang.String getSelectText()
          Getter for property selectText.
 int getSize()
           
 SSConnection getSsConnection()
          Deprecated.  
 SSConnection getSSConnection()
          Getter for property ssConnection.
 java.lang.String getTable()
          Getter for property table.
 int indexOf(java.lang.Object object)
           
 void insertElementAt(java.lang.Object obj, int index)
           
 void refresh()
           
 void removeElement(java.lang.Object obj)
           
 void removeElementAt(int index)
           
 void setDataColumn(java.lang.String dataColumn)
          Setter for property dataColumn.
 void setListColumn(java.lang.String listColumn)
          Setter for property listColumn.
 void setOrderBy(java.lang.String orderBy)
          Setter for property orderBy.
 void setSelectedItem(java.lang.Object anItem)
           
 void setSelectText(java.lang.String selectText)
          Setter for property selectText.
 void setSsConnection(SSConnection ssConnection)
          Deprecated.  
 void setSSConnection(SSConnection ssConnection)
          Setter for property ssConnection.
 void setTable(java.lang.String table)
          Setter for property table.
 
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
 

Constructor Detail

SSFormattedComboBoxModel

public SSFormattedComboBoxModel()
Creates a new instance of FormattedComboBoxModel


SSFormattedComboBoxModel

public SSFormattedComboBoxModel(java.lang.String table,
                                java.lang.String dataColumn,
                                java.lang.String listColumn)
Parameters:
table - - database table name
dataColumn - - name of the column containing the values of the items displayed in the list
listColumn - - column names whose values should be displayed in the list

SSFormattedComboBoxModel

public SSFormattedComboBoxModel(java.lang.String table,
                                java.lang.String dataColumn,
                                java.lang.String listColumn,
                                java.lang.String orderBy)
Parameters:
table - - database table name
dataColumn - - name of the column containing the values of the items displayed in the list
listColumn - - column names whose values should be displayed in the list
orderBy - - column name based on which the list items should be ordered

SSFormattedComboBoxModel

public SSFormattedComboBoxModel(SSConnection ssConnection,
                                java.lang.String table,
                                java.lang.String dataColumn,
                                java.lang.String listColumn,
                                java.lang.String orderBy)
Parameters:
ssConnection - - connection to be used for querying the database
table - - database table name
dataColumn - - name of the column containing the values of the items displayed in the list
listColumn - - column names whose values should be displayed in the list
orderBy - - column name based on which the list items should be ordered
Method Detail

indexOf

public int indexOf(java.lang.Object object)
Parameters:
object -
Returns:

refresh

public void refresh()

getSelectedBoundData

public java.lang.Object getSelectedBoundData(int index)
Parameters:
index -
Returns:

addElement

public void addElement(java.lang.Object ob)
Specified by:
addElement in interface javax.swing.MutableComboBoxModel

getDataColumn

public java.lang.String getDataColumn()
Getter for property dataColumn.

Returns:
Value of property dataColumn.

setDataColumn

public void setDataColumn(java.lang.String dataColumn)
Setter for property dataColumn.

Parameters:
dataColumn - New value of property dataColumn.

getListColumn

public java.lang.String getListColumn()
Getter for property listColumn.

Returns:
Value of property listColumn.

setListColumn

public void setListColumn(java.lang.String listColumn)
Setter for property listColumn.

Parameters:
listColumn - New value of property listColumn.

getTable

public java.lang.String getTable()
Getter for property table.

Returns:
Value of property table.

setTable

public void setTable(java.lang.String table)
Setter for property table.

Parameters:
table - New value of property table.

setOrderBy

public void setOrderBy(java.lang.String orderBy)
Setter for property orderBy.

Parameters:
orderBy - New value of orderBy property

getOrderBy

public java.lang.String getOrderBy()
Returns:

getSelectText

public java.lang.String getSelectText()
Getter for property selectText.

Returns:
Value of property selectText.

setSelectText

public void setSelectText(java.lang.String selectText)
Setter for property selectText.

Parameters:
selectText - New value of property selectText.

execute

public void execute()

getSsConnection

public SSConnection getSsConnection()
Deprecated. 

Getter for property ssConnection.

Returns:
Value of property ssConnection.

setSsConnection

public void setSsConnection(SSConnection ssConnection)
Deprecated. 

Setter for property ssConnection.

Parameters:
ssConnection - New value of property ssConnection.

getSSConnection

public SSConnection getSSConnection()
Getter for property ssConnection.

Returns:
Value of property ssConnection.

setSSConnection

public void setSSConnection(SSConnection ssConnection)
Setter for property ssConnection.

Parameters:
ssConnection - New value of property ssConnection.

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

setSelectedItem

public void setSelectedItem(java.lang.Object anItem)
Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel

getSelectedItem

public java.lang.Object getSelectedItem()
Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

removeElement

public void removeElement(java.lang.Object obj)
Specified by:
removeElement in interface javax.swing.MutableComboBoxModel

removeElementAt

public void removeElementAt(int index)
Specified by:
removeElementAt in interface javax.swing.MutableComboBoxModel

insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index)
Specified by:
insertElementAt in interface javax.swing.MutableComboBoxModel