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>
ColumnBinding
represents a binding between a property of the elements
in the JTableBinding's
source List
, and a column in the table. Each
ColumnBinding
added to a JTableBinding
represents a column
to be displayed by the JTable
. A value for any given row in a column
is aquired by fetching the value of the associated ColumnBinding's
source property for the element in the source List
representing that row.
A Converter
may be specified on a ColumnBinding
, as may be
a Validator
. Validation occurs at the time a cell value is to be
committed back to the source List
.
BindingListeners
registered on
a ColumnBinding
are notified of successful sync
or
syncFailure
. These notifications are also sent to the
JTableBinding's
BindingListeners
.
ColumnBindings
are managed by their JTableBinding
. They are not
to be explicitly bound, unbound, added to a BindingGroup
, or accessed
in a way that is not allowed for a managed binding.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Binding
Binding.SyncFailure, Binding.SyncFailureType, Binding.ValueResult<V>
-
Method Summary
Modifier and TypeMethodDescriptionClass
<?> Returns the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.Returns the name for the column represented by thisColumnBinding
.boolean
Returns whether or not the cells of the column should be editable.setColumnClass
(Class<?> columnClass) Sets the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.setColumnName
(String name) Sets a name for the column represented by thisColumnBinding
.setEditable
(boolean editable) Sets whether or not the cells of the column should be editable.Methods inherited from class AbstractColumnBinding
bindImpl, getColumn, setColumn, unbindImpl
Methods inherited from class 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 Details
-
setColumnName
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:
-
setColumnClass
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:
-
getColumnClass
Returns the column class to be used byJTable
to determine the renderer and editor for the column represented by thisColumnBinding
.- See Also:
-
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:
-
setEditable
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
-