Package org.jdesktop.swingbinding
Class JTableBinding.ColumnBinding
- java.lang.Object
-
- org.jdesktop.beansbinding.Binding
-
- org.jdesktop.swingbinding.impl.AbstractColumnBinding
-
- org.jdesktop.swingbinding.JTableBinding.ColumnBinding
-
- Enclosing class:
- JTableBinding<E,SS,TS>
public final class JTableBinding.ColumnBinding extends AbstractColumnBinding
ColumnBinding
represents a binding between a property of the elements in theJTableBinding's
sourceList
, and a column in the table. EachColumnBinding
added to aJTableBinding
represents a column to be displayed by theJTable
. A value for any given row in a column is aquired by fetching the value of the associatedColumnBinding's
source property for the element in the sourceList
representing that row.A
Converter
may be specified on aColumnBinding
, as may be aValidator
. Validation occurs at the time a cell value is to be committed back to the sourceList
.BindingListeners
registered on aColumnBinding
are notified of successfulsync
orsyncFailure
. These notifications are also sent to theJTableBinding's
BindingListeners
.ColumnBindings
are managed by theirJTableBinding
. They are not to be explicitly bound, unbound, added to aBindingGroup
, or accessed in a way that is not allowed for a managed binding.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jdesktop.beansbinding.Binding
Binding.SyncFailure, Binding.SyncFailureType, Binding.ValueResult<V>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getColumnClass()
Returns the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.java.lang.String
getColumnName()
Returns the name for the column represented by thisColumnBinding
.boolean
isEditable()
Returns whether or not the cells of the column should be editable.JTableBinding.ColumnBinding
setColumnClass(java.lang.Class<?> columnClass)
Sets the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.JTableBinding.ColumnBinding
setColumnName(java.lang.String name)
Sets a name for the column represented by thisColumnBinding
.JTableBinding.ColumnBinding
setEditable(boolean editable)
Sets whether or not the cells of the column should be editable.-
Methods inherited from class org.jdesktop.swingbinding.impl.AbstractColumnBinding
bindImpl, getColumn, setColumn, unbindImpl
-
Methods inherited from class org.jdesktop.beansbinding.Binding
addBindingListener, addPropertyChangeListener, addPropertyChangeListener, bind, bindUnmanaged, firePropertyChange, getBindingListeners, getConverter, getName, getPropertyChangeListeners, getPropertyChangeListeners, getSourceNullValue, getSourceObject, getSourceProperty, getSourceUnreadableValue, getSourceValueForTarget, getTargetNullValue, getTargetObject, getTargetProperty, getTargetValueForSource, getValidator, isBound, isManaged, isSourceUnreadableValueSet, notifySynced, notifySyncFailed, paramString, refresh, refreshAndNotify, refreshAndNotifyUnmanaged, refreshUnmanaged, removeBindingListener, removePropertyChangeListener, removePropertyChangeListener, save, saveAndNotify, saveAndNotifyUnmanaged, saveUnmanaged, setConverter, setManaged, setSourceNullValue, setSourceObject, setSourceObjectUnmanaged, setSourceProperty, setSourceUnreadableValue, setTargetNullValue, setTargetObject, setTargetObjectUnmanaged, setTargetProperty, setValidator, sourceChangedImpl, targetChangedImpl, throwIfBound, throwIfManaged, throwIfUnbound, toString, unbind, unbindUnmanaged, unsetSourceUnreadableValue
-
-
-
-
Method Detail
-
setColumnName
public JTableBinding.ColumnBinding setColumnName(java.lang.String name)
Sets a name for the column represented by thisColumnBinding
. This is used to initialize the table's column header name. Ifnull
is specified, thetoString()
value of theColumnBinding's
source property is used.- Parameters:
name
- the name- Returns:
- the
ColumnBinding
itself, to allow for method chaining - See Also:
TableModel.getColumnName(int)
-
setColumnClass
public JTableBinding.ColumnBinding setColumnClass(java.lang.Class<?> columnClass)
Sets the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.- Parameters:
columnClass
- the column class- Returns:
- the
ColumnBinding
itself, to allow for method chaining - See Also:
TableModel.getColumnClass(int)
-
getColumnClass
public java.lang.Class<?> getColumnClass()
Returns the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.- See Also:
setColumnClass(java.lang.Class<?>)
,TableModel.getColumnClass(int)
-
getColumnName
public java.lang.String getColumnName()
Returns the name for the column represented by thisColumnBinding
. This is used to initialize the table's column header name. If no name has been specified, or if it has been set tonull
, thetoString()
value of theColumnBinding's
source property is returned.- Returns:
- the name for the column
- See Also:
setColumnName(java.lang.String)
,TableModel.getColumnName(int)
-
setEditable
public JTableBinding.ColumnBinding setEditable(boolean editable)
Sets whether or not the cells of the column should be editable. The default for this property istrue
. See this paragraph in the class level documentation on editability.- Parameters:
editable
- whether or not the cells of the column should be editable- Returns:
- the
ColumnBinding
itself, to allow for method chaining
-
isEditable
public boolean isEditable()
Returns whether or not the cells of the column should be editable. The default for this property istrue
. See this paragraph in the class level documentation on editability.- Returns:
- whether or not the cells of the column should be editable
-
-