Class EditablePropertyTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,P,S>
- java.lang.Object
-
- com.inmethod.grid.column.AbstractColumn<T,I,S>
-
- com.inmethod.grid.treegrid.BaseTreeColumn<T,I,S>
-
- com.inmethod.grid.column.tree.AbstractTreeColumn<T,I,S>
-
- com.inmethod.grid.column.tree.PropertyTreeColumn<T,I,P,S>
-
- com.inmethod.grid.column.editable.EditablePropertyTreeColumn<T,I,P,S>
-
- All Implemented Interfaces:
IGridColumn<T,I,S>,Serializable,IDetachable,IClusterable
public class EditablePropertyTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,P,S> extends PropertyTreeColumn<T,I,P,S>
Tree column that allows to edit the property when item is selected.- Author:
- Matej Knopp
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EditablePropertyTreeColumn(String columnId, IModel<String> headerModel, String propertyExpression)Constructor.EditablePropertyTreeColumn(String columnId, IModel<String> headerModel, String propertyExpression, S sortProperty)Constructor.EditablePropertyTreeColumn(IModel<String> headerModel, String propertyExpression)Constructor.EditablePropertyTreeColumn(IModel<String> headerModel, String propertyExpression, S sortProperty)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddValidators(FormComponent<P> component)booleancellClicked(IModel<I> rowModel)Allows to override default behavior when a row is clicked.StringgetCellCssClass(IModel<I> rowModel, int rowNum)Returns the cell specified by rowModel.protected IModel<P>getFieldModel(IModel<I> rowModel)protected booleanisClickToEdit()protected EditableCellPanel<T,I,P,S>newCellPanel(String componentId, IModel<I> rowModel, IModel<P> cellModel)protected ComponentnewNodeComponent(String id, IModel<I> model)Creates the node component.-
Methods inherited from class com.inmethod.grid.column.tree.PropertyTreeColumn
getPropertyExpression
-
Methods inherited from class com.inmethod.grid.column.tree.AbstractTreeColumn
getIcon, newCell, newCell
-
Methods inherited from class com.inmethod.grid.treegrid.BaseTreeColumn
getTreeGrid, setGrid
-
Methods inherited from class com.inmethod.grid.column.AbstractColumn
detach, getColSpan, getGrid, getHeaderCssClass, getHeaderModel, getHeaderTooltipModel, getId, getInitialSize, getMaxSize, getMinSize, getSizeUnit, getSortProperty, getWrapText, isLightWeight, isReorderable, isResizable, newHeader, setHeaderTooltipModel, setInitialSize, setMaxSize, setMinSize, setReorderable, setResizable, setSizeUnit, setWrapText
-
-
-
-
Constructor Detail
-
EditablePropertyTreeColumn
public EditablePropertyTreeColumn(String columnId, IModel<String> headerModel, String propertyExpression, S sortProperty)
Constructor.- Parameters:
columnId- column identified (must be unique within the grid)headerModel- model for column headerpropertyExpression- property expression used to get the displayed value for row objectsortProperty- optional string that will be returned byISortStateto indicate that the column is being sorted
-
EditablePropertyTreeColumn
public EditablePropertyTreeColumn(String columnId, IModel<String> headerModel, String propertyExpression)
Constructor.- Parameters:
columnId- column identified (must be unique within the grid)headerModel- model for column headerpropertyExpression- property expression used to get the displayed value for row object
-
EditablePropertyTreeColumn
public EditablePropertyTreeColumn(IModel<String> headerModel, String propertyExpression, S sortProperty)
Constructor. The column id is omitted in this constructor, because the property expression is used as column id.- Parameters:
headerModel- model for column headerpropertyExpression- property expression used to get the displayed value for row objectsortProperty- optional string that will be returned byISortStateto indicate that the column is being sorted
-
EditablePropertyTreeColumn
public EditablePropertyTreeColumn(IModel<String> headerModel, String propertyExpression)
Constructor. The column id is omitted in this constructor, because the property expression is used as column id.- Parameters:
headerModel- model for column headerpropertyExpression- property expression used to get the displayed value for row object
-
-
Method Detail
-
newNodeComponent
protected Component newNodeComponent(String id, IModel<I> model)
Creates the node component.- Overrides:
newNodeComponentin classPropertyTreeColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,P,S>- Parameters:
id- component idmodel- model used to access theTreeNode- Returns:
- newly created component instance
-
addValidators
protected void addValidators(FormComponent<P> component)
-
newCellPanel
protected EditableCellPanel<T,I,P,S> newCellPanel(String componentId, IModel<I> rowModel, IModel<P> cellModel)
-
getCellCssClass
public String getCellCssClass(IModel<I> rowModel, int rowNum)
Returns the cell specified by rowModel. The class is applied to the appropriate <td> element in the grid.- Specified by:
getCellCssClassin interfaceIGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,P>- Overrides:
getCellCssClassin classAbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
rowModel- model for given rowrowNum- index of row forDataGrid, -1 forTreeGrid- Returns:
- cell style class or
null
-
cellClicked
public boolean cellClicked(IModel<I> rowModel)
Description copied from class:AbstractColumnAllows to override default behavior when a row is clicked. Depending on grid settings the default behavior can select the item. If this method returnstruethe default behavior will be suppressed.- Specified by:
cellClickedin interfaceIGridColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,P>- Overrides:
cellClickedin classAbstractColumn<T extends TreeModel & Serializable,I extends TreeNode & Serializable,S>- Parameters:
rowModel- Model for clicked row- Returns:
trueif the default behavior when row is clicked should be supressed,falseotherwise.
-
isClickToEdit
protected boolean isClickToEdit()
-
-