|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Container com.sun.lwuit.table.Table
public class Table
The table class represents a grid of data that can be used for rendering a grid of components/labels. The table reflects and updates the underlying model data.
Field Summary | |
---|---|
static int |
INNER_BORDERS_ALL
Constant denoting that inner borders should be drawn fully |
static int |
INNER_BORDERS_COLS
Constant denoting that only inner borders columns should be drawn |
static int |
INNER_BORDERS_NONE
Constant denoting that inner borders should not be drawn at all |
static int |
INNER_BORDERS_ROWS
Constant denoting that only inner borders rows should be drawn |
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
Table()
Constructor for usage by GUI builder and automated tools, normally one should use the version that accepts the model |
|
Table(TableModel model)
Create a table with a new model |
|
Table(TableModel model,
boolean includeHeader)
Create a table with a new model |
Method Summary | |
---|---|
protected Component |
createCell(java.lang.Object value,
int row,
int column,
boolean editable)
Creates a cell based on the given value |
protected TableLayout.Constraint |
createCellConstraint(java.lang.Object value,
int row,
int column)
Creates the table cell constraint for the given cell, this method can be overriden for the purposes of modifying the table constraints. |
void |
deinitialize()
Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. |
int |
getCellAlignment()
Indicates the alignment of the cells see label alignment for details |
int |
getCellColumn(Component cell)
Returns the column in which the given cell is placed |
int |
getCellRow(Component cell)
Returns the row in which the given cell is placed |
int |
getInnerBorderMode()
Returns the current inner border mode |
TableModel |
getModel()
Returns the model instance |
java.lang.String[] |
getPropertyNames()
A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code |
java.lang.Class[] |
getPropertyTypes()
Matches the property names method (see that method for further details). |
java.lang.Object |
getPropertyValue(java.lang.String name)
Returns the current value of the property name, this method is used by the GUI builder |
int |
getSelectedColumn()
Returns the selected column in the table |
int |
getSelectedRow()
Returns the selected row in the table |
int |
getTitleAlignment()
Indicates the alignment of the title see label alignment for details |
void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state |
boolean |
isDrawBorder()
Indicates whether the table border should be drawn |
boolean |
isIncludeHeader()
Indicates whether the table should render a table header as the first row |
protected void |
paintGlass(Graphics g)
This method can be overriden by a component to draw on top of itself or its children after the component or the children finished drawing in a similar way to the glass pane but more refined per component |
void |
setBorderSpacing(int horizontal,
int vertical)
Sets the spacing of cells border (relevant only for separate borders and not for collapsed) |
void |
setCellAlignment(int cellAlignment)
Indicates the alignment of the cells see label alignment for details |
void |
setCollapseBorder(boolean collapseBorder)
Indicates whether the borders of the cells should collapse to form a one line border |
void |
setDrawBorder(boolean drawBorder)
Indicates whether the table border should be drawn |
void |
setDrawEmptyCellsBorder(boolean drawEmptyCellsBorder)
Indicates whether empty cells should have borders (relevant only for separate borders and not for collapsed) |
void |
setIncludeHeader(boolean includeHeader)
Indicates whether the table should render a table header as the first row |
void |
setInnerBorderMode(int innerBorder)
Sets how to draw the inner border (All of it, only rows/columns, none, groups) Note that setting to any mode other than NONE/ALL will result in the border drawing as collapsed whether this is a collpased border or not |
void |
setModel(TableModel model)
Replaces the underlying model |
java.lang.String |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Sets a new value to the given property, returns an error message if failed and null if successful. |
void |
setTitleAlignment(int titleAlignment)
Indicates the alignment of the title see label alignment for details |
protected boolean |
shouldDrawInnerBorderAfterRow(int row)
Returns whether an inner border should be drawn after the specified row. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INNER_BORDERS_NONE
public static final int INNER_BORDERS_ROWS
public static final int INNER_BORDERS_COLS
public static final int INNER_BORDERS_ALL
Constructor Detail |
---|
public Table()
public Table(TableModel model)
model
- the model underlying this tablepublic Table(TableModel model, boolean includeHeader)
model
- the model underlying this tableincludeHeader
- Indicates whether the table should render a table header as the first rowMethod Detail |
---|
public int getSelectedRow()
public int getSelectedColumn()
protected void paintGlass(Graphics g)
Container
paintGlass
in class Container
g
- the graphics contextprotected Component createCell(java.lang.Object value, int row, int column, boolean editable)
value
- the new value objectrow
- row number, -1 for the header rowscolumn
- column numbereditable
- true if the cell is editable
public void initComponent()
Component
initComponent
in class Component
public void deinitialize()
Component
deinitialize
in class Component
public void setModel(TableModel model)
model
- the new modelpublic TableModel getModel()
public boolean isDrawBorder()
public void setDrawBorder(boolean drawBorder)
drawBorder
- the drawBorder to setpublic void setInnerBorderMode(int innerBorder)
innerBorder
- one of the INNER_BORDER_* constantspublic int getInnerBorderMode()
protected boolean shouldDrawInnerBorderAfterRow(int row)
row
- The row in question
public void setCollapseBorder(boolean collapseBorder)
collapseBorder
- true to collapse (default), false for separate borderspublic void setDrawEmptyCellsBorder(boolean drawEmptyCellsBorder)
drawEmptyCellsBorder
- - true to draw (default), false otherwisepublic void setBorderSpacing(int horizontal, int vertical)
horizontal
- - The horizontal spacingvertical
- - The vertical spacingpublic int getTitleAlignment()
Label.setAlignment(int)
public void setTitleAlignment(int titleAlignment)
titleAlignment
- the title alignmentLabel.setAlignment(int)
public int getCellColumn(Component cell)
cell
- the component representing the cell placed in the table
public int getCellRow(Component cell)
cell
- the component representing the cell placed in the table
public int getCellAlignment()
Label.setAlignment(int)
public void setCellAlignment(int cellAlignment)
cellAlignment
- the table cell alignmentLabel.setAlignment(int)
public boolean isIncludeHeader()
public void setIncludeHeader(boolean includeHeader)
includeHeader
- the includeHeader to setprotected TableLayout.Constraint createCellConstraint(java.lang.Object value, int row, int column)
value
- the value of the cellrow
- the table rowcolumn
- the table column
public java.lang.String[] getPropertyNames()
Component
getPropertyNames
in class Component
public java.lang.Class[] getPropertyTypes()
Component
getPropertyTypes
in class Component
public java.lang.Object getPropertyValue(java.lang.String name)
Component
getPropertyValue
in class Component
name
- the name of the property
public java.lang.String setPropertyValue(java.lang.String name, java.lang.Object value)
Component
setPropertyValue
in class Component
name
- the name of the propertyvalue
- new value for the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |