|
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
A Table derived class that can be sorted by clicking on a given column header.
This class uses the SortableTableModel to allow sorting of a TableModel by shadowing the model and sorting an array of indexes to the underlying data.
This Table implementation also uses a ComponentTableCellRenderer that allows table cells to contain Component objects. It uses a new ComponentTableCellRenderer as the cell renderer for each column in the TableColumnModel. It will use this Component firendly rendererer if you have noty already set in a TableCellRenderer for each contained TableColumn.
The SortableTable
differs from its parent in that it implements
Scrollable. This allows a height value to be set (in pixels) and the
table contents will be scrolled within that height. If the table has
a header row, then the header row is no scrolled and it will always be
present at the top of the table.
Nested Class Summary |
Nested classes inherited from class echopoint.positionable.Scrollable |
Scrollable.NestedStyleInfo |
Field Summary | |
static nextapp.echo.Color |
DEFAULT_BORDER_COLOR
The default border color |
static java.lang.String |
SCROLL_BAR_X_CHANGED_PROPERTY
This property name is fired when the scolling bar X value changes |
static java.lang.String |
SCROLL_BAR_Y_CHANGED_PROPERTY
This property name is fired when the scolling bar Y value changes |
static java.lang.String |
WRAP_ALLOWED_CHANGED_PROPERTY
This property name is fired when the wrapAllowed property changes |
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 | |
SortableTable()
SortableTable constructor. |
|
SortableTable(int columns,
int rows)
SortableTable constructor. |
|
SortableTable(nextapp.echo.table.TableModel model)
SortableTable constructor. |
|
SortableTable(nextapp.echo.table.TableModel model,
nextapp.echo.table.TableColumnModel columnModel)
SortableTable constructor. |
Method Summary | |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
int |
getHeight()
Returns the overall height of the table. |
int |
getScrollBarPolicy()
Returns the ScrollBarPolicy in place This can be one of : SCOLLBARS_NONE SCOLLBARS_ALWAYS SCOLLBARS_AUTO |
int |
getScrollBarX()
Returns the position of the horizontal scroll bar, in pixels offset from the left of the component. |
int |
getScrollBarY()
Returns the position of the vertical scroll bar, in pixels offset from the top the component. |
boolean |
isWrapAllowed()
Returns whether table cell wrapping is in place. |
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 |
setColumnModel(nextapp.echo.table.TableColumnModel newValue)
Sets the column model for this table. |
void |
setHeaderCellRender(SortableTableHeaderRenderer newRenderer)
Sets a new SortableTableHeaderRenderer for each of the columns in the table's TableColumnModel. |
void |
setHeight(int newValue)
Sets the overall height of the table. |
void |
setModel(nextapp.echo.table.TableModel newModel)
This sets the model for the SortableTable. |
void |
setScrollBarPolicy(int newScrollBarPolicy)
This sets the scroll bar policy to use. |
void |
setScrollBarX(int newValue)
Sets the position of the horizontal scroll bar, in pixels offset from the left of the component. |
void |
setScrollBarY(int newValue)
Sets the position of the vertical scroll bar, in pixels offset from the top of the component. |
void |
setWrapAllowed(boolean newValue)
Returns whether table cell wrapping is in place. |
void |
sortByColumn(int column)
Sorts the underlying table model via the given column in ascending order |
void |
sortByColumn(int column,
boolean ascending)
Sorts the underlying table model via the given column in the specified order. |
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 nextapp.echo.Color DEFAULT_BORDER_COLOR
public static final java.lang.String SCROLL_BAR_X_CHANGED_PROPERTY
public static final java.lang.String SCROLL_BAR_Y_CHANGED_PROPERTY
public static final java.lang.String WRAP_ALLOWED_CHANGED_PROPERTY
Constructor Detail |
public SortableTable()
public SortableTable(int columns, int rows)
columns
- introws
- intpublic SortableTable(nextapp.echo.table.TableModel model)
model
- nextapp.echo.table.TableModelpublic SortableTable(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
public int getHeight()
This property differs in behaviour the parent Table
class. If the height units are pixels, then this property will
be used to set up a scrollable table area of 'n' pixels.
getHeight
in interface Scrollable
EchoConstants.UNDEFINED_SIZE
is returned.public int getScrollBarPolicy()
getScrollBarPolicy
in interface Scrollable
public int getScrollBarX()
getScrollBarX
in interface Scrollable
public int getScrollBarY()
getScrollBarY
in interface Scrollable
public boolean isWrapAllowed()
If this property is true then the contents of the table cells MAY be wrapped to fit in the smallest possible space.
public void setHeaderCellRender(SortableTableHeaderRenderer newRenderer)
public void setHeight(int newValue)
This property differs in behaviour the parent Table
class. If the height units are pixels, then this property will
be used to set up a scrollable table area of 'n' pixels.
setHeight
in interface Scrollable
newValue
- The new height of the table. To set the height to be
undefined, use the EchoConstants.UNDEFINED_SIZE
constant.public void setModel(nextapp.echo.table.TableModel newModel)
public void setColumnModel(nextapp.echo.table.TableColumnModel newValue)
newValue
- The new column model for this table.public void setScrollBarPolicy(int newScrollBarPolicy)
setScrollBarPolicy
in interface Scrollable
public void setScrollBarX(int newValue)
setScrollBarX
in interface Scrollable
newValue
- The new position of the horizontal scroll bar, in pixels.public void setScrollBarY(int newValue)
setScrollBarY
in interface Scrollable
newValue
- The new position of the vertical scroll bar, in pixels.public void setWrapAllowed(boolean newValue)
If this property is true then the contents of the table cells MAY be wrapped to fit in the smallest possible space.
newValue
- boolean - the wrap flagpublic void sortByColumn(int column)
public void sortByColumn(int column, boolean ascending)
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
field
- - the field to be setnewValue
- - the new value to be set
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 |