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
-
Field Summary
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnGroup
(ColumnGroupModel.ColumnGroup columnGroup) void
addColumnsIndexesToGroup
(String colGroupName, int... bodyColumnIndexs) Creates the column group if one does not exist with the given name and adds the column indexes to it.void
clear()
int
getColumnGroupByIndex
(int columnIndex) getColumnGroupByName
(String groupName) int
getColumnGroupPositionFromIndex
(int bodyColumnIndex) boolean
insertColumnIndexes
(String colGroupName, int... columnIndexesToInsert) This method will add column indexes to an existing group.void
insertStaticColumnIndexes
(String colGroupName, int... columnIndexesToInsert) This method will add static column index(s) to an existing groupboolean
boolean
boolean
isEmpty()
boolean
isPartOfACollapseableGroup
(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroup
and if thisColumnGroupModel.ColumnGroup
is collabseable.boolean
isPartOfAGroup
(int bodyColumnIndex) boolean
isPartOfAnUnbreakableGroup
(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroup
and if thisColumnGroupModel.ColumnGroup
is unbreakable.boolean
isStaticColumn
(int bodyColumnIndex) void
loadState
(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.void
void
void
removeColumnGroup
(ColumnGroupModel.ColumnGroup columnGroup) boolean
removeColumnIndexes
(String colGroupName, int... columnIndexesToRemove) This method will remove column indexes from an existing group.void
saveState
(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.void
setColumnGroupCollapseable
(int columnIndex, boolean collabseable) Set theColumnGroupModel.ColumnGroup
to which the column and the specified column index belongs to, to be collapseable or not.void
setColumnGroupUnbreakable
(int columnIndex, boolean unbreakable) Set theColumnGroupModel.ColumnGroup
to which the column and the specified column index belongs to, to be unbreakable/breakable.void
setDefaultCollapseable
(boolean defaultCollapseable) Sets the default value for the collapseable flag when creatingColumnGroupModel.ColumnGroup
objects.void
setStaticColumnIndexesByGroup
(String colGroupName, int[] staticColumnIndexes) Add static columns identified bystaticColumnIndexes
to the given columnGroupcolGroupName
.int
size()
toString()
void
-
Constructor Details
-
ColumnGroupModel
public ColumnGroupModel()
-
-
Method Details
-
registerColumnGroupModelListener
-
unregisterColumnGroupModelListener
-
notifyListeners
public void notifyListeners() -
saveState
Description copied from interface:IPersistable
Saves 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:
saveState
in 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:IPersistable
Restore 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:
loadState
in 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:
true
if at least one column was removed from the column group.- Since:
- 1.3
-
setStaticColumnIndexesByGroup
Add static columns identified bystaticColumnIndexes
to 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:
true
if 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:
true
ifbodyColumnIndex
is 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.ColumnGroup
and if thisColumnGroupModel.ColumnGroup
is collabseable.- Parameters:
columnIndex
- The column index used to retrieve the corresponding column group- Returns:
true
if the column at the specified column index belongs to aColumnGroupModel.ColumnGroup
and thisColumnGroupModel.ColumnGroup
is collabseable,false
if not.
-
setColumnGroupCollapseable
public void setColumnGroupCollapseable(int columnIndex, boolean collabseable) Set theColumnGroupModel.ColumnGroup
to 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
-true
to set the column group collapseable,false
to set it not to be collapseable.
-
isPartOfAnUnbreakableGroup
public boolean isPartOfAnUnbreakableGroup(int columnIndex) Check if the column at the specified column index belongs to aColumnGroupModel.ColumnGroup
and if thisColumnGroupModel.ColumnGroup
is unbreakable.- Parameters:
columnIndex
- The column index used to retrieve the corresponding column group- Returns:
true
if the column at the specified column index belongs to aColumnGroupModel.ColumnGroup
and thisColumnGroupModel.ColumnGroup
is unbreakable,false
if not.
-
setColumnGroupUnbreakable
public void setColumnGroupUnbreakable(int columnIndex, boolean unbreakable) Set theColumnGroupModel.ColumnGroup
to 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
-true
to set the column group unbreakable,false
to remove the unbreakable state.
-
isDefaultCollapseable
public boolean isDefaultCollapseable()- Returns:
- The default value for the collapseable flag of newly created
ColumnGroupModel.ColumnGroup
objects. - Since:
- 1.6
-
setDefaultCollapseable
public void setDefaultCollapseable(boolean defaultCollapseable) Sets the default value for the collapseable flag when creatingColumnGroupModel.ColumnGroup
objects.- Parameters:
defaultCollapseable
- the default value forColumnGroupModel.ColumnGroup.collapseable
that should be set on creatingColumnGroupModel.ColumnGroup
.- Since:
- 1.6
-
toString
-