public class IlpTableController extends IlpAbstractGraphicController
IlpTableView
(and only one).
It must be connected to the table view using its method
IlpTableView.setController(ilog.cpl.graphic.IlpGraphicController)
or set in an IlpTable
.
It uses by default an IlpListModelSorter
chained to an
IlpListModelFilter
which are automatically interposed between an
IlpDefaultListModel
and the table model when the controller is used
with an IlpTable
.
lastInteractedObject, lastInteractionStates
Constructor and Description |
---|
IlpTableController()
Constructs a default controller for a table, instantiating a model filter
and a model sorter.
|
IlpTableController(IlpContext context)
Constructs a default controller for a table, instantiating a model filter
and a model sorter.
|
Modifier and Type | Method and Description |
---|---|
void |
addSortingCriteria(IlpAttribute attribute,
int order,
boolean ascendingOrder,
boolean useDisplayValue)
Adds sorting criteria for an attribute.
|
protected IlpViewInteractionContext |
createViewInteractionContext(IlpGraphicView view)
Returns a new view interaction context for the given view.
|
IlpFilter |
getFilter()
Returns the filter used to filter the underlying model.
|
IlpDefaultTableHeaderInteractor |
getHeaderInteractor()
Returns the header interactor used to manage events that occur in the
table header.
|
IlpAbstractTableInteractorRenderer |
getInteractorRenderer()
Accesses the interactor renderer.
|
IlpListModelFilter |
getModelFilter()
Returns the object used to filter the representation objects in the table
the controller controls.
|
IlpListModelSorter |
getModelSorter()
Returns the object used to sort the representation objects in the table
the controller controls.
|
int |
getSortedAttributesCount()
Returns the number of attributes used to sort the table view.
|
int |
getSortingOrder(IlpAttribute attribute)
Gets the position of the specified attribute in the sorting operation.
|
protected ilog.cpl.table.internal.IlpTableViewSupport |
getTableViewSupport()
Access to the table view support, used internally.
|
IlpAbstractTableViewRenderer |
getViewRenderer()
Accesses the view renderer.
|
boolean |
isUsingAscendingOrder(IlpAttribute attribute)
Returns
true if the given attribute is sorted and the sort is in
ascending order. |
boolean |
isUsingDisplayValue(IlpAttribute attribute)
Returns
true if the given attribute is sorted and the sort
uses display values. |
void |
refilter()
Reapplies the filter to the current objects.
|
void |
removeAllSortingCriteria()
Clears the current sorting.
|
void |
removeSortingCriteria(IlpAttribute attribute)
Removes an attribute from the sorted attributes in the table.
|
void |
setFilter(IlpFilter filter)
Sets the filter to use to filter the underlying model.
|
void |
setHeaderInteractor(IlpDefaultTableHeaderInteractor headerInteractor)
Sets the header interactor that will be used to manage events that
occur in the table header.
|
void |
setViewInteractor(IlpViewInteractor interactor)
Sets the interactor associated with the view.
|
attach, attachView, createGraphicViewStyleManager, detach, focusGained, focusLost, getCompleteObjectInteractor, getContext, getDefaultInteractorManager, getDefaultViewInteractor, getFocusEventComponent, getKeyEventComponent, getMouseEventComponent, getObjectInteractionState, getObjectInteractor, getObjectInteractor, getObjectInteractor, getObjectInteractor, getObjectInteractor, getView, getViewInteractionContext, getViewInteractor, initGraphicViewStyleManager, initInteractorManager, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, removeObjectInteractors, removeObjectInteractors, removeObjectInteractors, setDefaultInteractorManager, setDefaultViewInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractor
public IlpTableController()
IlpContext
set on IlpSystem
.IlpSystem.GetDefaultContext()
public IlpTableController(IlpContext context)
context
- The context to use to initialize this controller;
cannot be null
.IlpSystem.GetDefaultContext()
public void setViewInteractor(IlpViewInteractor interactor)
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 that are specific to:
setViewInteractor
in interface IlpGraphicController
setViewInteractor
in class IlpAbstractGraphicController
interactor
- Interactor which handles events that occur in the
table view.IlpDefaultTableViewInteractor
public IlpDefaultTableHeaderInteractor getHeaderInteractor()
public void setHeaderInteractor(IlpDefaultTableHeaderInteractor headerInteractor)
headerInteractor
- Interactor that handles events that occur
in the table header.IlpDefaultTableHeaderInteractor
public IlpListModelFilter getModelFilter()
public IlpListModelSorter getModelSorter()
public IlpAbstractTableViewRenderer getViewRenderer()
public IlpAbstractTableInteractorRenderer getInteractorRenderer()
public void setFilter(IlpFilter filter)
filter
- The filter. May be null
. In this case, the
underlying model is not filtered, that is, this model will
provide all the data from the underlying model.getFilter()
public IlpFilter getFilter()
null
.setFilter(IlpFilter)
public void refilter()
When filter properties have changed, this method enables you to reapply the current filter without having to set a new filter instance.
public int getSortedAttributesCount()
public void removeSortingCriteria(IlpAttribute attribute)
null
or does not belong to the sorted attributes.attribute
- The attribute to remove.public void removeAllSortingCriteria()
public int getSortingOrder(IlpAttribute attribute)
attribute
- The attribute concerned.0
means that the attribute
is not used to sort the list.public boolean isUsingAscendingOrder(IlpAttribute attribute)
true
if the given attribute is sorted and the sort is in
ascending order.attribute
- The attribute concerned.public boolean isUsingDisplayValue(IlpAttribute attribute)
true
if the given attribute is sorted and the sort
uses display values.attribute
- The attribute concerned.public void addSortingCriteria(IlpAttribute attribute, int order, boolean ascendingOrder, boolean useDisplayValue)
attribute
- The attribute to sort.order
- The sorting order of the attribute. If order
is less than or equal to 0
, the attribute is put in the
first position.
If order
is greater than the current number of attributes
used for the sort, the column is put in the last position.
If the attribute is already sorted, its index or sorting direction is changed.ascendingOrder
- Specifies whether the attribute will be sorted in
ascending (true
) or descending order.useDisplayValue
- Specifies whether the attribute will be sorted
using display values or raw values.IllegalArgumentException
- if the given attribute equals
null
.protected IlpViewInteractionContext createViewInteractionContext(IlpGraphicView view)
IlpAbstractGraphicController
createViewInteractionContext
in class IlpAbstractGraphicController
view
- The view for which to create a view interaction context.protected ilog.cpl.table.internal.IlpTableViewSupport getTableViewSupport()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.