ilog.cpl.table.renderer
Class IlpViewRenderer

java.lang.Object
  extended by ilog.cpl.table.renderer.IlpAbstractTableViewRenderer
      extended by ilog.cpl.table.renderer.IlpViewRenderer

public class IlpViewRenderer
extends IlpAbstractTableViewRenderer

This class gives control over an 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;
 }
 

Since:
JTGO 4.0

Constructor Summary
IlpViewRenderer()
           
 
Method Summary
 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.
 
Methods inherited from class ilog.cpl.table.renderer.IlpAbstractTableViewRenderer
attach, detach, getContext, getViewSupport, isRendererEnabled, setRendererEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpViewRenderer

public IlpViewRenderer()
Method Detail

getView

public IlpTableView getView()
Access to the table view


getCSSID

public String getCSSID()
Returns the CSS identifier of this renderer.

Specified by:
getCSSID in class IlpAbstractTableViewRenderer
Internal method or field: do not use!

getHeaderRenderer

public IlpTableHeaderRenderer getHeaderRenderer()
Returns the table header renderer.


setHeaderRenderer

public void setHeaderRenderer(IlpTableHeaderRenderer renderer)
Sets the renderer used to represent the table header.

Parameters:
renderer - Table header renderer.

getDefaultRenderer

public IlpTableCellRenderer getDefaultRenderer()
Returns The table cell renderer.


setDefaultRenderer

public void setDefaultRenderer(IlpTableCellRenderer renderer)
Sets the renderer used to represent the table cells.

Parameters:
renderer - Table cell renderer.

getFixedColumnCount

public int getFixedColumnCount()
Returns the number of fixed columns in the table.


setFixedColumnCount

public void setFixedColumnCount(int count)
Sets the number of fixed columns in the table.

Parameters:
count - Number of fixed columns.

getAutoResizeMode

public IlpTableResizeMode getAutoResizeMode()
Retrieves the auto-resize mode of the table. The default mode is AUTO_RESIZE_OFF.

Returns:
The auto-resize mode of the table.
See Also:
IlpTableResizeMode

setAutoResizeMode

public void setAutoResizeMode(IlpTableResizeMode mode)
Sets the auto-resize mode of the table. See IlpTableResizeMode for possible values.

Parameters:
mode - The resize mode to set.
Throws:
IllegalArgumentException - if the specified mode is null.
See Also:
getAutoResizeMode(), IlpTableResizeMode

isReorderingAllowed

public boolean isReorderingAllowed()
Returns true if the user can rearrange the column order by dragging their headers. The default value is true.

Returns:
The reorderingAllowed property.

setReorderingAllowed

public void setReorderingAllowed(boolean reorderingAllowed)
Specifies whether the user can reorder the columns in the table by dragging their headers.

Note: Fixed columns can be reordered but cannot be moved to nonfixed columns, and conversely.

Parameters:
reorderingAllowed - true if the reordering of columns is allowed, and false otherwise.
See Also:
isReorderingAllowed()

getSelectionMode

public IlpTableSelectionMode getSelectionMode()
Returns the selection mode. It can be one of the following values: The default value is IlpTableSelectionMode.MULTIPLE_OBJECTS_SELECTION

Throws:
IllegalStateException - if the current selection model is not an instance of IlpDefaultTableSelectionModel.
See Also:
IlpTableView.getSelectionModel()

setSelectionMode

public void setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode. It can be one of the following values:

Note: If the current selection model is not an instance of IlpDefaultTableSelectionModel, it is replaced.

Parameters:
selectionMode - The selection mode to set.
Throws:
IllegalArgumentException - if the given selection mode is null.
See Also:
getSelectionMode(), IlpTableView.setSelectionModel(ilog.cpl.table.selection.IlpTableSelectionModel)

getBackground

public Color getBackground()
Returns the view background color.


setBackground

public void setBackground(Color b)
Sets the view background color.

Parameters:
b - Background color.

setShowGrid

public void setShowGrid(boolean v)
Sets whether the table draws grid lines around cells.

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.

Parameters:
v - true if the table view draws grid lines.

getShowGrid

public boolean getShowGrid()
Returns whether the table draws grid lines around cells.

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.


setGridColor

public void setGridColor(Color v)
Sets the color used to draw grid lines to gridColor and redisplays. The default color is Color.gray.

Parameters:
v - The new color of the grid lines.
Throws:
IllegalArgumentException - if gridColor is null.

getGridColor

public Color getGridColor()
Returns the color used to draw grid lines to gridColor and redisplays. The default color is Color.gray.


setShowHorizontalLines

public void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines between cells. If showHorizontalLines is true, it draws horizontal lines between cells; if it is false, it does not.

Parameters:
showHorizontalLines - true if the table view draws horizontal lines.

getShowHorizontalLines

public boolean getShowHorizontalLines()
Returns whether the table draws horizontal lines between cells. If showHorizontalLines is true, it draws horizontal lines between cells; if it is false, it does not.


setShowVerticalLines

public void setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between cells. If showVerticalLines is true it draws vertical lines between cells; if it is false it does not.

Parameters:
showVerticalLines - true if the table view draws vertical lines.

getShowVerticalLines

public boolean getShowVerticalLines()
Returns whether the table draws vertical lines between cells. If showVerticalLines is true it draws vertical lines between cells ; if it is false it does not.


setRowMargin

public void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows.

Parameters:
rowMargin - The number of pixels between cells in a row.

getRowMargin

public int getRowMargin()
Returns the amount of empty space between cells in adjacent rows.


setColumnMargin

public void setColumnMargin(int colMargin)
Sets the amount of empty space between cells in adjacent columns.

Parameters:
colMargin - The number of pixels between cells in a column.

getColumnMargin

public int getColumnMargin()
Returns the amount of empty space between cells in adjacent columns.


reset

public void reset()
Resets all settings of this renderer.

Specified by:
reset in class IlpAbstractTableViewRenderer


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.