public class IlpTable extends JComponent implements IlpInteractiveGraphicComponent
It does not have independent functionality, but it is convenient to use. It creates and connects all MVC components needed to display a table.
By default the table component creates an instance of
IlpDefaultListModel
to fill an
IlpTableListModel
object that is used as the table
model for the table view.
The table component can be customized using cascading style sheets. The
CSS must be loaded in the component through the method
setStyleSheets(java.lang.String[])
.
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlpTable()
Table Component constructor.
|
IlpTable(IlpContext context)
Table Component constructor.
|
IlpTable(IlpContext context,
IlpTableModel model,
IlpTableView view,
IlpTableController controller)
Table Component constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(IlpAttribute attribute)
Adds a custom attribute to the table view as a new column.
|
void |
addPseudoClass(IlpObject bo,
IlpAttribute a,
String pseudo)
Adds a pseudoclass to the specified business object and attribute.
|
void |
addSelectionObject(IlpObject object)
Adds the given
IlpObject to the selection. |
void |
clearSelection()
Clears the selection.
|
protected IlpTableController |
createDefaultController()
Returns the default controller, which is an
IlpTableController
object. |
protected IlpTableModel |
createDefaultModel()
Returns the default model object, which is an instance of
IlpTableListModel . |
protected IlpTableView |
createDefaultView()
Returns the default view, which is an instance of
IlpTableView . |
void |
dispose()
Cleans up the table, disconnects the component from the data source
and drops references to objects to help garbage collection.
|
void |
doLayout()
Lays out the components.
|
boolean |
ensureVisible(IlpObject object)
Scrolls the view in such a way that a given object
becomes visible.
|
boolean |
ensureVisible(IlpRepresentationObject object)
Scrolls the view in such a way that a given representation object
becomes visible.
|
IlpClass |
getAcceptedClass()
Returns the class of object the component accepts from the data source.
|
String |
getAcceptedClassName()
Returns the name of the class of object the component accepts from the data
source.
|
IlpListAdapter |
getAdapter()
Returns the adapter connected to the table model or creates a new one.
|
IlpTableResizeMode |
getAutoResizeMode()
Retrieves the autoresize mode of the table view.
|
IlpAttribute |
getColumn(int columnIndex)
Returns the
IlpAttribute corresponding to the
specified column index in the given table. |
IlpAttribute |
getColumn(String attributeName)
Returns the attribute whose name is
attributeName or
null if this attribute is not managed by the table model. |
int |
getColumnIndex(IlpAttribute attribute)
Returns the column index of the specified attribute.
|
IlpContext |
getContext()
Returns the
IlpContext used by this component. |
IlpTableController |
getController()
Returns the controller associated with the Table component.
|
IlpDataSource |
getDataSource()
Retrieves the current data source.
|
IlpTableCellRenderer |
getDefaultRenderer()
Retrieves the renderer used for the cells.
|
IlpViewInteractor |
getDefaultViewInteractor()
Returns the default view interactor.
|
IlpFilter |
getFilter()
Returns the filter used to filter business objects.
|
int |
getFixedColumnCount()
Retrieves the number of fixed columns in the table.
|
IlpDefaultTableHeaderInteractor |
getHeaderInteractor()
Returns the interactor used to manage events that occur in the table header.
|
IlpTableHeaderRenderer |
getHeaderRenderer()
Retrieves the renderer used for the header.
|
JScrollBar |
getHorizontalScrollBar()
Returns the horizontal scroll bar that controls the viewport's horizontal view position.
|
IlpDefaultListModel |
getListModel()
Returns the
IlpDefaultListModel object which should be used to fill
the table model with representation objects. |
IlpTableModel |
getModel()
Returns the model associated with the Table component.
|
IlpProject |
getProject()
Returns the component project configuration.
|
IlpObject |
getRow(int rowIndex)
Returns the
IlpObject corresponding to the specified
row index in the given table. |
JScrollPane |
getScrollView()
Returns the scrollable view of this component.
|
IlpObject |
getSelectedObject()
Returns the first selected
IlpObject
from the collection of selected objects. |
Collection |
getSelectedObjects()
Returns the set of selected
IlpObject s. |
IlpTableSelectionMode |
getSelectionMode()
Returns the selection mode of the table view.
|
IlpTableSelectionModel |
getSelectionModel()
Returns the selection model used by the table view to handle the selection.
|
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(java.lang.String[])
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.
|
TableColumn |
getTableColumn(IlpAttribute attribute)
Returns the
TableColumn used to display the given attribute. |
JScrollBar |
getVerticalScrollBar()
Returns the vertical scroll bar that controls the viewport's horizontal view position.
|
IlpTableView |
getView()
Returns the view associated with the Table component.
|
IlpViewInteractor |
getViewInteractor()
Retrieves the current view interactor from the controller.
|
boolean |
isColumnFixed(IlpAttribute attribute)
Specifies whether the specified column is fixed.
|
boolean |
isColumnVisible(IlpAttribute attribute)
Specifies whether the specified column is visible.
|
boolean |
isObjectSelected(IlpObject object)
Returns
true if the given IlpObject
is selected. |
boolean |
isReorderingAllowed()
Returns
true if the user can rearrange column order by
dragging their headers. |
void |
refilter()
Reapplies the current filter to the adapter objects.
|
void |
removeAttribute(IlpAttribute attribute)
Removes a custom attribute from the table view.
|
void |
removePseudoClass(IlpObject bo,
IlpAttribute a,
String pseudo)
Removes a pseudoclass from the specified business object and
attribute.
|
void |
removeSelectionObject(IlpObject object)
Removes the given
IlpObject from the selection. |
IlpCellCoordinates |
searchValue(String value,
IlpCellCoordinates startingCell,
boolean scanRowByRow,
boolean caseMatching)
Searches for the specified string in the values displayed by the table.
|
void |
selectAll()
Selects all the cells visible in the table view.
|
void |
setAcceptedClass(IlpClass acceptedClass)
Sets the class of object the component will accept from the data source.
|
void |
setAcceptedClassName(String name)
Sets the class of object the component will accept from the data source.
|
void |
setAdapter(IlpListAdapter adpt)
Sets a new data source adapter.
|
void |
setAutoResizeMode(IlpTableResizeMode mode)
Sets the autoresize mode of the Table View.
|
void |
setColumnIndex(IlpAttribute attribute,
int index)
Moves the column of the specified attribute to the specified index.
|
void |
setColumnVisible(IlpAttribute attribute,
boolean visible)
Sets whether the specified column should be visible.
|
void |
setController(IlpTableController controller)
Sets the controller associated with the Table component.
|
void |
setDataSource(IlpDataSource dataSource)
Sets the data source that will be connected to the table model by means
of an
IlpListAdapter object. |
void |
setDataSource(IlpDataSource dataSource,
IlpClass acceptedClass)
Sets the data source that will be connected to the table model by means
of an
IlpListAdapter object. |
void |
setDefaultRenderer(IlpTableCellRenderer defaultRenderer)
Sets the renderer used for the cells.
|
void |
setDefaultViewInteractor(IlpViewInteractor interactor)
Sets the default view interactor.
|
void |
setEnabled(boolean enabled)
Sets whether or not this component is enabled.
|
void |
setFilter(IlpFilter filter)
Sets the filter.
|
void |
setFixedColumnCount(int nbColsToFix)
Sets the number of fixed columns in the table.
|
void |
setHeaderInteractor(IlpDefaultTableHeaderInteractor headerInteractor)
Sets the interactor used to manage events that occur in the table header.
|
void |
setHeaderRenderer(IlpTableHeaderRenderer headerRenderer)
Sets the header renderer used by the table.
|
void |
setModel(IlpTableModel model)
Sets the model to use with the Table component and connects it to the
current table view (if not
null ). |
void |
setProject(IlpProject proj)
Sets the project configuration, containing data source
information and style sheets.
|
void |
setProject(URL projectURL)
Sets a Table component project configuration.
|
void |
setReorderingAllowed(boolean reorderingAllowed)
Specifies whether the user can reorder columns in the table by dragging
their headers.
|
void |
setSelectedObject(IlpObject object)
Sets the selected
IlpObject . |
void |
setSelectedObjects(Collection objects)
Sets the set of selected
IlpObject s. |
void |
setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode of the table view.
|
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.
|
void |
setView(IlpTableView view)
Sets the view associated with the Table component and connects it to the
current table model (if not
null ). |
void |
setViewInteractor(IlpViewInteractor interactor)
Sets the interactor associated with the view.
|
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, getAccessibleContext, getBackground, 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, setComponentOrientation, 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 IlpTable()
Creates a Table component with default MVC components which are instances of:
Creates also an IlpDefaultListModel
object which should be used
to fill the table model in the default case.
The Table component is initialized using the default context.
IlpSystem.GetDefaultContext()
public IlpTable(IlpContext context)
Creates a Table component with default MVC components, which are instances of:
Creates also an IlpDefaultListModel
object, which should be used
to fill the table model in the default case.
context
- The context used by the table.IlpSystem.GetDefaultContext()
public IlpTable(IlpContext context, IlpTableModel model, IlpTableView view, IlpTableController controller)
Creates a Table component with given MVC components.
context
- The context used by the table.
If null
, the default context is used.model
- The model to be used; if
null
, an IlpTableListModel
is created.view
- The view to be used; if null
, an
IlpTableView
is created.controller
- The controller to be used; if
null
, an IlpTableController
is
created.IlpSystem.GetDefaultContext()
public void dispose()
Note: After calling this function, this table is no longer functional.
public IlpContext getContext()
IlpContext
used by this component.getContext
in interface IlpGraphicComponent
public IlpTableView getView()
null
.setView(ilog.cpl.table.IlpTableView)
public void setView(IlpTableView view)
null
).view
- The view to be used.
If null
, an IlpTableView
is created.getView()
public IlpTableController getController()
null
.setController(ilog.cpl.table.IlpTableController)
public void setController(IlpTableController controller)
controller
- The controller to be used.
If null
, an IlpTableController
is created.getController()
public IlpTableModel getModel()
null
.setModel(ilog.cpl.table.IlpTableModel)
public void setModel(IlpTableModel model)
null
).model
- The model to be used.
If null
, a default table model is created.getModel()
public IlpDefaultListModel getListModel()
IlpDefaultListModel
object which should be used to fill
the table model with representation objects.protected IlpTableModel createDefaultModel()
IlpTableListModel
.
A subclass can override this method to return a different model object.
IlpTableListModel
protected IlpTableView createDefaultView()
IlpTableView
.
A subclass can override this method to return a different view.
IlpTableView
protected IlpTableController createDefaultController()
IlpTableController
object.
A subclass can override this method to return a different controller. In that case, the controller can be created using the context of the current component.
getContext()
,
IlpSystem.GetDefaultContext()
,
IlpTableController
public void setDataSource(IlpDataSource dataSource, IlpClass acceptedClass)
IlpListAdapter
object. The table will be filled with
representation objects, contained in the data source, which match the
current accepted class.dataSource
- The data source to be connected to the table model.acceptedClass
- The class of object the component will accept
from the data source.getDataSource()
,
getAdapter()
,
getAcceptedClass()
public void setDataSource(IlpDataSource dataSource)
IlpListAdapter
object. The table will be filled with
representation objects, contained in the data source, which match the
current accepted class.setDataSource
in interface IlpGraphicComponent
dataSource
- The data source to be connected to the table model.getDataSource()
,
getAdapter()
,
getAcceptedClass()
,
setAcceptedClass(ilog.cpl.model.IlpClass)
public IlpDataSource getDataSource()
getDataSource
in interface IlpGraphicComponent
setDataSource(ilog.cpl.datasource.IlpDataSource, ilog.cpl.model.IlpClass)
public void setAdapter(IlpListAdapter adpt)
adpt
- The adapter that connects the table component to its
data source; cannot be null
.IllegalArgumentException
- if the given adapter is null
.getAdapter()
,
setDataSource(ilog.cpl.datasource.IlpDataSource, ilog.cpl.model.IlpClass)
,
setAcceptedClass(ilog.cpl.model.IlpClass)
public IlpListAdapter getAdapter()
setAdapter(ilog.cpl.list.IlpListAdapter)
,
setDataSource(ilog.cpl.datasource.IlpDataSource, ilog.cpl.model.IlpClass)
public void setAcceptedClass(IlpClass acceptedClass)
When this table is no longer needed, reset the accepted class property to allow it to be properly released by the system.
acceptedClass
- The class of object the data source will accept.setDataSource(IlpDataSource)
,
IlpListAdapter.setAcceptedClass(ilog.cpl.model.IlpClass)
,
IlpClass
public IlpClass getAcceptedClass()
IlpListAdapter.getAcceptedClass()
,
IlpClass
public void setAcceptedClassName(String name)
name
- The name of the class of object the data source
will accept.setAcceptedClass(IlpClass)
,
setDataSource(IlpDataSource,IlpClass)
,
IlpListAdapter.setAcceptedClass(IlpClass)
public String getAcceptedClassName()
public void setFilter(IlpFilter filter)
IlpObject
s that
pass through the filter are added to the model.filter
- The filter to use to filter business objects. This parameter
may be null
meaning the business objects are not filtered.IlpAbstractAdapter.setFilter(ilog.cpl.util.IlpFilter)
,
IlpFilter
public IlpFilter getFilter()
setFilter(IlpFilter)
,
IlpFilter
public void refilter()
This is a convenience method for the filter feature that is supported by the adapter. It applies the current filter to the objects that are represented. This method allows you to change the filter criterion without having to set a new filter in the adapter.
IlpAbstractAdapter.refilter()
public void addAttribute(IlpAttribute attribute)
attribute
- The attribute to add as a new column.IllegalArgumentException
- if the given attribute is
null
.public void removeAttribute(IlpAttribute attribute)
attribute
- The attribute to remove.IllegalArgumentException
- if the given attribute is
null
.@Deprecated public IlpGraphicViewStyleManager getStyleManager()
setStyleSheets(java.lang.String[])
or getStyleSheets()
instead.@Deprecated public IlpStyle getStyle()
null
if the table view has no graphic view
style manager. (This should not occur.)public IlpObject getSelectedObject()
IlpObject
from the collection of selected objects.
Returns null
if there is no selected object.getSelectedObject
in interface IlpObjectSelectionModel
IlpObjectSelectionModel.getSelectedObject()
,
IlpObject
public Collection getSelectedObjects()
IlpObject
s.
Returns an empty set if there is no selected object.getSelectedObjects
in interface IlpObjectSelectionModel
IlpObject
s.IlpObjectSelectionModel.getSelectedObjects()
,
IlpObject
public boolean isObjectSelected(IlpObject object)
isObjectSelected
in interface IlpObjectSelectionModel
object
- The object that may be selected.IlpObjectSelectionModel.isObjectSelected(ilog.cpl.model.IlpObject)
,
IlpObject
public void addSelectionObject(IlpObject object)
IlpObject
to the selection.
This has no effect if the given object is null
.addSelectionObject
in interface IlpObjectSelectionModel
object
- The object that will be added to the selection.IlpObjectSelectionModel.addSelectionObject(ilog.cpl.model.IlpObject)
,
IlpObject
public void removeSelectionObject(IlpObject object)
IlpObject
from the selection.
This has no effect if the given object is null
.removeSelectionObject
in interface IlpObjectSelectionModel
object
- The object that will be removed from the selection.IlpObjectSelectionModel.removeSelectionObject(ilog.cpl.model.IlpObject)
,
IlpObject
public void setSelectedObject(IlpObject object)
IlpObject
.
This has no effect if the given object is already selected.setSelectedObject
in interface IlpObjectSelectionModel
object
- The object that will become the selection.IlpObjectSelectionModel.setSelectedObject(ilog.cpl.model.IlpObject)
,
IlpObject
public void setSelectedObjects(Collection objects)
IlpObject
s.setSelectedObjects
in interface IlpObjectSelectionModel
objects
- The collection of objects that will become the selection.IlpObjectSelectionModel.setSelectedObjects(java.util.Collection)
,
IlpObject
public void selectAll()
IlpTableView.selectAll()
public void clearSelection()
clearSelection
in interface IlpObjectSelectionModel
IlpTableSelectionModel.clearSelection()
public void setSelectionMode(IlpTableSelectionMode selectionMode)
It can be one of the following values:
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.
You can customize the Table selection mode using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { selectionMode: MULTIPLE_OBJECTS_SELECTION; }
selectionMode
- The Selection mode to set.IllegalArgumentException
- if the given selection mode is
null
.IlpTableView.setSelectionMode(ilog.cpl.table.selection.IlpTableSelectionMode)
,
getSelectionMode()
,
getSelectionModel()
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_CELLS_SELECTION
.IllegalStateException
- if the current selection model is not an
instance of IlpDefaultTableSelectionModel
.setSelectionMode(ilog.cpl.table.selection.IlpTableSelectionMode)
,
getSelectionModel()
public IlpTableSelectionModel getSelectionModel()
IlpDefaultTableSelectionModel
that allows the change of the selection mode.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 TableColumn getTableColumn(IlpAttribute attribute)
TableColumn
used to display the given attribute.attribute
- The attribute whose table column has to be returned.IllegalArgumentException
- if the given attribute is
null
or if this attribute does not correspond to a
visible column in the tablepublic void setColumnIndex(IlpAttribute attribute, int index)
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.public int getColumnIndex(IlpAttribute attribute)
attribute
- The attribute of which the column index must be returned.-1
if the given attribute does not correspond to a
visible column in the table view.public IlpObject getRow(int rowIndex)
IlpObject
corresponding to the specified
row index in the given table.rowIndex
- The row index of the cell coordinates.IlpObject
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 in the given table.columnIndex
- The column index of the cell coordinates.IlpAttribute
contained in the specified index or
null
if an attribute could not be found.IndexOutOfBoundsException
- if the specified index is less than
0
or greater than or equal to the number of columns.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 set to true
, and column by column if this parameter is set to false.
.caseMatching
- Specifies whether the search should consider the case.null
if the value cannot be found.public void setFixedColumnCount(int nbColsToFix)
If 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)
.
You can customize the number of fixed columns using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { fixedColumnCount: 2; }
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 attribute
does not belong
to the table or is null
.attribute
- The attribute corresponding to the column.true
if the column specified by
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)
public boolean isColumnVisible(IlpAttribute attribute)
false
if attribute
does not belong
to the table model or is equal to null
.attribute
- The attribute corresponding to the column.setColumnVisible(ilog.cpl.model.IlpAttribute, boolean)
public boolean ensureVisible(IlpRepresentationObject object)
The operation is ignored if the given representation object is not part of the table component model.
true
if the object is visible, false
otherwisepublic 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
otherwisepublic void setReorderingAllowed(boolean reorderingAllowed)
Note: Fixed columns can be reordered but cannot be moved to nonfixed columns, and the converse.
You can customize whether columns can be reordered or not by the user using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { reorderingAllowed: true; }
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 IlpTableResizeMode getAutoResizeMode()
It can be one of the following values:
IlpTableResizeMode.AUTO_RESIZE_OFF
IlpTableResizeMode.AUTO_RESIZE_LAST_COLUMN
IlpTableResizeMode.AUTO_RESIZE_ALL_COLUMNS
The default mode is
IlpTableResizeMode.AUTO_RESIZE_OFF
.
IlpTableView.setAutoResizeMode(ilog.cpl.table.IlpTableResizeMode)
,
IlpTableView.getAutoResizeMode()
public void setEnabled(boolean enabled)
A component that is enabled may respond to user input, while a component that is not enabled cannot respond to user input.
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
enabled
- true
if this component should be
enabled, false
otherwisepublic void setAutoResizeMode(IlpTableResizeMode mode)
The autoresize mode can be set to one of the possible values:
IlpTableResizeMode.AUTO_RESIZE_OFF
IlpTableResizeMode.AUTO_RESIZE_LAST_COLUMN
IlpTableResizeMode.AUTO_RESIZE_ALL_COLUMNS
You can customize the autoresize mode of the table view using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { autoResizeMode: AUTO_RESIZE_OFF; }
mode
- The resize mode to set.IllegalArgumentException
- if the specified mode is null
.IlpTableView.setAutoResizeMode(ilog.cpl.table.IlpTableResizeMode)
,
IlpTableView.getAutoResizeMode()
public IlpViewInteractor getDefaultViewInteractor()
getDefaultViewInteractor
in interface IlpInteractiveGraphicComponent
public void setDefaultViewInteractor(IlpViewInteractor interactor)
setDefaultViewInteractor
in interface IlpInteractiveGraphicComponent
IlpInteractiveGraphicComponent.setViewInteractor(ilog.cpl.interactor.IlpViewInteractor)
public IlpViewInteractor getViewInteractor()
getViewInteractor
in interface IlpInteractiveGraphicComponent
public void setViewInteractor(IlpViewInteractor interactor)
setViewInteractor
in interface IlpInteractiveGraphicComponent
interactor
- The interactor to be set.
In the table component, the view interactor must be an instance
of IlpDefaultTableViewInteractor
or of any of its subclasses. This default view interactor implementation
supports interactions specific to:
It is also possible to customize the view interactor using cascading style sheets.
The following steps illustrate how you can customize a view interactor using CSS files:
Table { interactor: true; }
Interactor { viewInteractor: @+viewInt; } Subobject#viewInt { class: 'ilog.cpl.table.interactor.IlpDefaultTableViewInteractor'; }
setStyleSheets(java.lang.String[])
.
IlpTableController.setViewInteractor(ilog.cpl.interactor.IlpViewInteractor)
,
IlpDefaultTableViewInteractor
,
IlpDefaultPopupMenuFactory
,
IlpGestureAction
,
IlpKeyStrokeAction
public IlpDefaultTableHeaderInteractor getHeaderInteractor()
public void setHeaderInteractor(IlpDefaultTableHeaderInteractor headerInteractor)
Sets the interactor used to manage events that occur in the table header.
The table header interactor will only be effective if the view
interactor is an instance of
IlpDefaultTableViewInteractor
or one of its subclasses.
The table header interactor can also be customized using cascading style sheets (CSS).
The following steps illustrate how you can customize a header interactor using CSS files:
Table { interactor: true; }
Interactor { headerInteractor: @+headerInt; } Subobject#headerInt { class: 'ilog.cpl.table.interactor.IlpDefaultTableHeaderInteractor'; }
setStyleSheets(java.lang.String[])
public void setHeaderRenderer(IlpTableHeaderRenderer headerRenderer)
You can customize the header renderer used by the Table View using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { headerRenderer: @+renderer; } Subobject#renderer { class: 'ilog.cpl.table.IlpTableHeaderRenderer'; }
headerRenderer
- The header renderer to be used by the table.IlpTableHeaderRenderer
public IlpTableHeaderRenderer getHeaderRenderer()
public void setDefaultRenderer(IlpTableCellRenderer defaultRenderer)
You can customize the default renderer used by the table view by using cascading style sheets. The following example illustrates how you can accomplish this configuration:
Table { view: true; } View { defaultRenderer: @+renderer; } Subobject#renderer { class: 'ilog.cpl.table.IlpTableCellRenderer'; }
defaultRenderer
- The default renderer to be used by the table.IlpTableCellRenderer
public IlpTableCellRenderer getDefaultRenderer()
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.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 file names of CSS files (usually with a
.css
suffix) or CSS extracts.updateMask
- A flag that indicates whether the component and/or the
business objects must be updated to use this new
configuration. When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the view and adapter are 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()
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 CSS extract.IlvStylingException
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. When this method is used, you can indicate whether you want to
reapply this configuration immediately to the view, the adapter, and all
the objects that are already being displayed in the component.
setStyleSheets
in interface IlpStylable
index
- The index of the style sheet to replace.css
- The URL, file name or CSS extract of the new style
sheet.updateMask
- A flag that indicates whether the component and/or the
business objects must be updated to use this new
configuration. When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the view and adapter are 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 String[] getStyleSheets()
getStyleSheets
in interface IlvStylable
setStyleSheets(String[])
public String getStyleSheets(int index)
getStyleSheets
in interface IlvStylable
index
- The position of the cascading style sheet to return.index
-th position in the style sheet array.setStyleSheets(int, 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.
You can customize the style sheet debug mask directly in your CSS files as illustrated in the following example:
StyleSheet { styleSheetDebugMask: "DECL_MASK|DECL_VALUE_MASK|FAILED_CONVERSIONS_MASK"; }
setStyleSheets(java.lang.String[])
,
getStyleSheetDebugMask()
,
IlvStylable.APPLIED_RULE_MASK
,
IlvStylable.BAD_CLASS_MASK
,
IlvStylable.BAD_PROP_MASK
,
IlvStylable.BAD_PROP_WITH_STACK_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 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 pseudoclass
to add to the classes already associated with
the data object.IlpTableView.addPseudoClass(ilog.cpl.model.IlpObject, ilog.cpl.model.IlpAttribute, java.lang.String)
public void removePseudoClass(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 pseudoclass
to move from the classes associated with
the data object.IlpTableView.removePseudoClass(ilog.cpl.model.IlpObject, ilog.cpl.model.IlpAttribute, java.lang.String)
public void doLayout()
public void setProject(URL projectURL) throws IOException
The project configuration will be applied to the component, modifying the datasource and style sheet configuration.
projectURL
- New project configurationIOException
,
- if the project URL contains
invalid dataIOException
setDataSource(IlpDataSource)
,
setStyleSheets(String[])
,
getProject()
,
IlpProject
public void setProject(IlpProject proj)
The project configuration will be applied to the component, modifying the datasource and style sheet configuration.
IlpProject
,
setDataSource(IlpDataSource)
,
setStyleSheets(String[])
,
getProject()
public IlpProject getProject()
null
if a project
configuration has not been set in this component.public final JScrollPane getScrollView()
public final JScrollBar getHorizontalScrollBar()
public final JScrollBar getVerticalScrollBar()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.