public class RenameColumnHelper extends Object implements IPersistable
| Modifier and Type | Field and Description |
|---|---|
static String |
PERSISTENCE_KEY_RENAMED_COLUMN_HEADERS |
protected Map<Integer,String> |
renamedColumnsLabelsByIndex
Tracks the renamed labels provided by the user.
|
DOT, VALUE_SEPARATOR| Constructor and Description |
|---|
RenameColumnHelper(ColumnHeaderLayer columnHeaderLayer) |
| Modifier and Type | Method and Description |
|---|---|
String |
getRenamedColumnLabel(int columnIndex) |
void |
handleStructuralChanges(Collection<StructuralDiff> columnDiffs)
Handle the given collection of
StructuralDiff objects to update
the indexes of the renamed column labels. |
boolean |
isAnyColumnRenamed() |
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.
|
public static final String PERSISTENCE_KEY_RENAMED_COLUMN_HEADERS
public RenameColumnHelper(ColumnHeaderLayer columnHeaderLayer)
columnHeaderLayer - The ColumnHeaderLayer this helper is connected to.public boolean renameColumnPosition(int columnPosition,
String customColumnName)
columnPosition - The column position of the column that should be renamed.customColumnName - The name that should used as the user defined column name.true if the column at the given position was
successfully changed.public boolean renameColumnIndex(int index,
String customColumnName)
index - The column index of the column that should be renamed.customColumnName - The name that should used as the user defined column name.true if the column at the given index was
successfully changed.public String getRenamedColumnLabel(int columnIndex)
public boolean isColumnRenamed(int columnIndex)
true if the column at the specified index was
renamed by a user.public boolean isAnyColumnRenamed()
true if a user renamed any column.public void handleStructuralChanges(Collection<StructuralDiff> columnDiffs)
StructuralDiff objects to update
the indexes of the renamed column labels.columnDiffs - The StructuralDiffs to handlepublic void loadState(String prefix, Properties properties)
IPersistableloadState in interface IPersistableprefix - 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.public void saveState(String prefix, Properties properties)
IPersistablesaveState in interface IPersistableprefix - 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.Copyright © 2017. All rights reserved.