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 String
Tracks 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) void
handleStructuralChanges
(Collection<StructuralDiff> columnDiffs) Handle the given collection ofStructuralDiff
objects to update the indexes of the renamed column labels.boolean
boolean
isColumnRenamed
(int columnIndex) void
loadState
(String prefix, Properties properties) Restore the state out of the given Properties identified by the specified prefix.boolean
renameColumnIndex
(int index, String customColumnName) Rename the column at the given index.boolean
renameColumnPosition
(int columnPosition, String customColumnName) Rename the column at the given position.void
saveState
(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
- TheColumnHeaderLayer
this 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:
true
if 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:
true
if 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:
true
if the column at the specified index was renamed by a user.
-
isAnyColumnRenamed
public boolean isAnyColumnRenamed()- Returns:
true
if a user renamed any column.
-
handleStructuralChanges
Handle the given collection ofStructuralDiff
objects to update the indexes of the renamed column labels.- Parameters:
columnDiffs
- TheStructuralDiff
s to handle- Since:
- 1.4
-
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.
-
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.
-