public class IlpContainmentTreeAdapter extends IlpAbstractTreeAdapter
This adapter gets IlpObject
s from a data source and
creates corresponding tree nodes in a tree model.
This class is stylable using cascading style sheets. The
CSS customization is done using files that are loaded in method
IlpAbstractTreeAdapter.setStyleSheets(java.lang.String[])
.
The following extract illustrates the adapter customization of the tree component:
Tree { adapter: true; } Adapter { origins[0]: id0; origins[1]: id1; showOrigin: true; filter: @+myFilter; ... } Subobject#myFilter { class: ...; }
Please refer to the properties defined by this adapter class for information about how each property can be customized using cascading style sheets.
Modifier and Type | Field and Description |
---|---|
static int |
FILTER_BREADTH_FIRST_THRESHOLD
This parameter is used by the tree adapter to identify the algorithm
that should be used when refiltering objects.
|
ARBITRARY_COMPARATOR
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
Constructor and Description |
---|
IlpContainmentTreeAdapter()
Constructor.
|
IlpContainmentTreeAdapter(IlpContext context)
Constructor with a given context.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearRepresentationObjects()
Called when all representation objects should be cleared.
|
protected IlpTreeNode |
createNode(IlpObject ilpObject)
This method creates a tree node and registers it in the adapter
structures.
|
protected IlpRepresentationObject |
createRepresentationObject(IlpObject ilpObject)
Creates a representation object and registers it in the adapter
structure.
|
protected void |
customizeAllObjects()
Apply CSS configuration to all objects.
|
protected void |
fillModel()
Fill the model with the representation objects.
|
void |
loadChildren(IlpRepresentationObject representation)
Loads the child objects of the given object, if they are not yet
present in the representation model.
|
void |
objectAttributeChanged(DataSourceObjectEvent e)
Called when an object attribute has changed.
|
void |
objectsAdded(DataSourceEvent e)
Called when objects have been added to the data source.
|
void |
objectsRemoved(DataSourceEvent e)
Called when objects have been removed from the data source.
|
void |
objectStructureChanged(DataSourceObjectEvent e)
Called when an object structure has changed.
|
protected void |
refilterObjects()
Reapplies the filter to the objects that exist in the attached
data source.
|
void |
releaseChildren(IlpRepresentationObject representation)
Signals that the model and the attached views do not need the
child objects of the given object anymore.
|
addPropertyChangeListener, customizeObject, doApplyConfiguration, getComparator, getCSSDelegate, getDefaultExpansionType, getExpansionType, getModel, getMutableStyleSheet, getObjectAttributeChangedFilter, getRootInsertionNode, getStyleSheetDebugMask, getStyleSheets, getStyleSheets, getTreeNode, getTreeNode, getTreeNodeFactory, hasConfigurationChanged, hasExpansionTypeChanged, hasModel, hasStyleSheets, notifyObjectAttributeChangedEvent, removePropertyChangeListener, removeRepresentation, setComparator, setModel, setObjectAttributeChangedFilter, setStyleSheetDebugMask, setStyleSheets, setStyleSheets, setStyleSheets, setStyleSheets, setTreeNodeFactory, sort
createExpansionStrategy, getAcceptedClasses, getExpansionStrategyFactory, getOrigins, getPossibleRoots, getRoots, initializeAcceptedClasses, isEmptyOrigins, isOrigin, isShowingOrigin, replaceAcceptedClasses, resetOrigins, setAcceptedClasses, setExpansionStrategyFactory, setExpansionType, setOrigins, testObject, testRootObject
addAdapterListener, addPropertyChangeListener, addRepresentation, applyConfiguration, batchEnded, batchStarted, beginRepresentation, clearIdToRepresentationObjectMap, endBatch, firePropertyChange, fireRepresentationObjectsAdded, fireRepresentationObjectsRemoved, getContext, getDataSource, getExcludedClasses, getFilter, getRepresentationObject, getRepresentationObject, getRepresentationObjects, getSyncStrategy, hasRepresentationObject, hasRepresentationObjects, initializeExcludedClasses, initializeRepresentationObjects, isRepresenting, refilter, removeAdapterListener, removePropertyChangeListener, replaceExcludedClasses, setBatchable, setDataSource, setExcludedClasses, setFilter, startBatch, stopRepresentation
public static int FILTER_BREADTH_FIRST_THRESHOLD
If the threshold is set to -1
, breadth-first is always
applied, no matter the number of objects that are present in the
data source.
If the number of objects in the data source is below the given threshold, the refiltering is applied through a breadth-first algorithm. If the number of objects is above the given threshold, the refiltering is applied by removing and recreating the objects.
refilterObjects()
public IlpContainmentTreeAdapter()
IlpDefaultTreeNodeFactory
instance.IlpDefaultTreeNodeFactory
public IlpContainmentTreeAdapter(IlpContext context)
context
- The context.
This constructor initializes the representation object factory
with an IlpDefaultTreeNodeFactory
instance.IlpDefaultTreeNodeFactory
protected void customizeAllObjects()
The method will check for changes in the expansion type of each object represented by this adapter. In case of change, the object will be removed and recreated.
customizeAllObjects
in class IlpAbstractHierarchyAdapter
protected void clearRepresentationObjects()
clearRepresentationObjects
in class IlpAbstractAdapter
protected void fillModel()
fillModel
in class IlpAbstractAdapter
protected void refilterObjects()
The default implementation performs a breadth-first search
on the tree nodes. It tests each node that is currently displayed
against the new filter criteria. The worst case performance of the
algorithm is o(n)
, where n
is the number of
objects in the data source.
If the number of objects present in the attached data source is large,
the performance of this algorithm may not be good. In this case, instead of
performing a systematic breadth-first search, you can configure the
threshold
of the breadth-first
algorithm.
refilterObjects
in class IlpAbstractAdapter
protected IlpTreeNode createNode(IlpObject ilpObject)
The tree node is created by the registered tree node factory.
IlpAbstractTreeAdapter.getTreeNodeFactory()
protected IlpRepresentationObject createRepresentationObject(IlpObject ilpObject)
createRepresentationObject
in class IlpAbstractAdapter
public void loadChildren(IlpRepresentationObject representation)
This implementation executes the following steps:
loadChildren
in class IlpAbstractHierarchyAdapter
IlpExpansionStrategy
public void releaseChildren(IlpRepresentationObject representation)
This implementation executes the following steps:
releaseChildren
in class IlpAbstractHierarchyAdapter
IlpExpansionStrategy
public void objectsAdded(DataSourceEvent e)
public void objectsRemoved(DataSourceEvent e)
public void objectStructureChanged(DataSourceObjectEvent e)
e
- The event containing data on the change.public void objectAttributeChanged(DataSourceObjectEvent e)
e
- The event containing data on the change.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.