public class IlpViewRenderer extends IlpAbstractTableViewRenderer
IlpTableView
.
This class shows all the properties that can be customized in the table view using cascading style sheets.
The CSS configuration can be applied to the table component, using
IlpTableView.setStyleSheets(java.lang.String[])
.
To customize the table view programmatically, use
IlpTableView
.
This class is a CSS stylable JavaBean. It can be configured as follows in a CSS file:
Table { view: true; } View { reorderingAllowed: true; gridColor: green; }
Constructor and Description |
---|
IlpViewRenderer() |
Modifier and Type | Method and Description |
---|---|
IlpTableResizeMode |
getAutoResizeMode()
Retrieves the auto-resize mode of the table.
|
Color |
getBackground()
Returns the view background color.
|
int |
getColumnMargin()
Returns the amount of empty space between cells in adjacent columns.
|
String |
getCSSID()
Returns the CSS identifier of this renderer.
|
IlpTableCellRenderer |
getDefaultRenderer()
Returns The table cell renderer.
|
int |
getFixedColumnCount()
Returns the number of fixed columns in the table.
|
Color |
getGridColor()
Returns the color used to draw grid lines to
gridColor and
redisplays. |
IlpTableHeaderRenderer |
getHeaderRenderer()
Returns the table header renderer.
|
int |
getRowMargin()
Returns the amount of empty space between cells in adjacent rows.
|
IlpTableSelectionMode |
getSelectionMode()
Returns the selection mode.
|
boolean |
getShowGrid()
Returns whether the table draws grid lines around cells.
|
boolean |
getShowHorizontalLines()
Returns whether the table draws horizontal lines between cells.
|
boolean |
getShowVerticalLines()
Returns whether the table draws vertical lines between cells.
|
IlpTableView |
getView()
Access to the table view
|
boolean |
isReorderingAllowed()
Returns
true if the user can rearrange the column order by
dragging their headers. |
void |
reset()
Resets all settings of this renderer.
|
void |
setAutoResizeMode(IlpTableResizeMode mode)
Sets the auto-resize mode of the table.
|
void |
setBackground(Color b)
Sets the view background color.
|
void |
setColumnMargin(int colMargin)
Sets the amount of empty space between cells in adjacent columns.
|
void |
setDefaultRenderer(IlpTableCellRenderer renderer)
Sets the renderer used to represent the table cells.
|
void |
setFixedColumnCount(int count)
Sets the number of fixed columns in the table.
|
void |
setGridColor(Color v)
Sets the color used to draw grid lines to
gridColor and
redisplays. |
void |
setHeaderRenderer(IlpTableHeaderRenderer renderer)
Sets the renderer used to represent the table header.
|
void |
setReorderingAllowed(boolean reorderingAllowed)
Specifies whether the user can reorder the columns in the table by dragging
their headers.
|
void |
setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows.
|
void |
setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode.
|
void |
setShowGrid(boolean v)
Sets whether the table draws grid lines around cells.
|
void |
setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines between cells.
|
void |
setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between cells.
|
attach, detach, getContext, getViewSupport, isRendererEnabled, setRendererEnabled
public IlpTableView getView()
public String getCSSID()
getCSSID
in class IlpAbstractTableViewRenderer
public IlpTableHeaderRenderer getHeaderRenderer()
public void setHeaderRenderer(IlpTableHeaderRenderer renderer)
renderer
- Table header renderer.public IlpTableCellRenderer getDefaultRenderer()
public void setDefaultRenderer(IlpTableCellRenderer renderer)
renderer
- Table cell renderer.public int getFixedColumnCount()
public void setFixedColumnCount(int count)
count
- Number of fixed columns.public IlpTableResizeMode getAutoResizeMode()
AUTO_RESIZE_OFF
.IlpTableResizeMode
public void setAutoResizeMode(IlpTableResizeMode mode)
IlpTableResizeMode
for possible values.mode
- The resize mode to set.IllegalArgumentException
- if the specified mode is
null
.getAutoResizeMode()
,
IlpTableResizeMode
public boolean isReorderingAllowed()
true
if the user can rearrange the column order by
dragging their headers. The default value is true
.reorderingAllowed
property.public void setReorderingAllowed(boolean reorderingAllowed)
Note: Fixed columns can be reordered but cannot be moved to nonfixed columns, and conversely.
reorderingAllowed
- true
if the reordering of columns is
allowed, and false
otherwise.isReorderingAllowed()
public IlpTableSelectionMode getSelectionMode()
IlpTableSelectionMode.EMPTY_SELECTION
IlpTableSelectionMode.SINGLE_OBJECT_SELECTION
IlpTableSelectionMode.MULTIPLE_OBJECTS_SELECTION
IlpTableSelectionMode.SINGLE_ATTRIBUTE_SELECTION
IlpTableSelectionMode.MULTIPLE_ATTRIBUTES_SELECTION
IlpTableSelectionMode.SINGLE_CELL_SELECTION
IlpTableSelectionMode.MULTIPLE_CELLS_SELECTION
IlpTableSelectionMode.MULTIPLE_OBJECTS_SELECTION
IllegalStateException
- if the current selection model is not an
instance of
IlpDefaultTableSelectionModel
.IlpTableView.getSelectionModel()
public void setSelectionMode(IlpTableSelectionMode selectionMode)
IlpTableSelectionMode.EMPTY_SELECTION
IlpTableSelectionMode.SINGLE_OBJECT_SELECTION
IlpTableSelectionMode.MULTIPLE_OBJECTS_SELECTION
IlpTableSelectionMode.SINGLE_ATTRIBUTE_SELECTION
IlpTableSelectionMode.MULTIPLE_ATTRIBUTES_SELECTION
IlpTableSelectionMode.SINGLE_CELL_SELECTION
IlpTableSelectionMode.MULTIPLE_CELLS_SELECTION
Note: If the current selection model is not an
instance of
IlpDefaultTableSelectionModel
,
it is replaced.
selectionMode
- The selection mode to set.IllegalArgumentException
- if the given selection mode is
null
.getSelectionMode()
,
IlpTableView.setSelectionModel(ilog.cpl.table.selection.IlpTableSelectionModel)
public Color getBackground()
public void setBackground(Color b)
b
- Background color.public void setShowGrid(boolean v)
If showGrid
is true
, it draws grid lines
around cells; if it is false
, it does not.
There is no getShowGrid
method, since this state is held
in two variables, showHorizontalLines
and
showVerticalLines
, each of which can be queried independently.
v
- true
if the table view draws grid lines.public boolean getShowGrid()
If showGrid
is true
, it draws grid lines
around cells; if it is false
, it does not.
This state is held in two variables, showHorizontalLines
and showVerticalLines
, each of which can be queried
independently.
public void setGridColor(Color v)
gridColor
and
redisplays.
The default color is Color.gray
.v
- The new color of the grid lines.IllegalArgumentException
- if gridColor
is
null
.public Color getGridColor()
gridColor
and
redisplays.
The default color is Color.gray
.public void setShowHorizontalLines(boolean showHorizontalLines)
showHorizontalLines
is true
, it draws
horizontal lines between cells; if it is false
, it does not.showHorizontalLines
- true
if the table view draws
horizontal lines.public boolean getShowHorizontalLines()
showHorizontalLines
is true
, it draws
horizontal lines between cells; if it is false
, it does not.public void setShowVerticalLines(boolean showVerticalLines)
showVerticalLines
is true
it draws vertical
lines between cells; if it is false
it does not.showVerticalLines
- true
if the table view draws
vertical lines.public boolean getShowVerticalLines()
showVerticalLines
is true
it draws vertical
lines between cells ; if it is false
it does not.public void setRowMargin(int rowMargin)
rowMargin
- The number of pixels between cells in a row.public int getRowMargin()
public void setColumnMargin(int colMargin)
colMargin
- The number of pixels between cells in a column.public int getColumnMargin()
public void reset()
reset
in class IlpAbstractTableViewRenderer
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.