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
ColumnBindingrepresents a binding between a property of the elements in theJTableBinding'ssourceList, and a column in the table. EachColumnBindingadded to aJTableBindingrepresents 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'ssource property for the element in the sourceListrepresenting that row.A
Convertermay be specified on aColumnBinding, as may be aValidator. Validation occurs at the time a cell value is to be committed back to the sourceList.BindingListenersregistered on aColumnBindingare notified of successfulsyncorsyncFailure. These notifications are also sent to theJTableBinding'sBindingListeners.ColumnBindingsare 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.CST, Binding.SyncFailure, Binding.SyncFailureType, Binding.ValueResult<V>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getColumnClass()Returns the column class to be used byJTableto determine the renderer and editor for the column represented by thisColumnBinding.StringgetColumnName()Returns the name for the column represented by thisColumnBinding.booleanisEditable()Returns whether or not the cells of the column should be editable.JTableBinding.ColumnBindingsetColumnClass(Class<?> columnClass)Sets the column class to be used byJTableto determine the renderer and editor for the column represented by thisColumnBinding.JTableBinding.ColumnBindingsetColumnName(String name)Sets a name for the column represented by thisColumnBinding.JTableBinding.ColumnBindingsetEditable(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, notifySyncWarning, 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(String name)
Sets a name for the column represented by thisColumnBinding. This is used to initialize the table's column header name. Ifnullis specified, thetoString()value of theColumnBinding'ssource property is used.- Parameters:
name- the name- Returns:
- the
ColumnBindingitself, to allow for method chaining - See Also:
TableModel.getColumnName(int)
-
setColumnClass
public JTableBinding.ColumnBinding setColumnClass(Class<?> columnClass)
Sets the column class to be used byJTableto determine the renderer and editor for the column represented by thisColumnBinding.- Parameters:
columnClass- the column class- Returns:
- the
ColumnBindingitself, to allow for method chaining - See Also:
TableModel.getColumnClass(int)
-
getColumnClass
public Class<?> getColumnClass()
Returns the column class to be used byJTableto determine the renderer and editor for the column represented by thisColumnBinding.
-
getColumnName
public 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'ssource 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
ColumnBindingitself, 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
-
-