public class DefaultColumnModel extends AbstractColumnModel
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_WIDTH |
listeners| Constructor and Description |
|---|
DefaultColumnModel(ListViewConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(ColumnConfiguration columnConfig,
DefaultColumnGroup group)
Dynamically adds a column to the specified
ColumnGroup group if the group exists. |
ColumnDescriptor |
addColumnToRootGroup(ColumnConfiguration columnConfig)
Dynamically adds a column to the root
group and returns newly created ColumnDescriptor. |
ColumnDescriptor |
addDynamicColumnToRootGroup(ColumnConfiguration columnConfig)
Dynamically adds a column to the root
group, mark it as "dynamic" and returns newly created
ColumnDescriptor. |
void |
addGroup(ColumnGroup group,
DefaultColumnGroup parentGroup)
Dynamically adds the group
group to the specified group parentGroup if the parent group
exists. |
int |
findColumn(ColumnDescriptor colDescr)
Returns the index of the column represented by colDescr or -1
|
protected void |
fireColumnMoved(int fromIndex,
int toIndex) |
protected void |
fireColumnVisibilityChanged() |
protected void |
fireColumnVisibilityChanged(Integer colIndex) |
protected void |
fireSortChanged(int columnIndex,
boolean ascending) |
UIEditor |
getCellEditor(int columnIndex)
Gets the cell editor.
|
CellRenderer |
getCellRenderer(int columnIndex)
Gets the cell renderer.
|
ColumnDescriptor |
getColumn(int columnIndex)
Returns the column with index
columnIndex. |
ColumnConfiguration |
getColumnConfiguration(ColumnDescriptor columnDescriptor) |
List<ColumnDescriptor> |
getColumns()
Returns all columns (visible and hidden) held by this model.
|
String |
getColumnWidth(ColumnDescriptor colDescr)
Gets the column width.
|
String |
getColumnWidth(ColumnDescriptor colDescr,
Boolean returnDefault)
Gets the column width.
|
ListViewConfiguration |
getConfiguration() |
List<ColumnDescriptor> |
getHiddenColumns()
Returns all the columns which are currently marked as invisible.
|
List<ColumnDescriptor> |
getHiddenLocalizedColumns(ColumnDescriptor colDescr)
Gets the hidden localized columns.
|
ColumnDescriptor |
getLocalizedColumn(ColumnDescriptor colDescr,
LanguageModel language)
Gets the localized column.
|
protected List<ColumnDescriptor> |
getLocalizedColumns(ColumnDescriptor colDescr) |
ListViewMenuPopupBuilder |
getMenuPopupBuilder()
Gets the menu popup builder which is responsible for building table header menu popups.
|
CellRenderer |
getNewInlineItemRenderer(int columnIndex)
Gets the new inline item renderer.
|
protected ColumnDescriptor |
getNonLocalizedColumn(ColumnDescriptor colDescr) |
PropertyDescriptor |
getPropertyDescriptor(ColumnDescriptor colDescr)
Returns the property descriptor for a specific column.
|
ColumnGroup |
getRootColumnGroup()
Returns the root
ColumnGroup i.e. |
int |
getSelectedIndex()
Returns the index of the currently selected column.
|
List<Integer> |
getSelectedIndexes()
Returns the indexes of the currently selected columns.
|
int |
getSortedByColumnIndex()
Returns the index of the column by which values are currently sorted.
|
Object |
getValueAt(int columnIndex,
TypedObject object)
Returns the value of the specified object's cell.
|
ColumnDescriptor |
getVisibleColumn(int columnIndex)
Returns the visible column at position
columnIndex. |
List<ColumnDescriptor> |
getVisibleColumns()
Returns all the columns which are currently marked as visible.
|
List<ColumnDescriptor> |
getVisibleLocalizedColumns(ColumnDescriptor colDescr)
Gets the visible localized columns.
|
boolean |
hideColumn(int columnIndex)
Hide column.
|
boolean |
isColumnLocalized(ColumnDescriptor colDescr)
Checks if is column localized.
|
boolean |
isColumnSelected(int columnIndex)
Returns whether the column with index
columnIndex is selected or not. |
boolean |
isSortAscending()
Returns the sort order of the column by which values are currently sorted.
|
boolean |
moveColumn(int fromIndex,
int toIndex)
Move column.
|
void |
setSelectedIndex(int index)
Sets the selected index.
|
boolean |
setSelectedIndexDirectly(int index)
Sets the selected index directly.
|
void |
setSelectedIndexes(List<Integer> indexes)
Sets the selected indexes.
|
boolean |
setSelectedIndexesDirectly(List<Integer> indexes)
Sets the selected indexes directly.
|
void |
setSortAscending(boolean ascending)
Sets the sort ascending.
|
void |
setSortedColumnIndex(int columnIndex,
boolean ascending)
Sets the sorted column index.
|
void |
setValueAt(int columnIndex,
TypedObject object,
Object value)
Sets the value at.
|
void |
setVisibleColumns(List<ColumnDescriptor> columns,
boolean force)
Sets the visible columns.
|
boolean |
showColumn(ColumnDescriptor column,
Integer colIndex)
Show column.
|
protected boolean |
showColumnDirectly(ColumnDescriptor column) |
protected void |
updateConfiguration() |
void |
updateDynamicColumns(ListModel listModel)
Update dynamic columns.
|
addColumnModelListener, fireChanged, fireColumnSelectionChanged, removeColumnModelListenerprotected static final String DEFAULT_WIDTH
public DefaultColumnModel(ListViewConfiguration config)
public ListViewConfiguration getConfiguration()
public ColumnConfiguration getColumnConfiguration(ColumnDescriptor columnDescriptor)
public void setSelectedIndex(int index)
MutableColumnModelindex - the new selected indexpublic boolean setSelectedIndexDirectly(int index)
MutableColumnModelindex - the indexpublic void setSelectedIndexes(List<Integer> indexes)
MutableColumnModelindexes - the new selected indexespublic boolean setSelectedIndexesDirectly(List<Integer> indexes)
MutableColumnModelindexes - the selected indexespublic void setVisibleColumns(List<ColumnDescriptor> columns, boolean force)
MutableColumnModelcolumns - the vis colsforce - the forcepublic boolean hideColumn(int columnIndex)
MutableColumnModelcolumnIndex - the col indexpublic boolean showColumn(ColumnDescriptor column, Integer colIndex)
MutableColumnModelcolumn - the col descrcolIndex - the col indexprotected boolean showColumnDirectly(ColumnDescriptor column)
public PropertyDescriptor getPropertyDescriptor(ColumnDescriptor colDescr)
colDescr - the col descrPropertyDescriptor which the column colDescr represents or null if
the column does not represent a property columnpublic boolean moveColumn(int fromIndex,
int toIndex)
MutableColumnModelfromIndex - the from indextoIndex - the to indexpublic int getSortedByColumnIndex()
ColumnModelColumnModel.isSortAscending()public void setSortedColumnIndex(int columnIndex,
boolean ascending)
MutableColumnModelcolumnIndex - the col indexascending - the ascendingpublic void setSortAscending(boolean ascending)
MutableColumnModelascending - the new sort ascendingpublic boolean isSortAscending()
ColumnModeltrue if the sort order is ascending, false otherwiseColumnModel.getSortedByColumnIndex()public int findColumn(ColumnDescriptor colDescr)
ColumnModelcolDescr or -1
colDescr - column which index should be retrievedpublic ColumnDescriptor getColumn(int columnIndex)
ColumnModelcolumnIndex.columnIndex - the zero based position index of column to be returnedcolumnIndexColumnModel.getVisibleColumn(int)public ColumnDescriptor getVisibleColumn(int columnIndex)
ColumnModelcolumnIndex.columnIndex - the zero based position index of the visible column to be returnedcolumnIndexColumnModel.getColumn(int)public List<ColumnDescriptor> getColumns()
ColumnModelpublic ColumnGroup getRootColumnGroup()
ColumnModelColumnGroup i.e. the column group which holds all other groups and columns, held by this
model.public int getSelectedIndex()
ColumnModelpublic List<Integer> getSelectedIndexes()
ColumnModelpublic List<ColumnDescriptor> getVisibleColumns()
ColumnModelpublic List<ColumnDescriptor> getHiddenColumns()
ColumnModelpublic boolean isColumnSelected(int columnIndex)
ColumnModelcolumnIndex is selected or not.columnIndex - zero based position index of the column which selection status is to be retrievedtrue if a column at position columnIndex exists and is marked as selected,
false otherwisepublic Object getValueAt(int columnIndex, TypedObject object)
ColumnModelcolumnIndex - zero based column position index of the cell which value is to be returnedobject - the object which cell's value is to be returnedpublic void setValueAt(int columnIndex,
TypedObject object,
Object value)
throws ValueHandlerException
MutableColumnModelcolumnIndex - the col indexobject - the itemvalue - the valueValueHandlerException - the value handler exceptionpublic UIEditor getCellEditor(int columnIndex)
ColumnModelcolumnIndex - the column indexpublic CellRenderer getCellRenderer(int columnIndex)
ColumnModelcolumnIndex - the column indexpublic CellRenderer getNewInlineItemRenderer(int columnIndex)
ColumnModelcolumnIndex - the column indexpublic void addColumn(ColumnConfiguration columnConfig, DefaultColumnGroup group)
ColumnGroup group if the group exists.columnConfig - the column to addgroup - the group to which the column is to be addedpublic ColumnDescriptor addColumnToRootGroup(ColumnConfiguration columnConfig)
group and returns newly created ColumnDescriptor.columnConfig - the column configpublic ColumnDescriptor addDynamicColumnToRootGroup(ColumnConfiguration columnConfig)
group, mark it as "dynamic" and returns newly created
ColumnDescriptor.columnConfig - the column configpublic void addGroup(ColumnGroup group, DefaultColumnGroup parentGroup)
group to the specified group parentGroup if the parent group
exists.group - the group to addparentGroup - the parent group to which the group is to be addedpublic List<ColumnDescriptor> getHiddenLocalizedColumns(ColumnDescriptor colDescr)
ColumnModelcolDescr - the col descrpublic List<ColumnDescriptor> getVisibleLocalizedColumns(ColumnDescriptor colDescr)
ColumnModelcolDescr - the col descrpublic boolean isColumnLocalized(ColumnDescriptor colDescr)
ColumnModelcolDescr - the col descrpublic ColumnDescriptor getLocalizedColumn(ColumnDescriptor colDescr, LanguageModel language)
ColumnModelcolDescr - the col descrlanguage - the langprotected List<ColumnDescriptor> getLocalizedColumns(ColumnDescriptor colDescr)
protected ColumnDescriptor getNonLocalizedColumn(ColumnDescriptor colDescr)
public String getColumnWidth(ColumnDescriptor colDescr)
ColumnModelcolDescr - the col descrpublic String getColumnWidth(ColumnDescriptor colDescr, Boolean returnDefault)
ColumnModelcolDescr - the col descrreturnDefault - the return defaultprotected void updateConfiguration()
protected void fireColumnMoved(int fromIndex,
int toIndex)
fireColumnMoved in class AbstractColumnModelprotected void fireColumnVisibilityChanged()
fireColumnVisibilityChanged in class AbstractColumnModelprotected void fireColumnVisibilityChanged(Integer colIndex)
fireColumnVisibilityChanged in class AbstractColumnModelprotected void fireSortChanged(int columnIndex,
boolean ascending)
fireSortChanged in class AbstractColumnModelpublic ListViewMenuPopupBuilder getMenuPopupBuilder()
ColumnModelpublic void updateDynamicColumns(ListModel listModel)
MutableColumnModellistModel - the list modelCopyright © 2017 SAP SE. All Rights Reserved.