|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.Table
public class Table
A component used to display data in a tabular format.
Field Summary | |
---|---|
static java.lang.String |
AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_SIZE_CHANGED_PROPERTY
|
static java.lang.String |
CELL_MARGIN_CHANGED_PROPERTY
|
static TableCellRenderer |
DEFAULT_TABLE_CELL_RENDERER
The default renderer for table cells. |
static java.lang.String |
HEIGHT_CHANGED_PROPERTY
|
static java.lang.String |
HEIGHT_UNITS_CHANGED_PROPERTY
|
static int |
PERCENT_UNITS
A constant used in the setWidthUnits() and
setHeightUnits() methods. |
static int |
PIXEL_UNITS
A constant used in the setWidthUnits() and
setHeightUnits() methods. |
static java.lang.String |
ROW_HEIGHT_CHANGED_PROPERTY
|
static java.lang.String |
STYLE_BORDER_COLOR
A style constant for the Border Color property. |
static java.lang.String |
STYLE_BORDER_SIZE
A style constant for the Border Size property. |
static java.lang.String |
STYLE_CELL_MARGIN
A style constant for the Cell Margin property. |
static java.lang.String |
STYLE_COLUMN_WIDTHS
A style constant for the setting column widths. |
static java.lang.String |
STYLE_HEIGHT
A style constant for the Height property. |
static java.lang.String |
STYLE_HEIGHT_UNITS
A style constant for the Height Units property. |
static java.lang.String |
STYLE_ROW_HEIGHTS
A style constant for the setting row heights. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
static java.lang.String |
STYLE_WIDTH_UNITS
A style constant for the Width Units property. |
static java.lang.String |
TABLE_COLUMN_MODEL_CHANGED_PROPERTY
|
static java.lang.String |
TABLE_HEADER_CHANGED_PROPERTY
|
static java.lang.String |
WIDTH_CHANGED_PROPERTY
|
static java.lang.String |
WIDTH_UNITS_CHANGED_PROPERTY
|
Constructor Summary | |
---|---|
Table()
Creates a new table, generating an empty default table model. |
|
Table(int columns,
int rows)
Creates a new table, generating an empty default table model of the given dimensions. |
|
Table(TableModel model)
Creates a Table using the supplied TableModel. |
|
Table(TableModel model,
TableColumnModel columnModel)
Creates a Table using the supplied TableModel. |
Method Summary | |
---|---|
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style
object. |
void |
createDefaultColumnsFromModel()
Creates a TableColumnModel based on the present
TableModel. |
Color |
getBorderColor()
Returns the border color. |
int |
getBorderSize()
Returns the border size. |
int |
getCellMargin()
Returns the cell margin. |
int |
getColumnCount()
Returns the number of columns in the table. |
TableColumnModel |
getColumnModel()
Returns the table's column model. |
Component |
getComponent(Coordinate coordinate)
Deprecated. See getRenderedComponent(Coordinate). |
TableCellRenderer |
getDefaultRenderer(java.lang.Class columnClass)
Returns the TableCellRenderer that is used for the specified column. |
int |
getHeight()
Returns the overall height of the table. |
int |
getHeightUnits()
Returns the units (pixel or percent) in which column heights and overall table height are measured. |
TableModel |
getModel()
Returns the table model. |
Component |
getRenderedComponent(Coordinate coordinate)
Returns the contents of the table cell at the specified coordinate. |
int |
getRowCount()
Returns the number of rows in the table. |
int |
getRowHeight(int row)
Returns the height of a table row. |
TableHeader |
getTableHeader()
Returns the TableHeader object which is responsible for rendering the table's header. |
int |
getWidth()
Returns the overall width of the table. |
int |
getWidthUnits()
Returns the units (pixel or percent) in which column widths and overall table width are measured. |
void |
invalidate()
Marks the table as needing to be re-rendered. |
boolean |
isAutoCreateColumnsFromModel()
Returns true if the TableColumnModel will be directly
derived from the TableModel . |
boolean |
isContainsFastColumns()
|
boolean |
isFastColumn(int column)
|
boolean |
isRemoveSelectionHandlesIfReadOnly()
|
void |
setAutoCreateColumnsFromModel(boolean newValue)
Sets whether the TableColumnModel will be directly derived
from the TableModel . |
void |
setBorderColor(Color newValue)
Sets the border color of the table. |
void |
setBorderSize(int newValue)
Sets the size of the table's border. |
void |
setCellMargin(int newValue)
Sets the cell interior margin. |
void |
setColumnModel(TableColumnModel newValue)
Sets the column model for this table. |
void |
setContainsFastColumns(boolean FastColumns)
|
void |
setDefaultRenderer(java.lang.Class columnClass,
TableCellRenderer defaultRenderer)
Sets the default renderer that will be used for the given column class. |
void |
setFastColumn(int column,
boolean value)
|
void |
setHeight(int newValue)
Sets the overall height of the table. |
void |
setHeightUnits(int newValue)
Sets the units (pixel or percent) in which row heights and overall table height are measured. |
void |
setModel(TableModel newValue)
Sets the TableModel the Table is visualizing. |
void |
setRemoveSelectionHandlesIfReadOnly(boolean removeSelectionHandlesIfReadOnly)
|
void |
setRowHeight(int row,
int newValue)
Sets the height of a row of the table. |
void |
setTableHeader(TableHeader newValue)
Sets the TableHeader the table uses to render the table's header. |
void |
setWidth(int newValue)
Sets the overall width of the table. |
void |
setWidthUnits(int newValue)
Sets the units (pixel or percent) in which column widths and overall table width are measured. |
void |
validate()
Updates the Table component to reflect its model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PIXEL_UNITS
setWidthUnits()
and
setHeightUnits()
methods. This value specifies that
pixel-based units are used in defining the individual column or row sizes
and the overall width and height of the table.
public static final int PERCENT_UNITS
setWidthUnits()
and
setHeightUnits()
methods. This value specifies that
percent-based are used in defining both the individual column or row
sizes and the overall width or height of the table.
public static final java.lang.String STYLE_BORDER_COLOR
public static final java.lang.String STYLE_BORDER_SIZE
public static final java.lang.String STYLE_CELL_MARGIN
public static final java.lang.String STYLE_COLUMN_WIDTHS
public static final java.lang.String STYLE_HEIGHT
public static final java.lang.String STYLE_HEIGHT_UNITS
public static final java.lang.String STYLE_ROW_HEIGHTS
public static final java.lang.String STYLE_WIDTH
public static final java.lang.String STYLE_WIDTH_UNITS
public static final TableCellRenderer DEFAULT_TABLE_CELL_RENDERER
public static final java.lang.String AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY
public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
public static final java.lang.String CELL_MARGIN_CHANGED_PROPERTY
public static final java.lang.String TABLE_HEADER_CHANGED_PROPERTY
public static final java.lang.String TABLE_COLUMN_MODEL_CHANGED_PROPERTY
public static final java.lang.String ROW_HEIGHT_CHANGED_PROPERTY
public static final java.lang.String HEIGHT_CHANGED_PROPERTY
public static final java.lang.String HEIGHT_UNITS_CHANGED_PROPERTY
public static final java.lang.String WIDTH_CHANGED_PROPERTY
public static final java.lang.String WIDTH_UNITS_CHANGED_PROPERTY
Constructor Detail |
---|
public Table()
public Table(int columns, int rows)
columns
- The initial number of columns in the table.rows
- The initial number of rows in the table.public Table(TableModel model)
model
- A TableModel containing the table's data.public Table(TableModel model, TableColumnModel columnModel)
model
- A TableModel containing the table's data.Method Detail |
---|
public void applyStyle(Style style)
Component
Style
object. The version of this method in Component
will set
foreground and background colors and the font from the style if they are
present. Components should override this method if they allow more
properties to be set from a style object, and should call
super.applyStyle() if necessary.
applyStyle
in interface Component
applyStyle
in class AbstractComponent
style
- The style object from which to retrieve properties for this
Component
.Component.applyStyle(Style)
public void createDefaultColumnsFromModel()
TableColumnModel
based on the present
TableModel. This method is invoked automatically when the table model's
structure changes if the AutoCreateColumnsFromModel
flag
is set.
public Color getBorderColor()
public int getBorderSize()
public int getCellMargin()
public int getColumnCount()
public TableColumnModel getColumnModel()
public Component getComponent(Coordinate coordinate)
public Component getRenderedComponent(Coordinate coordinate)
coordinate
- The coordinate of the rendered table cell component to return.
public TableCellRenderer getDefaultRenderer(java.lang.Class columnClass)
columnClass
- The class for which to return the default TableCellRenderer.
public int getHeight()
EchoConstants.UNDEFINED_SIZE
is returned.public int getHeightUnits()
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public TableModel getModel()
public int getRowCount()
public int getRowHeight(int row)
EchoConstants.UNDEFINED_SIZE
is returned. The units for
this value may be pixels or percentiles, based on the value of the
"HeightUnits" property.
row
- The row index.
public TableHeader getTableHeader()
public int getWidth()
UNKNOWN_SIZE
is returned.public int getWidthUnits()
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public void invalidate()
public boolean isAutoCreateColumnsFromModel()
TableColumnModel
will be directly
derived from the TableModel
. If this flag is set, changes
to the TableModel
will cause the
TableColumnModel
to be recreated. This flag is
automatically set to true when the Table
is created if a
TableColumnModel
is no specified in the constructor.
TableColumnModel
will be directly
derived from the TableModel
.public void setAutoCreateColumnsFromModel(boolean newValue)
TableColumnModel
will be directly derived
from the TableModel
. If this flag is set, changes to the
TableModel
will cause the TableColumnModel
to be recreated. This flag is automatically set to true when the
Table
is created if a TableColumnModel
is
no specified in the constructor.
newValue
- True if the TableColumnModel
should be directly
derived from the TableModel
.public void setBorderColor(Color newValue)
newValue
- The border color of the table.public void setBorderSize(int newValue)
newValue
- The size of the table's border, in pixels.public void setCellMargin(int newValue)
newValue
- The cell margin, in pixels.public void setColumnModel(TableColumnModel newValue)
newValue
- The new column model for this table.public void setDefaultRenderer(java.lang.Class columnClass, TableCellRenderer defaultRenderer)
columnClass
- The class whose default renderer is to be updated.defaultRenderer
- The new default renderer for the specified column class.public void setHeight(int newValue)
newValue
- The new height of the table. To set the height to be
undefined, use the EchoConstants.UNDEFINED_SIZE
constant.public void setHeightUnits(int newValue)
newValue
- The new unit measurement, one of the following values:
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public void setModel(TableModel newValue)
newValue
- The new TableModel.public void setRowHeight(int row, int newValue)
row
- The row number.newValue
- The new height of the specified row.public void setTableHeader(TableHeader newValue)
newValue
- The new TableHeader.public void setWidth(int newValue)
newValue
- The new width of the table. To set the width to be undefined,
use the EchoConstants.UNDEFINED_SIZE
constant.public void setWidthUnits(int newValue)
newValue
- The new unit measurement, one of the following values:
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public void validate()
Table
component to reflect its model.
validate
in interface Component
validate
in class AbstractComponent
Component.validate()
public boolean isRemoveSelectionHandlesIfReadOnly()
public void setRemoveSelectionHandlesIfReadOnly(boolean removeSelectionHandlesIfReadOnly)
public boolean isContainsFastColumns()
public void setContainsFastColumns(boolean FastColumns)
public boolean isFastColumn(int column)
public void setFastColumn(int column, boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |