|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.Component nextapp.echo.Table echopoint.SortableTable echopoint.SelectableTable
The SelectableTable
is a SortableTable
component that allows
the table rows to be selected, much like a a ListBox. In fact it uses the
same ListSelectionModel interface to track which rows have been selected.
And like a ListBox, the SelectableTable
has
two selection modes : single and multiple row selection.
A SelectableTable
is derived from SortableTable
and
hence all its sorting funcitonality is available.
The isServerSide property controls whether ActionEvents will be raised back on the server when a row in the table is selected. If this property is false, then no server side ActionEvent will be raised when a table row is selected.
One thing to be aware of is that the "selection model" tracks the selection of table model rows not visual rows. So if the user re-sorts the table contents the originally selected "table model row" will be tracked, not is visual position ie. how it used to appear on the screen before sorting.
Nested Class Summary | |
static class |
SelectableTable.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
static java.lang.String |
ACTION_COMMAND_CHANGED_PROPERTY
|
static nextapp.echo.Color |
DEFAULT_ROLLOVER_BACKGROUND
|
static nextapp.echo.Color |
DEFAULT_ROLLOVER_FOREGROUND
|
static nextapp.echo.Color |
DEFAULT_SELECTION_BACKGOUND
The Selection Colors |
static nextapp.echo.Color |
DEFAULT_SELECTION_FOREGROUND
|
static java.lang.String |
LIST_SELECTION_CHANGED_PROPERTY
This propery will be changed when the table row selection changes |
static int |
MULTIPLE_SELECTION
MULTIPLE_SELECTION is convieniently added for ListSelectionModel.MULTIPLE_SELECTION |
static int |
NO_SELECTION
NO_SELECTION means no selection is possible |
static java.lang.String |
ROLLOVER_BACKGROUND_CHANGED_PROPERTY
|
static java.lang.String |
ROLLOVER_ENABLED_CHANGED_PROPERTY
|
static java.lang.String |
ROLLOVER_FOREGROUND_CHANGED_PROPERTY
|
static java.lang.String |
ROW_CLICK_SELECTION_CHANGED_PROPERTY
|
static java.lang.String |
SELECTION_BACKGROUND_CHANGED_PROPERTY
|
static java.lang.String |
SELECTION_FOREGROUND_CHANGED_PROPERTY
|
static java.lang.String |
SELECTION_HANDLES_SHOWN_CHANGED_PROPERTY
|
static java.lang.String |
SELECTION_MODEL_CHANGED_PROPERTY
The ListSelectionModel is used to track what rows are selected |
static java.lang.String |
SERVER_SIDE_CHANGED_PROPERTY
|
static int |
SINGLE_SELECTION
SINGLE_SELECTION is convieniently added for ListSelectionModel.SINGLE_SELECTION |
static java.lang.String |
STYLE_ROLLOVER_BACKGROUND
|
static java.lang.String |
STYLE_ROLLOVER_ENABLED
|
static java.lang.String |
STYLE_ROLLOVER_FOREGROUND
|
static java.lang.String |
STYLE_SELECTION_BACKGROUND
|
static java.lang.String |
STYLE_SELECTION_FOREGROUND
|
Fields inherited from class echopoint.SortableTable |
DEFAULT_BORDER_COLOR, SCROLL_BAR_X_CHANGED_PROPERTY, SCROLL_BAR_Y_CHANGED_PROPERTY, WRAP_ALLOWED_CHANGED_PROPERTY |
Fields inherited from class nextapp.echo.Table |
AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY, BORDER_COLOR_CHANGED_PROPERTY, BORDER_SIZE_CHANGED_PROPERTY, CELL_MARGIN_CHANGED_PROPERTY, DEFAULT_TABLE_CELL_RENDERER, HEIGHT_CHANGED_PROPERTY, HEIGHT_UNITS_CHANGED_PROPERTY, PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS, PERCENT_UNITS, PIXEL_UNITS, ROW_HEIGHT_CHANGED_PROPERTY, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_CELL_MARGIN, STYLE_COLUMN_WIDTHS, STYLE_HEIGHT, STYLE_HEIGHT_UNITS, STYLE_ROW_HEIGHTS, STYLE_WIDTH, STYLE_WIDTH_UNITS, TABLE_COLUMN_MODEL_CHANGED_PROPERTY, TABLE_HEADER_CHANGED_PROPERTY, WIDTH_CHANGED_PROPERTY, WIDTH_UNITS_CHANGED_PROPERTY |
Fields inherited from class nextapp.echo.Component |
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY |
Fields inherited from interface echopoint.positionable.Scrollable |
HEIGHT_CHANGED_PROPERTY, SCROLLBAR_POLICY_CHANGED_PROPERTY, SCROLLBARS_ALWAYS, SCROLLBARS_AUTO, SCROLLBARS_CLIPHIDE, SCROLLBARS_NEVER, STYLE_HEIGHT, STYLE_SCROLL_BAR_POLICY, STYLE_WIDTH, UNDEFINED, undefinedSymbolic, WIDTH_CHANGED_PROPERTY |
Constructor Summary | |
SelectableTable()
SelectableTable constructor. |
|
SelectableTable(int columns,
int rows)
SelectableTable constructor. |
|
SelectableTable(nextapp.echo.table.TableModel model)
SelectableTable constructor comment. |
|
SelectableTable(nextapp.echo.table.TableModel model,
nextapp.echo.table.TableColumnModel columnModel)
Constructs the SelectableTable |
Method Summary | |
void |
addActionListener(nextapp.echo.event.ActionListener l)
Adds an ActionListener to the SelectableTable . |
void |
addListSelectionListener(nextapp.echo.event.ListSelectionListener l)
Adds a ListSelectionListener to the underlying
selection model |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
void |
fireActionPerformed(nextapp.echo.event.ActionEvent e)
Notifies all listeners that have registered for this event type. |
java.lang.String |
getActionCommand()
Returns the action command for this SelectableTable . |
int |
getMaxSelectedIndex()
Returns the maximum selected table row. |
int |
getMinSelectedIndex()
Returns the minimum selected table row. |
nextapp.echo.Color |
getRolloverBackground()
Returns the rollover background color |
nextapp.echo.Color |
getRolloverForeground()
Returns the rollover foreground color |
int |
getSelectedIndex()
Returns the selected table row. |
int[] |
getSelectedIndices()
Returns all selected table rows. |
nextapp.echo.Color |
getSelectionBackground()
Returns the selection background color |
nextapp.echo.Color |
getSelectionForeground()
Returns the selection foreground color |
int |
getSelectionMode()
Returns the selection mode. |
nextapp.echo.ListSelectionModel |
getSelectionModel()
Returns the selection model. |
boolean |
isRolloverEnabled()
Returns whether rollovers are enabled. |
boolean |
isRowClickSelection()
Returns true if rows can be selected by clicking anywhere in the table row. |
boolean |
isSelectedIndex(int rowIndex)
Determines whether an table row is selected. |
boolean |
isSelectionHandlesShown()
Returns true if the selection handles should be shown |
boolean |
isServerSide()
Returns true if the SelectableTable should raise
selection events on the server. |
void |
removeActionListener(nextapp.echo.event.ActionListener l)
Removes an ActionListener from the SelectableTable . |
void |
removeListSelectionListener(nextapp.echo.event.ListSelectionListener l)
Removes a ListSelectionListener from the underlying
selection model |
java.lang.Object |
set(java.lang.reflect.Field field,
java.lang.Object newValue)
Called to save the old value of a field, set in a new value and return the old value of a field. |
void |
setActionCommand(java.lang.String newValue)
Sets the SelectableTable 's action command. |
void |
setModel(nextapp.echo.table.TableModel newValue)
Sets the TableModel the Table is visualizing. |
void |
setRolloverBackground(nextapp.echo.Color newRolloverBackground)
Sets the rollover background color |
void |
setRolloverEnabled(boolean newValue)
Sets whether rollovers are enabled. |
void |
setRolloverForeground(nextapp.echo.Color newRolloverForeground)
Sets the rollover foreground color |
void |
setRowClickSelection(boolean newValue)
Sets whether the user is able to select a table row by clicking anywhere ins the row. |
void |
setSelectedIndex(int rowIndex)
Selects only the given table row. |
void |
setSelectedIndex(int rowIndex,
boolean selected)
Sets the selection state of the given table row. |
void |
setSelectedIndices(int[] rowIndices)
Selects an array of table rows. |
void |
setSelectionBackground(nextapp.echo.Color newSelectionBackground)
Sets the selection background color |
void |
setSelectionForeground(nextapp.echo.Color newSelectionForeground)
Sets the selection foreground color |
void |
setSelectionHandlesShown(boolean newValue)
Sets whether selection handles will be shown when the table is rendered. |
void |
setSelectionMode(int newValue)
Sets the selection mode. |
void |
setSelectionModel(nextapp.echo.ListSelectionModel newValue)
Sets the selection model. |
void |
setServerSide(boolean newValue)
If set to true then the SelectableTable will raise
selection events on the server. |
Methods inherited from class echopoint.SortableTable |
getHeight, getScrollBarPolicy, getScrollBarX, getScrollBarY, isWrapAllowed, setColumnModel, setHeaderCellRender, setHeight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setWrapAllowed, sortByColumn, sortByColumn |
Methods inherited from class nextapp.echo.Table |
createDefaultColumnsFromModel, getBorderColor, getBorderSize, getCellMargin, getColumnCount, getColumnModel, getComponent, getDefaultRenderer, getHeightUnits, getModel, getRowCount, getRowHeight, getTableHeader, getWidth, getWidthUnits, invalidate, isAutoCreateColumnsFromModel, setAutoCreateColumnsFromModel, setBorderColor, setBorderSize, setCellMargin, setDefaultRenderer, setHeightUnits, setRowHeight, setTableHeader, setWidth, setWidthUnits, validate |
Methods inherited from class nextapp.echo.Component |
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface echopoint.positionable.Scrollable |
getWidth, setWidth |
Field Detail |
public static final int MULTIPLE_SELECTION
public static final int SINGLE_SELECTION
public static final int NO_SELECTION
public static final java.lang.String LIST_SELECTION_CHANGED_PROPERTY
public static final java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
public static final nextapp.echo.Color DEFAULT_SELECTION_BACKGOUND
public static final nextapp.echo.Color DEFAULT_ROLLOVER_BACKGROUND
public static final nextapp.echo.Color DEFAULT_SELECTION_FOREGROUND
public static final nextapp.echo.Color DEFAULT_ROLLOVER_FOREGROUND
public static final java.lang.String SELECTION_BACKGROUND_CHANGED_PROPERTY
public static final java.lang.String STYLE_SELECTION_BACKGROUND
public static final java.lang.String SELECTION_FOREGROUND_CHANGED_PROPERTY
public static final java.lang.String STYLE_SELECTION_FOREGROUND
public static final java.lang.String ROLLOVER_BACKGROUND_CHANGED_PROPERTY
public static final java.lang.String STYLE_ROLLOVER_BACKGROUND
public static final java.lang.String ROLLOVER_FOREGROUND_CHANGED_PROPERTY
public static final java.lang.String STYLE_ROLLOVER_FOREGROUND
public static final java.lang.String STYLE_ROLLOVER_ENABLED
public static final java.lang.String ROLLOVER_ENABLED_CHANGED_PROPERTY
public static final java.lang.String ACTION_COMMAND_CHANGED_PROPERTY
public static final java.lang.String SERVER_SIDE_CHANGED_PROPERTY
public static final java.lang.String SELECTION_HANDLES_SHOWN_CHANGED_PROPERTY
public static final java.lang.String ROW_CLICK_SELECTION_CHANGED_PROPERTY
Constructor Detail |
public SelectableTable()
public SelectableTable(int columns, int rows)
columns
- introws
- intpublic SelectableTable(nextapp.echo.table.TableModel model)
model
- nextapp.echo.table.TableModelpublic SelectableTable(nextapp.echo.table.TableModel model, nextapp.echo.table.TableColumnModel columnModel)
model
- nextapp.echo.table.TableModelcolumnModel
- nextapp.echo.table.TableColumnModelMethod Detail |
public void applyStyle(nextapp.echo.Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface Scrollable
applyStyle
in class SortableTable
public int getMaxSelectedIndex()
NOTE : the row Index is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
public int getMinSelectedIndex()
NOTE : the row Index is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
public int getSelectedIndex()
NOTE : the row Index is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
public int[] getSelectedIndices()
NOTE : the row Indices are of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
public nextapp.echo.Color getSelectionBackground()
public nextapp.echo.Color getSelectionForeground()
public nextapp.echo.Color getRolloverBackground()
public nextapp.echo.Color getRolloverForeground()
public int getSelectionMode()
public nextapp.echo.ListSelectionModel getSelectionModel()
public boolean isSelectedIndex(int rowIndex)
NOTE : the rowIndex is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
rowIndex
- The table row index to test for selection.
public void setSelectedIndex(int rowIndex)
NOTE : the rowIndex is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
rowIndex
- The table row index to select.public void setSelectedIndex(int rowIndex, boolean selected)
NOTE : the rowIndex is of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
rowIndex
- The table row index to select.selected
- The state of the new selectionpublic void setSelectedIndices(int[] rowIndices)
NOTE : the row Indices are of the underlying table model, not how the rows are visually drawn. A sorted table model may appear visually in a different order to the table model.
rowIndices
- The table rows to be selected.public void setSelectionBackground(nextapp.echo.Color newSelectionBackground)
newSelectionBackground
- nextapp.echo.Colorpublic void setSelectionForeground(nextapp.echo.Color newSelectionForeground)
newSelectionForeground
- nextapp.echo.Colorpublic void setRolloverBackground(nextapp.echo.Color newRolloverBackground)
newRolloverBackground
- nextapp.echo.Colorpublic void setRolloverForeground(nextapp.echo.Color newRolloverForeground)
newRolloverForeground
- nextapp.echo.Colorpublic void setSelectionMode(int newValue)
newValue
- The selection mode, one of the following values:
public void setSelectionModel(nextapp.echo.ListSelectionModel newValue)
newValue
- The new selection model.public void addActionListener(nextapp.echo.event.ActionListener l)
ActionListener
to the SelectableTable
.
l
- The ActionListener
to be added.public void fireActionPerformed(nextapp.echo.event.ActionEvent e)
e
- The ActionEvent
to send.public boolean isRolloverEnabled()
public void removeActionListener(nextapp.echo.event.ActionListener l)
ActionListener
from the SelectableTable
.
l
- The ActionListener
to be removed.public void setActionCommand(java.lang.String newValue)
SelectableTable
's action command.
newValue
- The new action command for this SelectableTable
.public void setRolloverEnabled(boolean newValue)
newValue
- True if rollovers should be enabled.public java.lang.String getActionCommand()
SelectableTable
.
SelectableTable
.public boolean isServerSide()
SelectableTable
should raise
selection events on the server.
public void setServerSide(boolean newValue)
SelectableTable
will raise
selection events on the server.
public void addListSelectionListener(nextapp.echo.event.ListSelectionListener l)
ListSelectionListener
to the underlying
selection model
l
- - listenerpublic void removeListSelectionListener(nextapp.echo.event.ListSelectionListener l)
ListSelectionListener
from the underlying
selection model
l
- - listenerpublic boolean isSelectionHandlesShown()
public void setSelectionHandlesShown(boolean newValue)
newValue
- - the boolean flagpublic boolean isRowClickSelection()
public void setRowClickSelection(boolean newValue)
newValue
- public void setModel(nextapp.echo.table.TableModel newValue)
setModel
in class SortableTable
newValue
- The new TableModel.public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
set
in interface ReflectionSetter
set
in class SortableTable
java.lang.Exception
ReflectionSetter.set(Field, Object)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |