Class ColumnGroupModel
java.lang.Object
org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel
- All Implemented Interfaces:
IPersistable
- Direct Known Subclasses:
ColumnGroupModelFixture
Tracks: Columns (by index) in a column Group. Does not keep the column
indexes in any defined order. Expand/collapse state of the Group. Name of the
Column Group (CG)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumnGroup(ColumnGroupModel.ColumnGroup columnGroup) voidaddColumnsIndexesToGroup(String colGroupName, int... bodyColumnIndexs) Creates the column group if one does not exist with the given name and adds the column indexes to it.voidclear()intgetColumnGroupByIndex(int columnIndex) getColumnGroupByName(String groupName) intgetColumnGroupPositionFromIndex(int bodyColumnIndex) booleaninsertColumnIndexes(String colGroupName, int... columnIndexesToInsert) This method will add column indexes to an existing group.voidinsertStaticColumnIndexes(String colGroupName, int... columnIndexesToInsert) This method will add static column index(s) to an existing groupbooleanbooleanbooleanisEmpty()booleanisPartOfACollapseableGroup(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand if thisColumnGroupModel.ColumnGroupis collabseable.booleanisPartOfAGroup(int bodyColumnIndex) booleanisPartOfAnUnbreakableGroup(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand if thisColumnGroupModel.ColumnGroupis unbreakable.booleanisStaticColumn(int bodyColumnIndex) voidloadState(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.voidvoidvoidremoveColumnGroup(ColumnGroupModel.ColumnGroup columnGroup) booleanremoveColumnIndexes(String colGroupName, int... columnIndexesToRemove) This method will remove column indexes from an existing group.voidsaveState(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.voidsetColumnGroupCollapseable(int columnIndex, boolean collabseable) Set theColumnGroupModel.ColumnGroupto which the column and the specified column index belongs to, to be collapseable or not.voidsetColumnGroupUnbreakable(int columnIndex, boolean unbreakable) Set theColumnGroupModel.ColumnGroupto which the column and the specified column index belongs to, to be unbreakable/breakable.voidsetDefaultCollapseable(boolean defaultCollapseable) Sets the default value for the collapseable flag when creatingColumnGroupModel.ColumnGroupobjects.voidsetStaticColumnIndexesByGroup(String colGroupName, int[] staticColumnIndexes) Add static columns identified bystaticColumnIndexesto the given columnGroupcolGroupName.intsize()toString()void
-
Constructor Details
-
ColumnGroupModel
public ColumnGroupModel()
-
-
Method Details
-
registerColumnGroupModelListener
-
unregisterColumnGroupModelListener
-
notifyListeners
public void notifyListeners() -
saveState
Description copied from interface:IPersistableSaves the state to the given Properties using the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- Specified by:
saveStatein interfaceIPersistable- Parameters:
prefix- The prefix to use for the state keys. Is also used as the state configuration name.properties- The Properties instance to save the state to.
-
loadState
Description copied from interface:IPersistableRestore the state out of the given Properties identified by the specified prefix. Note: The prefix must be prepended to the property key to support multiple states within one Properties instance.- Specified by:
loadStatein interfaceIPersistable- Parameters:
prefix- The prefix to use for the state keys. Is also used as the state configuration name.properties- The Properties instance to load the state from.
-
addColumnsIndexesToGroup
Creates the column group if one does not exist with the given name and adds the column indexes to it.- Parameters:
colGroupName- The name of the column group.bodyColumnIndexs- The column indexes that should be added to the group.- See Also:
-
insertColumnIndexes
This method will add column indexes to an existing group.- Parameters:
colGroupName- The name of the column group to which the column indexes should be added tocolumnIndexesToInsert- The column indexes to insert.- Returns:
- FALSE if: The column group is frozen Index is already s part of a column group
-
removeColumnIndexes
This method will remove column indexes from an existing group.- Parameters:
colGroupName- The name of the column group from which the column indexes should be removed.columnIndexesToRemove- The column indexes to remove.- Returns:
trueif at least one column was removed from the column group.- Since:
- 1.3
-
setStaticColumnIndexesByGroup
Add static columns identified bystaticColumnIndexesto the given columnGroupcolGroupName. Static columns remains visible when a column group is collapsed.- Parameters:
colGroupName- to add the indexes tostaticColumnIndexes- the column indexes that should be treated as static columns
-
insertStaticColumnIndexes
This method will add static column index(s) to an existing group- Parameters:
colGroupName- to add the indexes tocolumnIndexesToInsert- the column indexes that should be treated as static columns
-
getColumnGroupByName
-
getColumnGroupByIndex
-
addColumnGroup
-
removeColumnGroup
-
isPartOfAGroup
public boolean isPartOfAGroup(int bodyColumnIndex) -
isAGroup
- Parameters:
cellValue- the name that should be checked- Returns:
trueif a group by this name exists
-
clear
public void clear() -
size
public int size()- Returns:
- Number of column Groups in the model.
-
isEmpty
public boolean isEmpty()- Returns:
- TRUE if no column groups exist
-
getAllIndexesInGroups
- Returns:
- all the indexes which belong to groups
-
isStaticColumn
public boolean isStaticColumn(int bodyColumnIndex) - Parameters:
bodyColumnIndex- the column index to check- Returns:
trueifbodyColumnIndexis contained in the list of static columns of the column group this index belongs to
-
getCollapsedColumnCount
public int getCollapsedColumnCount()- Returns:
- Total number of columns hidden for all the collapsed columns.
-
getColumnGroupPositionFromIndex
public int getColumnGroupPositionFromIndex(int bodyColumnIndex) - Parameters:
bodyColumnIndex- the column index to check- Returns:
- The position of the index within the column group
-
isPartOfACollapseableGroup
public boolean isPartOfACollapseableGroup(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand if thisColumnGroupModel.ColumnGroupis collabseable.- Parameters:
columnIndex- The column index used to retrieve the corresponding column group- Returns:
trueif the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand thisColumnGroupModel.ColumnGroupis collabseable,falseif not.
-
setColumnGroupCollapseable
public void setColumnGroupCollapseable(int columnIndex, boolean collabseable) Set theColumnGroupModel.ColumnGroupto which the column and the specified column index belongs to, to be collapseable or not.- Parameters:
columnIndex- The column index used to retrieve the corresponding column groupcollabseable-trueto set the column group collapseable,falseto set it not to be collapseable.
-
isPartOfAnUnbreakableGroup
public boolean isPartOfAnUnbreakableGroup(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand if thisColumnGroupModel.ColumnGroupis unbreakable.- Parameters:
columnIndex- The column index used to retrieve the corresponding column group- Returns:
trueif the column at the specified column index belongs to aColumnGroupModel.ColumnGroupand thisColumnGroupModel.ColumnGroupis unbreakable,falseif not.
-
setColumnGroupUnbreakable
public void setColumnGroupUnbreakable(int columnIndex, boolean unbreakable) Set theColumnGroupModel.ColumnGroupto which the column and the specified column index belongs to, to be unbreakable/breakable.- Parameters:
columnIndex- The column index used to retrieve the corresponding column groupunbreakable-trueto set the column group unbreakable,falseto remove the unbreakable state.
-
isDefaultCollapseable
public boolean isDefaultCollapseable()- Returns:
- The default value for the collapseable flag of newly created
ColumnGroupModel.ColumnGroupobjects. - Since:
- 1.6
-
setDefaultCollapseable
public void setDefaultCollapseable(boolean defaultCollapseable) Sets the default value for the collapseable flag when creatingColumnGroupModel.ColumnGroupobjects.- Parameters:
defaultCollapseable- the default value forColumnGroupModel.ColumnGroup.collapseablethat should be set on creatingColumnGroupModel.ColumnGroup.- Since:
- 1.6
-
toString
-