|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.inmethod.grid.common.ColumnsState
public class ColumnsState
Manages the state (visibility, order and size) of grid columns.
| Nested Class Summary | |
|---|---|
static class |
ColumnsState.Entry
State entry for single column. |
| Constructor Summary | |
|---|---|
ColumnsState(Collection<IGridColumn<M,I>> columns)
Creates new ColumnsState instance. |
|
ColumnsState(ColumnsState.Entry[] columnStates)
Creates new ColumnsState instance. |
|
| Method Summary | ||
|---|---|---|
ColumnsState |
clone()
Returns deep copy of the object. |
|
Collection<ColumnsState.Entry> |
getColumnStates()
Returns collection of ColumnsState.Entry instances of this ColumnsState. |
|
boolean |
getColumnVisibility(String id)
Returns the visibility of given column. |
|
int |
getColumnWidth(String id)
Returns the width of column with specified id. |
|
ColumnsState.Entry |
getEntry(String id)
Returns the ColumnsState.Entry instance for column with give id, or null if the entry doesn't
exist. |
|
|
getVisibleColumns(Collection<IGridColumn<M,I>> allColumns)
Filters the given IGridColumn collection leaving only the columns with visibility set
to true. |
|
void |
setColumnIndex(String id,
int newIndex)
Moves the column with specified to specified position. |
|
void |
setColumnVisibility(String id,
boolean newValue)
Sets the visibility of column with given id. |
|
void |
setColumnWidth(String id,
int newWidth)
Sets the width of column with specified id. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColumnsState(Collection<IGridColumn<M,I>> columns)
ColumnsState instance. The state will be initialized from the specified
collection of IGridColumns.
columns - public ColumnsState(ColumnsState.Entry[] columnStates)
ColumnsState instance. The instance will be initialized from the
specified ColumnsState.Entry array.
columnStates - | Method Detail |
|---|
public ColumnsState.Entry getEntry(String id)
ColumnsState.Entry instance for column with give id, or null if the entry doesn't
exist.
id - column id
public void setColumnWidth(String id,
int newWidth)
id - column idnewWidth - new width or -1 if initial column width should be usedpublic int getColumnWidth(String id)
id - column id
public void setColumnVisibility(String id,
boolean newValue)
id - column idnewValue - public boolean getColumnVisibility(String id)
id - column id
true if the column is visible, false otherwisepublic Collection<ColumnsState.Entry> getColumnStates()
ColumnsState.Entry instances of this ColumnsState.
ColumnsState.Entry instances
public void setColumnIndex(String id,
int newIndex)
IndexOutOfBoundsException. If the column with given id is not found, throws an
IllegalStateException. The other columns are shifted accordingly.
id - column idnewIndex - new column indexpublic ColumnsState clone()
clone in class ObjectColumnsState instance that is a deep copy of this instancepublic <M,I> Collection<IGridColumn<M,I>> getVisibleColumns(Collection<IGridColumn<M,I>> allColumns)
IGridColumn collection leaving only the columns with visibility set
to true.
allColumns - Collection to be filtered.
true.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||