|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.Table
echopoint.SortableTable
public class 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/interfaces inherited from interface echopoint.positionable.Scrollable |
---|
Scrollable.NestedStyleInfo |
Field Summary | |
---|---|
static java.lang.String |
COLUMN_WIDTH_UNITS_CHANGED_PROPERTY
|
static java.lang.String |
CSS_CLASS_CHANGED_PROPERTY
|
static java.lang.String |
CSS_CLASS_EVEN_CHANGED_PROPERTY
|
static java.lang.String |
CSS_CLASS_ODD_CHANGED_PROPERTY
|
static Color |
DEFAULT_BORDER_COLOR
The default border color |
static java.lang.String |
EVEN_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
HEADER_VISIBLE_CHANGED_PROPERTY
|
static java.lang.String |
ODD_COLOR_CHANGED_PROPERTY
|
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 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(TableModel model)
SortableTable constructor. |
|
SortableTable(TableModel model,
TableColumnModel columnModel)
SortableTable constructor. |
Method Summary | |
---|---|
void |
applyStyle(Style style)
Applies the provided style to the component. |
int |
getColumnWidthUnits()
|
java.lang.String |
getCssClass()
|
java.lang.String |
getCssClassEven()
|
java.lang.String |
getCssClassOdd()
|
Color |
getEvenColor()
|
ImageReference |
getHeaderBackgroundImage()
|
int |
getHeight()
Returns the overall height of the table. |
Color |
getOddColor()
|
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 |
isFixedLayout()
|
boolean |
isHeaderVisible()
|
boolean |
isShowRowNumber()
|
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(TableColumnModel newValue)
Sets the column model for this table. |
void |
setColumnWidthUnits(int newValue)
|
void |
setCssClass(java.lang.String newValue)
|
void |
setCssClassEven(java.lang.String newValue)
|
void |
setCssClassOdd(java.lang.String newValue)
|
void |
setEvenColor(Color evenColor)
|
void |
setFixedLayout(boolean fixedLayout)
|
void |
setHeaderBackgroundImage(ImageReference headerBackgroundImage)
|
void |
setHeaderCellRender(SortableTableHeaderRenderer newRenderer)
Sets a new SortableTableHeaderRenderer for each of the columns in the table's TableColumnModel. |
void |
setHeaderVisible(boolean headerVisible)
|
void |
setHeight(int newValue)
Sets the overall height of the table. |
void |
setModel(TableModel newModel)
This sets the model for the SortableTable. |
void |
setOddColor(Color oddColor)
|
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 |
setShowRowNumber(boolean showRowNumber)
|
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. |
void |
sortByColumns(java.util.List columnSortCriteria)
Sorts the underlying table model via the given columnSortCriteria |
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 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 ODD_COLOR_CHANGED_PROPERTY
public static final java.lang.String EVEN_COLOR_CHANGED_PROPERTY
public static final java.lang.String HEADER_VISIBLE_CHANGED_PROPERTY
public static final java.lang.String WRAP_ALLOWED_CHANGED_PROPERTY
public static final java.lang.String CSS_CLASS_CHANGED_PROPERTY
public static final java.lang.String CSS_CLASS_ODD_CHANGED_PROPERTY
public static final java.lang.String CSS_CLASS_EVEN_CHANGED_PROPERTY
public static final java.lang.String COLUMN_WIDTH_UNITS_CHANGED_PROPERTY
Constructor Detail |
---|
public SortableTable()
public SortableTable(int columns, int rows)
columns
- introws
- intpublic SortableTable(TableModel model)
model
- nextapp.echo.table.TableModelpublic SortableTable(TableModel model, TableColumnModel columnModel)
model
- nextapp.echo.table.TableModelcolumnModel
- nextapp.echo.table.TableColumnModelMethod Detail |
---|
public void applyStyle(Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface Scrollable
applyStyle
in interface Component
applyStyle
in class Table
style
- The style object from which to retrieve properties for this
Component
.Component.applyStyle(Style)
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
getHeight
in class Table
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
setHeight
in class Table
newValue
- The new height of the table. To set the height to be
undefined, use the EchoConstants.UNDEFINED_SIZE
constant.public void setModel(TableModel newModel)
setModel
in class Table
newModel
- The new TableModel.public void setColumnModel(TableColumnModel newValue)
setColumnModel
in class Table
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 void sortByColumns(java.util.List columnSortCriteria)
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.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.Exception
ReflectionSetter.set(Field, Object)
public boolean isHeaderVisible()
public void setHeaderVisible(boolean headerVisible)
public Color getEvenColor()
public void setEvenColor(Color evenColor)
public Color getOddColor()
public void setOddColor(Color oddColor)
public int getColumnWidthUnits()
public void setColumnWidthUnits(int newValue)
public boolean isFixedLayout()
public void setFixedLayout(boolean fixedLayout)
public ImageReference getHeaderBackgroundImage()
public void setHeaderBackgroundImage(ImageReference headerBackgroundImage)
public java.lang.String getCssClass()
public void setCssClass(java.lang.String newValue)
public java.lang.String getCssClassEven()
public void setCssClassEven(java.lang.String newValue)
public java.lang.String getCssClassOdd()
public void setCssClassOdd(java.lang.String newValue)
public boolean isShowRowNumber()
public void setShowRowNumber(boolean showRowNumber)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |