public class IlpTableView extends JScrollPane implements IlpStylableGraphicView, AdapterListener, ilog.cpl.graphic.css.internal.IlpCSSGraphicView
JScrollPane
that contains one JTable
displaying
the contents of an IlpTableModel
.JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
UPDATE_ALL_MASK, UPDATE_COMPONENT_MASK, UPDATE_NONE_MASK, UPDATE_OBJECTS_MASK
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlpTableView()
Constructs an
IlpTableView object that is initialized with a
IlpTableListModel . |
IlpTableView(IlpTableModel model)
Constructs an
IlpTableView object that is initialized with the
specified IlpTableModel . |
Modifier and Type | Method and Description |
---|---|
void |
addPseudoClass(IlpObject bo,
IlpAttribute a,
String pseudo)
Adds a pseudoclass to the specified business object.
|
void |
addPseudoClass(IlpRepresentationObject ro,
IlpAttribute a,
String pseudo)
Adds a pseudoclass to the specified representation object.
|
void |
changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
Updates the selection model of the table, according to the state of the
flags
toggle and extend . |
int |
convertColumnIndexToModel(int viewColumnIndex)
Maps the index of the column in the view at viewColumnIndex
to the index of the column in the table model.
|
int |
convertColumnIndexToView(int modelColumnIndex)
Maps the index of the column in the table model at
modelColumnIndex to the index of the column in the view.
|
protected ilog.cpl.table.css.internal.IlpTableViewCSSContext |
createViewCSSContext()
Creates the context information that will provide
Cascading Style Sheets support for this graphic view.
|
protected ilog.cpl.table.internal.IlpTableViewSupportContext |
createViewSupportContext()
Return an appropriate IlpTableViewSupportContext for this
view.
|
boolean |
ensureVisible(IlpObject object)
Scrolls the view in such a way that a given object
becomes visible.
|
boolean |
ensureVisible(IlpRepresentationObject ro)
Scrolls the view in such a way that a given representation object
becomes visible.
|
IlpAttribute |
getAttribute(IlpPoint viewLocation)
Returns the
IlpAttribute at the given position in
this object. |
IlpTableResizeMode |
getAutoResizeMode()
Retrieves the auto-resize mode of the table.
|
Color |
getBackground()
Gets the background color of this component.
|
IlpClass |
getBusinessObjectClass()
Returns the
IlpClass of representation objects the table must
contain or null if there is no IlpClass . |
TableCellEditor |
getCellEditor(IlpRepresentationObject object,
IlpAttribute attrib)
Returns an appropriate editor for the cell specified by
o
and a . |
TableCellRenderer |
getCellRenderer(IlpRepresentationObject object,
IlpAttribute attrib)
Returns an appropriate renderer for the cell specified by
o
and a . |
IlpAttribute |
getColumn(int columnIndex)
Returns the
IlpAttribute corresponding to the specified column
index. |
IlpAttribute |
getColumn(String attributeName)
Returns the attribute whose name is
attributeName or
null if this attribute is not managed by the table model. |
int |
getColumnCount()
Retrieves the number of visible columns in the table.
|
int |
getColumnIndex(IlpAttribute attribute)
Returns the column index of the specified attribute.
|
int |
getColumnIndexAtX(int xPosition)
Returns the index of the column that lies at position
xPosition , or -1 if no column covers this point. |
String |
getColumnLabel(IlpAttribute attribute)
Retrieves the label displayed in the header for the table model column
specified by
attribute . |
int |
getColumnMargin()
Returns the amount of empty space between cells in adjacent columns.
|
IlpTableColumnModel |
getColumnModel()
Returns the column model used to manage the column properties in
the table: size, order, visibility, and so on.
|
Container |
getContainer()
Returns the concrete container where the graphics are currently being
displayed.
|
IlpContext |
getContext()
Returns the application context.
|
IlpGraphicController |
getController()
Returns the
IlpGraphicController used by the table. |
IlpTableCellRenderer |
getDefaultRenderer()
Retrieves the default renderer used by the table.
|
String |
getDisplayValue(IlpTableRow row,
IlpAttribute column)
Returns the string displayed at the intersection
of
row and column . |
String |
getDisplayValueAt(int row,
int column)
Returns the string displayed at the intersection
of
row and column . |
int |
getFixedColumnCount()
Retrieves the number of fixed columns in the table.
|
IlpGraphic |
getGraphic(IlpPoint viewLocation)
Returns the
IlpGraphic object at the given position in this object. |
Class<?> |
getGraphicComponentClass()
Returns the graphic component class supported by this implementation of
graphic view.
|
IlpGraphicHolder |
getGraphicHolder()
Returns the
IlpGraphicHolder used by the table. |
Color |
getGridColor()
Returns the color used to draw grid lines to
gridColor and redisplays. |
IlpTableHeaderRenderer |
getHeaderRenderer()
Retrieves the header renderer used by the table.
|
IlpTableModel |
getIlpModel()
Returns the table model associated with the IlpTableView object.
|
IlpGraphic |
getInnermostGraphic(IlpPoint viewLocation)
Returns the innermost graphic at the given position in this object.
|
IlpTableModel |
getModel()
Returns the table model associated with the
IlpTableView
object. |
List<String> |
getPseudoClasses(IlpRepresentationObject ro,
IlpAttribute a)
Returns the custom pseudoclasses currently active for the object.
|
IlpRepresentationObject |
getRepresentationObject(IlpPoint viewLocation)
Returns the
IlpRepresentationObject object at the given position
in this object. |
IlpRepresentationObjectMapper |
getRepresentationObjectMapper()
Returns the object mapper.
|
IlpRepresentationObjectSelectionModel |
getRepresentationObjectSelectionModel()
Returns the
IlpRepresentationObjectSelectionModel
used to handle the selection of representation objects. |
IlpTableRow |
getRow(int rowIndex)
Returns the
IlpTableRow corresponding to the specified row index. |
int |
getRowCount()
Retrieves the number of rows in the table.
|
int |
getRowHeight()
Returns the height of a table row, in pixels.
|
int |
getRowMargin()
Returns the amount of empty space between cells in adjacent rows.
|
IlpTableSelectionMode |
getSelectionMode()
Returns the selection mode.
|
IlpTableSelectionModel |
getSelectionModel()
Retrieves the
IlpTableSelectionModel object that is used to handle
the selection state. |
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.
|
IlpStyle |
getStyle()
Deprecated.
The Style API has been replaced by the Cascading
Style Sheet mechanism.
|
IlpGraphicViewStyleManager |
getStyleManager()
Deprecated.
The Style API has been replaced by the Cascading
Style Sheet mechanism. Please use the method
setStyleSheets
or getStyleSheets instead. |
int |
getStyleSheetDebugMask()
Returns the current debug level.
|
String[] |
getStyleSheets()
Returns the cascaded style sheets.
|
String |
getStyleSheets(int index)
Returns one of the cascading style sheets.
|
ilog.cpl.table.internal.IlpTableViewSupport |
getTableViewSupport()
Returns the internal table view implementation.
|
ilog.cpl.graphic.css.internal.IlpViewCSSContext |
getViewCSSContext()
Returns the context information that provides
Cascading Style Sheets support for this graphic view.
|
boolean |
hasStyleSheets()
Returns
true if style sheets have been defined to this view. |
void |
invalidate()
Invalidates the container so that this container and all parents
up in the hierarchy are marked as needing to be laid out.
|
void |
invalidate(IlpRepresentationObject ro)
Invalidates the graphic representation of the given object.
|
void |
invalidateGraphics()
Invalidates all the graphic representations in this view.
|
boolean |
isCellSelected(int row,
int column)
Returns whether the cell at the specified position is selected.
|
boolean |
isColumnFixed(IlpAttribute attribute)
Specifies whether the column is fixed.
|
boolean |
isColumnVisible(IlpAttribute attribute)
Specifies whether the column is visible.
|
boolean |
isReorderingAllowed()
Returns
true if the user can rearrange column order by
dragging their headers. |
boolean |
occuredInHeader(MouseEvent e)
Returns
true if the given mouse event occurred in the header
of the table. |
void |
removePseudoClass(IlpObject bo,
IlpAttribute a,
String pseudo)
Removes a pseudoclass from the specified business object.
|
void |
removePseudoClass(IlpRepresentationObject ro,
IlpAttribute a,
String pseudo)
Removes a pseudoclass from the specified representation object.
|
void |
repaintHeader()
Repaints the header of the table.
|
void |
representationObjectsAdded(AdapterEvent e)
Called when objects have been added to the adapter.
|
void |
representationObjectsRemoved(AdapterEvent e)
Called when objects have been removed from the adapter.
|
void |
scrollRectToVisible(int row,
int column,
boolean includeSpacing)
Scrolls the table so that the given row and column become visible.
|
IlpCellCoordinates |
searchValue(String value,
IlpCellCoordinates startingCell,
boolean scanRowByRow,
boolean caseMatching)
Searches the specified string in the values displayed by the table.
|
void |
selectAll()
Selects all the visible cells.
|
void |
setAutoResizeMode(IlpTableResizeMode mode)
Sets the auto-resize mode of the table.
|
void |
setBackground(Color bg)
Sets the background color of this component.
|
void |
setColumnIndex(IlpAttribute attribute,
int index)
Moves the column of the specified attribute to the specified index.
|
void |
setColumnMargin(int colMargin)
Sets the amount of empty space between cells in adjacent columns.
|
void |
setColumnVisible(IlpAttribute attribute,
boolean visible)
Sets whether the specified column should be visible.
|
void |
setController(IlpGraphicController controller)
Sets the
IlpGraphicController instance used by the table. |
void |
setDefaultRenderer(IlpTableCellRenderer defaultRenderer)
Sets the default renderer used by the table.
|
void |
setEnabled(boolean enabled)
Sets whether or not this component is enabled.
|
void |
setFixedColumnCount(int nbColsToFix)
Sets the number of fixed columns in the table.
|
void |
setGraphicHolder(IlpGraphicHolder holder)
Sets the
IlpGraphicHolder used by the table. |
void |
setGridColor(Color v)
Sets the color used to draw grid lines to
gridColor and redisplays. |
void |
setHeaderRenderer(IlpTableHeaderRenderer headerRenderer)
Sets the header renderer used by the table.
|
void |
setModel(IlpTableModel model)
Sets the table model to be associated with this IlpTableView object.
|
void |
setReorderingAllowed(boolean reorderingAllowed)
Specifies whether the user can reorder columns in the table by dragging
their headers.
|
void |
setRepresentationObjectMapper(IlpRepresentationObjectMapper mapper)
Sets the object mapper
|
void |
setRowHeight(int height)
Sets the height, in pixels, of all cells to
rowHeight ,
The height of the cells in this row will be equal to the row height minus
the row margin. |
void |
setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows.
|
void |
setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode.
|
void |
setSelectionModel(IlpTableSelectionModel newModel)
Sets a new selection model for this table
and adds a selection listener to this model.
|
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.
|
void |
setStyleManager(IlpGraphicViewStyleManager manager)
Deprecated.
The Style API has been replaced by the Cascading
Style Sheet mechanism. Please use the method
setStyleSheets
or getStyleSheets instead. |
void |
setStyleSheetDebugMask(int mask)
Sets the debug level while parsing the style sheets.
|
void |
setStyleSheets(int index,
String css)
Changes one of the cascading style sheets.
|
void |
setStyleSheets(int index,
String css,
int updateMask)
Changes one of the cascading style sheets.
|
void |
setStyleSheets(String[] css)
Sets the cascading style sheets.
|
void |
setStyleSheets(String[] css,
int updateMask)
Sets the cascading style sheets.
|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public IlpTableView()
IlpTableView
object that is initialized with a
IlpTableListModel
.public IlpTableView(IlpTableModel model)
IlpTableView
object that is initialized with the
specified IlpTableModel
.
If this parameter is null
a IlpTableListModel
object is
used.model
- The table model providing the representation objects
displayed in the table; a default table list model is used if this
parameter equals null
.public ilog.cpl.table.internal.IlpTableViewSupport getTableViewSupport()
public int getRowHeight()
setRowHeight(int)
public void setRowHeight(int height)
rowHeight
,
The height of the cells in this row will be equal to the row height minus
the row margin.height
- The new row heightIllegalArgumentException
- if rowHeight
is
less than 1.public IlpContext getContext()
getContext
in interface IlpGraphicView
public IlpGraphicController getController()
IlpGraphicController
used by the table.getController
in interface IlpGraphicView
setController(ilog.cpl.graphic.IlpGraphicController)
public void setController(IlpGraphicController controller)
IlpGraphicController
instance used by the table.setController
in interface IlpGraphicView
controller
- The controller to be used.IllegalArgumentException
- if the given controller
is not an instance of IlpTableController
.@Deprecated public IlpGraphicViewStyleManager getStyleManager()
setStyleSheets
or getStyleSheets
instead.IlpGraphicViewStyleManager
used by the table.getStyleManager
in interface IlpGraphicView
setController(ilog.cpl.graphic.IlpGraphicController)
@Deprecated public void setStyleManager(IlpGraphicViewStyleManager manager)
setStyleSheets
or getStyleSheets
instead.IlpGraphicViewStyleManager
used by the table.setStyleManager
in interface IlpGraphicView
manager
- The graphic view style manager to be used.public IlpGraphicHolder getGraphicHolder()
IlpGraphicHolder
used by the table.getGraphicHolder
in interface IlpGraphicView
setController(ilog.cpl.graphic.IlpGraphicController)
public void setGraphicHolder(IlpGraphicHolder holder)
IlpGraphicHolder
used by the table.holder
- The graphic holder to be used.public void setModel(IlpTableModel model)
model
- The new table model for the table; cannot be
null
.IllegalArgumentException
- If the specified parameter is
null
.getModel()
public IlpTableModel getModel()
IlpTableView
object.null
.setModel(ilog.cpl.table.IlpTableModel)
public IlpTableModel getIlpModel()
null
.setModel(ilog.cpl.table.IlpTableModel)
public IlpTableColumnModel getColumnModel()
public void setHeaderRenderer(IlpTableHeaderRenderer headerRenderer)
headerRenderer
- The header renderer to be used by the table.public IlpTableHeaderRenderer getHeaderRenderer()
public void setDefaultRenderer(IlpTableCellRenderer defaultRenderer)
defaultRenderer
- The default renderer to be used by the table.public IlpTableCellRenderer getDefaultRenderer()
public TableCellRenderer getCellRenderer(IlpRepresentationObject object, IlpAttribute attrib)
o
and a
.
This implementation returns the default renderer.
object
- The IlpRepresentationObject
to render.attrib
- The IlpAttribute
to render.getDefaultRenderer()
,
setDefaultRenderer(IlpTableCellRenderer)
public TableCellEditor getCellEditor(IlpRepresentationObject object, IlpAttribute attrib)
o
and a
.
This methods returns null
, and should be overridden to return
an actual editor.object
- The IlpRepresentationObject
to edit.attrib
- The IlpAttribute
to edit.null
.public void setFixedColumnCount(int nbColsToFix)
nbColsToFix
is 0
, none of the columns in the table will be fixed. All the
columns will be fixed if nbColsToFix
is greater than the number
of columns. A number of columns less than 0
has no effect.
The method is delegated to
IlpTableColumnModel.setFixedColumnCount(int)
.nbColsToFix
- The number of fixed columns in the table.IlpTableColumnModel.setFixedColumnCount(int)
,
getFixedColumnCount()
public int getFixedColumnCount()
IlpTableColumnModel.getFixedColumnCount()
,
setFixedColumnCount(int)
public boolean isColumnFixed(IlpAttribute attribute)
false
if the attribute
does not belong
to the table model or is equal to null
.attribute
- The attribute corresponding to the column.true
if the column specified by the
attribute
is a fixed one.public void setColumnVisible(IlpAttribute attribute, boolean visible)
attribute
does not belong
to the table model or is equal to null
.attribute
- The attribute corresponding to the column.visible
- If this parameter is true
, the column will be
shown; otherwise it will be hidden.isColumnVisible(ilog.cpl.model.IlpAttribute)
,
getColumnCount()
public boolean isColumnVisible(IlpAttribute attribute)
false
if the attribute
does not belong
to the table model or is equal to null
.attribute
- The attribute corresponding to the column.true
if the column is visible, and
false
otherwise.setColumnVisible(ilog.cpl.model.IlpAttribute, boolean)
,
getColumnCount()
public void setColumnIndex(IlpAttribute attribute, int index)
IlpTableColumnModel
.attribute
- The attribute corresponding to the column which has to
be moved.index
- The new index for the column.IllegalArgumentException
- If the given attribute does not
correspond to a visible column in the table.IndexOutOfBoundsException
- If the given position is greater
than the index of the last column or less than 0
.IlpTableColumnModel.setColumnIndex(ilog.cpl.model.IlpAttribute, int)
public int getColumnIndex(IlpAttribute attribute)
IlpTableColumnModel
.attribute
- The attribute for which the column index is to be
returned.-1
if the given attribute does not correspond to a
visible column in the table view.IlpTableColumnModel.getColumnIndex(java.lang.Object)
public int getColumnCount()
setColumnVisible(ilog.cpl.model.IlpAttribute, boolean)
,
isColumnVisible(ilog.cpl.model.IlpAttribute)
public IlpCellCoordinates searchValue(String value, IlpCellCoordinates startingCell, boolean scanRowByRow, boolean caseMatching)
The search starts from cell (0,0) if startingCell
is null
.
value
- The value to search for in the table.startingCell
- The coordinates of the cell from which the search
should start.scanRowByRow
- The cells will be scanned row by row if this parameter
is true
and column by column if this parameter is false
.caseMatching
- Specifies whether the search should consider the case.null
if the value cannot be found.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 IlpTableResizeMode getAutoResizeMode()
AUTO_RESIZE_OFF
.setAutoResizeMode(ilog.cpl.table.IlpTableResizeMode)
,
IlpTableResizeMode
public void setReorderingAllowed(boolean reorderingAllowed)
Note: Fixed columns can be reordered but cannot be moved to nonfixed columns, and the converse.
reorderingAllowed
- true
if reordering of columns is allowed, and false
otherwise.isReorderingAllowed()
public boolean isReorderingAllowed()
true
if the user can rearrange column order by
dragging their headers. The default value is true
.reorderingAllowed
property.setReorderingAllowed(boolean)
public int convertColumnIndexToModel(int viewColumnIndex)
viewColumnIndex
- The index of the column in the view.convertColumnIndexToView(int)
public int convertColumnIndexToView(int modelColumnIndex)
modelColumnIndex
- The index of the column in the model.convertColumnIndexToModel(int)
public int getRowCount()
getColumnCount()
public IlpTableRow getRow(int rowIndex)
IlpTableRow
corresponding to the specified row index.rowIndex
- The index of the row.IlpTableRow
object contained in the specified row.IndexOutOfBoundsException
- if the specified index is out of range:
(rowIndex << 0 || rowIndex >>= getRowCount())
.public IlpAttribute getColumn(int columnIndex)
IlpAttribute
corresponding to the specified column
index.columnIndex
- The index of the column.IlpAttribute
contained at the specified index.IndexOutOfBoundsException
- if the specified index is less than 0
or greater than or equal to the number of columns.public IlpAttribute getColumn(String attributeName)
attributeName
or
null
if this attribute is not managed by the table model.attributeName
- The name of the attribute to return.public String getDisplayValueAt(int row, int column)
row
and column
.
Note: This method uses the style set for the table
if not null
; otherwise, it returns the raw value of the
cell retrieved from the table model. It does not return the text
provided by the renderer, which may be different.
row
- The row whose display value is to be retrieved.column
- The column whose display value is to be retrieved.
null
.public String getDisplayValue(IlpTableRow row, IlpAttribute column)
row
and column
.
Note: This method uses the style set for the table
if not null
; otherwise, it returns the raw value of the
cell retrieved from the table model. It does not return the text
provided by the renderer, which may be different.
row
- The representation object whose display value is to be
retrieved.column
- The attribute whose display value is to be retrieved.
null
.public String getColumnLabel(IlpAttribute attribute)
attribute
.attribute
- The attribute corresponding to the column;
cannot be null
.null
.IllegalArgumentException
- if the given column is equal to
null
.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 will be replaced.
selectionMode
- The selection mode to set.IllegalArgumentException
- if the given selection mode is
null
.getSelectionMode()
,
setSelectionModel(ilog.cpl.table.selection.IlpTableSelectionModel)
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
.setSelectionMode(ilog.cpl.table.selection.IlpTableSelectionMode)
,
getSelectionModel()
public void selectAll()
public boolean isCellSelected(int row, int column)
row
- index of the row.column
- index of the column.true
if the cell at index (row, column)
is selected, knowing that the first row and the first column are at index 0.IllegalArgumentException
- If row
or
column
are not in a valid range.public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
toggle
and extend
. All changes
to the selection that result from keyboard or mouse events received
by the UI are channeled through this method so that the behavior may be
overridden in a subclass.
This implementation follows these conventions:
toggle
is false
and extend
is false
:
Clears the previous selection and ensures that the new cell is selected.
toggle
is false
and extend
is true
:
Extends the previous selection to include the specified cell.
toggle
is true
and extend
is false
.
If the specified cell is selected, deselects it. If it is not selected, selects it.
toggle
is true
and extend
is true
.
Leaves the selection state as is, but moves the anchor index to the specified location.
rowIndex
- Affects the selection at row
.columnIndex
- Affects the selection at column
.toggle
- See method description.extend
- If this parameter is true
, extends the current selection.public void setSelectionModel(IlpTableSelectionModel newModel)
newModel
- The new selection model.IllegalArgumentException
- if newModel
is
null
.getSelectionModel()
public IlpTableSelectionModel getSelectionModel()
IlpTableSelectionModel
object that is used to handle
the selection state.setSelectionModel(ilog.cpl.table.selection.IlpTableSelectionModel)
public IlpRepresentationObjectSelectionModel getRepresentationObjectSelectionModel()
IlpRepresentationObjectSelectionModel
used to handle the selection of representation objects.getRepresentationObjectSelectionModel
in interface IlpGraphicView
setSelectionModel(ilog.cpl.table.selection.IlpTableSelectionModel)
.public void scrollRectToVisible(int row, int column, boolean includeSpacing)
The visible area is calculated based on the row, column and spacing information.
row
- Table row.column
- Table column.includeSpacing
- If false
, returns the true cell bounds -
computed by subtracting the inner cell spacing from the height and widths of
the column and row models.JTable.getCellRect(int, int, boolean)
public boolean ensureVisible(IlpRepresentationObject ro)
The operation is ignored if the given representation object is not part of the table component model.
true
if the object is visible, false
otherwise.public boolean ensureVisible(IlpObject object)
The operation is ignored if the given business object is not currently represented in the component.
true
if the object is visible, false
otherwise.public IlpRepresentationObject getRepresentationObject(IlpPoint viewLocation)
IlpRepresentationObject
object at the given position
in this object.getRepresentationObject
in interface IlpGraphicView
public IlpAttribute getAttribute(IlpPoint viewLocation)
IlpGraphicView
IlpAttribute
at the given position in
this object.getAttribute
in interface IlpGraphicView
public Container getContainer()
getContainer
in interface IlpGraphicView
public IlpGraphic getGraphic(IlpPoint viewLocation)
IlpGraphicView
IlpGraphic
object at the given position in this object.getGraphic
in interface IlpGraphicView
public IlpGraphic getInnermostGraphic(IlpPoint viewLocation)
getInnermostGraphic
in interface IlpGraphicView
public Class<?> getGraphicComponentClass()
getGraphicComponentClass
in interface IlpGraphicView
public void invalidate()
invalidate
in class Container
public void invalidate(IlpRepresentationObject ro)
invalidate
in interface IlpGraphicView
public void invalidateGraphics()
invalidateGraphics
in interface IlpGraphicView
public void repaintHeader()
public boolean occuredInHeader(MouseEvent e)
true
if the given mouse event occurred in the header
of the table.e
- The mouse event that occurred.public void setEnabled(boolean enabled)
Note: Disabling a component does not disable it's children.
Note: Disabling a lightweight component does not prevent it from receiving
MouseEvent
s.
setEnabled
in class JComponent
public int getColumnIndexAtX(int xPosition)
xPosition
, or -1 if no column covers this point.xPosition
- The horizontal location of interest.public void representationObjectsAdded(AdapterEvent e)
representationObjectsAdded
in interface AdapterListener
e
- Adapter eventpublic void representationObjectsRemoved(AdapterEvent e)
representationObjectsRemoved
in interface AdapterListener
e
- Adapter eventpublic IlpClass getBusinessObjectClass()
IlpClass
of representation objects the table must
contain or null
if there is no IlpClass
.@Deprecated public IlpStyle getStyle()
public void setBackground(Color bg)
setBackground
in class JComponent
bg
- The color to become this component's color.
If this parameter is null
then this component will
inherit the background color of its parent.getBackground()
public Color getBackground()
getBackground
in class Component
getBackground()
public void setShowGrid(boolean v)
showGrid
is true
, it will do; if it is
false
, it will 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 table view should draw grid lines.public boolean getShowGrid()
If showGrid
is true
, it will do; if it is
false
, it will 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 will do; if it is false
, it will not.showHorizontalLines
- true
if table view should draw horizontal lines.public boolean getShowHorizontalLines()
showHorizontalLines
is true
, it will; if it is false
, it will not.public void setShowVerticalLines(boolean showVerticalLines)
showVerticalLines
is true
it will; if it is false
it will not.showVerticalLines
- true
if table view should draw vertical lines.public boolean getShowVerticalLines()
showVerticalLines
is true
it will; if it is false
it will 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 setStyleSheets(String[] css) throws IlvStylingException
Each element can be a URL, a filename, or the style sheet string directly. The order is by priority (the last CSS takes precedence).
setStyleSheets
in interface IlvStylable
css
- An array of strings containing the URLs,
the file names of CSS files (usually with a .css
suffix) or CSS extracts directly.IlvStylingException
getStyleSheets()
public void setStyleSheets(String[] css, int updateMask) throws IlvStylingException
Each element can be a URL, a filename, or directly the style sheet string. The order is by priority (the last CSS takes precedence).
setStyleSheets
in interface IlpStylable
css
- An array of strings containing the URLs,
the names of CSS files (usually with a
.css
suffix) or CSS extracts directly.updateMask
- Flag that indicates whether the view and/or the business
object must be updated to use this new configuration.
When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the view is reconfigured with the new style
sheets.
When
IlpStylable.UPDATE_OBJECTS_MASK
is set, the representation objects that are displayed in
this view are reconfigured according to the new style
sheets.IlvStylingException
IlpStylable.UPDATE_COMPONENT_MASK
,
IlpStylable.UPDATE_OBJECTS_MASK
,
getStyleSheets(int)
public void setStyleSheets(int index, String css) throws IlvStylingException
This method is an alternative to setStyleSheets(java.lang.String[])
.
It lets you change one particular style sheet file, instead of setting the whole style sheet array.
setStyleSheets
in interface IlvStylable
index
- The index of the style sheet to replace.css
- The URL, file name of the new style sheet file or a CSS extract
directlyIlvStylingException
setStyleSheets(java.lang.String[])
,
getStyleSheets(int)
public void setStyleSheets(int index, String css, int updateMask) throws IlvStylingException
This method is an alternative to
setStyleSheets(java.lang.String[])
.
It lets you change one particular style sheet file, instead of setting
the whole style sheet array.
setStyleSheets
in interface IlpStylable
index
- The index of the style sheet to replace.css
- The URL, file name of the new style sheet file or a
CSS extract directlyupdateMask
- A flag that indicates whether the view and/or the
business objects must be updated to use this new
configuration.
When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the view is reconfigured with the new style
sheets.
When
IlpStylable.UPDATE_OBJECTS_MASK
is set, the representation objects that are displayed
in this view are reconfigured according to the new
style sheets.IlvStylingException
setStyleSheets(java.lang.String[])
,
getStyleSheets(int)
public String getStyleSheets(int index)
getStyleSheets
in interface IlvStylable
index
- The position of the cascading style sheet to return.index
-th position.setStyleSheets(int, String)
,
setStyleSheets(String[])
public String[] getStyleSheets()
getStyleSheets
in interface IlvStylable
setStyleSheets(String[])
public void setStyleSheetDebugMask(int mask)
setStyleSheets(java.lang.String[])
to debug
problems during configuration.setStyleSheetDebugMask
in interface IlvStylable
mask
- The debug mask, expressed as an OR combination of the
predefined flags.setStyleSheets(java.lang.String[])
,
getStyleSheetDebugMask()
,
IlvStylable.APPLIED_RULE_MASK
,
IlvStylable.BAD_CLASS_MASK
,
IlvStylable.BAD_PROP_MASK
,
IlvStylable.CREATED_MASK
,
IlvStylable.DECL_MASK
,
IlvStylable.DECL_VALUE_MASK
,
IlvStylable.FAILED_CONVERSIONS_MASK
,
IlvStylable.TIME_REPORT_MASK
,
IlvStylable.WARNING_PROP_MASK
public int getStyleSheetDebugMask()
getStyleSheetDebugMask
in interface IlvStylable
setStyleSheetDebugMask(int)
public boolean hasStyleSheets()
true
if style sheets have been defined to this view.hasStyleSheets
in interface ilog.cpl.graphic.css.internal.IlpCSSGraphicView
public void addPseudoClass(IlpObject bo, IlpAttribute a, String pseudo)
Pseudoclasses are used to modify the appearance of an object depending on state information, such as whether the object is selected, expanded, and so on.
The pseudoclasses expanded
, selected
, and
focus
are automatically used to customize the objects.
Add your own pseudoclasses to create new types of customization
that depend on the graphic view characteristics.
bo
- The business object.a
- The business attribute.pseudo
- A string that identifies a pseudo-class
to add to the classes already associated with the
data object.public void removePseudoClass(IlpObject bo, IlpAttribute a, String pseudo)
Pseudoclasses are used to modify the appearance of an object depending on some state information, such as whether the object is selected, expanded, and so on.
The pseudoclasses expanded
, selected
, and
focus
are automatically used to customize the objects.
Add your own pseudoclasses to create new types of customization
that depend on the graphic view characteristics.
bo
- The business object.a
- The business attribute.pseudo
- A string that identifies a pseudo-class
to move from the classes associated with the
data object.public void addPseudoClass(IlpRepresentationObject ro, IlpAttribute a, String pseudo)
If the given representation object is associated to a business
model then this method is similar to calling addPseudoClass(IlpObject,IlpAttribute,String)
.
Pseudoclasses are used to modify the appearance of an object depending on some state information, such as whether the object is selected, expanded, and so on.
The pseudoclasses expanded
, selected
, and
focus
are automatically used to customize the objects.
Add your own pseudoclasses to create new types of customization
that depend on the graphic view characteristics.
ro
- The representation object.a
- The business attribute.pseudo
- A string that identifies a pseudo-class
to add to the classes already associated with the
data object.public void removePseudoClass(IlpRepresentationObject ro, IlpAttribute a, String pseudo)
If the given representation object is associated to a business
model then this method is similar to calling removePseudoClass(IlpObject,IlpAttribute,String)
.
Pseudoclasses are used to modify the appearance of an object depending on some state information, such as whether the object is selected, expanded, and so on.
The pseudoclasses expanded
, selected
, and
focus
are automatically used to customize the objects.
Add your own pseudoclasses to create new types of customization
that depend on the graphic view characteristics.
ro
- The representation object.a
- The business attribute.pseudo
- A string that identifies a pseudo-class
to move from the classes associated with the
data object.public List<String> getPseudoClasses(IlpRepresentationObject ro, IlpAttribute a)
getPseudoClasses
in interface ilog.cpl.graphic.css.internal.IlpCSSGraphicView
protected ilog.cpl.table.css.internal.IlpTableViewCSSContext createViewCSSContext()
public ilog.cpl.graphic.css.internal.IlpViewCSSContext getViewCSSContext()
getViewCSSContext
in interface ilog.cpl.graphic.css.internal.IlpCSSGraphicView
public IlpRepresentationObjectMapper getRepresentationObjectMapper()
This method was added to optimize the table cell renderer in specific cases when objects are added/removed from the datasource in a very short time causing the event thread to be full of redraw events. Many of these events are in fact redraw of objects that are no longer in the datasource and in the adapter, so instead of spending time redrawing them, the table cell renderer uses an optimized version and just display an empty panel
public void setRepresentationObjectMapper(IlpRepresentationObjectMapper mapper)
getRepresentationObjectMapper()
protected ilog.cpl.table.internal.IlpTableViewSupportContext createViewSupportContext()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.