org.jdesktop.binding.swingx.adapter
Class TabularDataMetaData

java.lang.Object
  extended by org.jdesktop.binding.swingx.adapter.TabularDataMetaData
Direct Known Subclasses:
HierarchicalDataMetaData

public class TabularDataMetaData
extends java.lang.Object

This class will be going away once the DOMAdapter converts its API to use org.jdesktop.swing.data.MetaData.

Version:
1.0

Constructor Summary
TabularDataMetaData()
          Creates a new meta data object with 0 columns.
TabularDataMetaData(int columnCount)
          Creates a new meta data object with the specified number of columns
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds the specified property change listener to this meta data.
 java.lang.Class getColumnClass(int columnIndex)
           
 Converter getColumnConverter(int columnIndex)
           
 int getColumnCount()
           
 int getColumnDisplaySize(int columnIndex)
           
 int getColumnIndex(java.lang.String name)
           
 java.lang.String getColumnLabel(int columnIndex)
           
 java.lang.Object getColumnMaximum(int columnIndex)
           
 java.lang.Object getColumnMinimum(int columnIndex)
           
 java.lang.String getColumnName(int columnIndex)
           
 java.util.Iterator getColumnValues(int columnIndex)
           
 boolean isColumnNullable(int columnIndex)
           
 boolean isColumnWritable(int columnIndex)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the specified property change listener from this meta data.
 void setColumnClass(int columnIndex, java.lang.Class columnClass)
          Sets the column class at the specified index
 void setColumnConverter(int columnIndex, Converter converter)
          Sets the converter object to be used when converting values in the column to and from String.
 void setColumnCount(int columnCount)
          Initializes the number of columns in this meta data object.
 void setColumnDisplaySize(int columnIndex, int numChars)
           
 void setColumnLabel(int columnIndex, java.lang.String columnLabel)
          Sets the column label at the specified index.
 void setColumnMaximum(int columnIndex, java.lang.Object maximum)
          Sets the maximum value for values in the column.
 void setColumnMinimum(int columnIndex, java.lang.Object minimum)
          Sets the minimum value for values in the column.
 void setColumnName(int columnIndex, java.lang.String columnName)
          Sets the column name at the specified index
 void setColumnNullable(int columnIndex, boolean nullable)
          Sets whether or not values in the column may have a null value.
 void setColumnValues(int columnIndex, java.lang.Object[] values)
          Sets the set of valid values for this column.
 void setColumnWritable(int columnIndex, boolean writable)
          Sets whether or not values in the column at the specified index may be modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabularDataMetaData

public TabularDataMetaData()
Creates a new meta data object with 0 columns.


TabularDataMetaData

public TabularDataMetaData(int columnCount)
Creates a new meta data object with the specified number of columns

Parameters:
columnCount - integer containing the number of columns
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified property change listener to this meta data. This listener will be notified when either the number of columns change or properties on the columns are modified.

Parameters:
listener - PropertyChangeListener to be notified when meta data changes

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener from this meta data.

Parameters:
listener - PropertyChangeListener to be notified when meta data changes

setColumnCount

public void setColumnCount(int columnCount)
Initializes the number of columns in this meta data object. If columns already exist when this method is called, they are discarded.

Parameters:
columnCount - integer containing the number of columns

getColumnCount

public int getColumnCount()
Returns:
the number of columns

getColumnIndex

public int getColumnIndex(java.lang.String name)

getColumnName

public java.lang.String getColumnName(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
String containing the column name at the specified index

setColumnName

public void setColumnName(int columnIndex,
                          java.lang.String columnName)
Sets the column name at the specified index

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
columnName - String containing the column name at the specified inde

getColumnLabel

public java.lang.String getColumnLabel(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
String containing the column label at the specified index

setColumnLabel

public void setColumnLabel(int columnIndex,
                           java.lang.String columnLabel)
Sets the column label at the specified index. The label is used to display this column to the end-user and should be localized.

Parameters:
columnIndex - index of the column (first is 1, second is 2...)
columnLabel - the column text to set

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
Class representing the column's type

setColumnClass

public void setColumnClass(int columnIndex,
                           java.lang.Class columnClass)
Sets the column class at the specified index

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
columnClass - Class representing the column's type

setColumnDisplaySize

public void setColumnDisplaySize(int columnIndex,
                                 int numChars)

getColumnDisplaySize

public int getColumnDisplaySize(int columnIndex)

isColumnWritable

public boolean isColumnWritable(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
boolean indicating whether or not values in this column may be modified

setColumnWritable

public void setColumnWritable(int columnIndex,
                              boolean writable)
Sets whether or not values in the column at the specified index may be modified.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
writable - boolean indicating whether or not values in this column may be modified

isColumnNullable

public boolean isColumnNullable(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
boolean indicating whether or not values in this column may be null

setColumnNullable

public void setColumnNullable(int columnIndex,
                              boolean nullable)
Sets whether or not values in the column may have a null value.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
nullable - boolean indicating whether or not values in the column may be null

getColumnMinimum

public java.lang.Object getColumnMinimum(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
Object representing minimum value for values in the column, or null if no minimum value constraint exists

setColumnMinimum

public void setColumnMinimum(int columnIndex,
                             java.lang.Object minimum)
Sets the minimum value for values in the column. This may be used to provide optimal UI controls for editing to minimize erroneous input.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
minimum - Object representing minimum value for values in the column, or null if no minimum value constraint exists

getColumnMaximum

public java.lang.Object getColumnMaximum(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
Object representing maximum value for values in the column, or null if no maximum value constraint exists

setColumnMaximum

public void setColumnMaximum(int columnIndex,
                             java.lang.Object maximum)
Sets the maximum value for values in the column. This may be used to provide optimal UI controls for editing to minimize erroneous input.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
maximum - Object representing maximum value for values in the column, or null if no maximum value constraint exists

getColumnValues

public java.util.Iterator getColumnValues(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
Iterator containing the set of valid values for this column, or null if the value is not constrained by a set

setColumnValues

public void setColumnValues(int columnIndex,
                            java.lang.Object[] values)
Sets the set of valid values for this column. This may be used to provide optimal UI controls (picklist) for editing to minimize erroneous input.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
values - array containing set of valid values, or null if no value set constraint exists

setColumnConverter

public void setColumnConverter(int columnIndex,
                               Converter converter)
Sets the converter object to be used when converting values in the column to and from String.

Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
converter - DataConverter object used to convert values in column to and from String

getColumnConverter

public Converter getColumnConverter(int columnIndex)
Parameters:
columnIndex - integer index of the column (first is 1, second is 2...)
Returns:
Converter object used to convert values in column to and from String, or null if no converter was specified


Copyright © 2005 Sun Microsystems All Rights Reserved.