Class RenameColumnHelper
java.lang.Object
org.eclipse.nebula.widgets.nattable.columnRename.RenameColumnHelper
- All Implemented Interfaces:
IPersistable
Helper class for handling column renaming by user interactions on the column
header.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTracks the renamed labels provided by the user.Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRenamedColumnLabel(int columnIndex) voidhandleStructuralChanges(Collection<StructuralDiff> columnDiffs) Handle the given collection ofStructuralDiffobjects to update the indexes of the renamed column labels.booleanbooleanisColumnRenamed(int columnIndex) voidloadState(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.booleanrenameColumnIndex(int index, String customColumnName) Rename the column at the given index.booleanrenameColumnPosition(int columnPosition, String customColumnName) Rename the column at the given position.voidsaveState(String prefix, Properties properties) Saves the state to the given Properties using the specified prefix.
-
Field Details
-
PERSISTENCE_KEY_RENAMED_COLUMN_HEADERS
- See Also:
-
renamedColumnsLabelsByIndex
Tracks the renamed labels provided by the user.
-
-
Constructor Details
-
RenameColumnHelper
- Parameters:
columnHeaderLayer- TheColumnHeaderLayerthis helper is connected to.
-
-
Method Details
-
renameColumnPosition
Rename the column at the given position. Note: This does not change the underlying column name.- Parameters:
columnPosition- The column position of the column that should be renamed.customColumnName- The name that should used as the user defined column name.- Returns:
trueif the column at the given position was successfully changed.
-
renameColumnIndex
Rename the column at the given index. Note: This does not change the underlying column name.- Parameters:
index- The column index of the column that should be renamed.customColumnName- The name that should used as the user defined column name.- Returns:
trueif the column at the given index was successfully changed.
-
getRenamedColumnLabel
- Parameters:
columnIndex- the column index- Returns:
- the custom label for this column as specified by the user Null if the columns is not renamed
-
isColumnRenamed
public boolean isColumnRenamed(int columnIndex) - Parameters:
columnIndex- the column index- Returns:
trueif the column at the specified index was renamed by a user.
-
isAnyColumnRenamed
public boolean isAnyColumnRenamed()- Returns:
trueif a user renamed any column.
-
handleStructuralChanges
Handle the given collection ofStructuralDiffobjects to update the indexes of the renamed column labels.- Parameters:
columnDiffs- TheStructuralDiffs to handle- Since:
- 1.4
-
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.
-
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.
-