public abstract class IlpAbstractHierarchyAdapter extends IlpAbstractAdapter
This class provides support for features that are common to the Tree, Network and Equipment adapters.
Constructor and Description |
---|
IlpAbstractHierarchyAdapter()
Default constructor.
|
IlpAbstractHierarchyAdapter(IlpContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected IlpExpansionStrategy |
createExpansionStrategy(IlpObject ilpObject)
Returns the expansion strategy that will be used by the object
created by this adapter to represent the given business object.
|
protected void |
customizeAllObjects()
Apply configuration to all objects.
|
protected abstract void |
customizeObject(IlpObject object)
This method is automatically called by
createExpansionStrategy to guarantee that every new
object (or updated) is customized before being added to this
adapter. |
protected void |
doApplyConfiguration(Map<String,Object> properties)
Apply the new configuration
|
List<IlpClass> |
getAcceptedClasses()
Returns the list of accepted classes.
|
IlpExpansionStrategyFactory |
getExpansionStrategyFactory()
Returns the expansion strategy factory being used by this adapter.
|
IlpExpansionType |
getExpansionType(IlpObject ilpObject)
Retrieves the expansion type of a given business object.
|
List<Object> |
getOrigins()
Returns the list of origin identifiers.
|
protected Collection<IlpObject> |
getPossibleRoots()
This method returns a list of possible root objects.
|
List<IlpRepresentationObject> |
getRoots()
Returns the list of root objects created by this adapter.
|
protected boolean |
hasConfigurationChanged(Map<String,Object> properties)
Checks if the new configuration has changed comparing
with the current configuration.
|
protected void |
initializeAcceptedClasses()
Initializes the predefined list of accepted classes.
|
boolean |
isEmptyOrigins()
Returns
true if the list of origin identifiers is empty. |
boolean |
isOrigin(Object id)
Returns
true if the identifier is part of the list of origins. |
boolean |
isShowingOrigin()
Returns
true if the origins are shown. |
abstract void |
loadChildren(IlpRepresentationObject representation)
Loads the child objects of the given object, if they are not yet present
in the representation model.
|
abstract void |
releaseChildren(IlpRepresentationObject representation)
Signals that the model and the attached views do not need the
child objects of the given object anymore.
|
protected IlpRepresentationObject |
removeRepresentation(Object id)
Removes the representation object that corresponds to the given
identifier.
|
protected void |
replaceAcceptedClasses(List<IlpClass> newInclusion)
This method is called to replace the existing accepted class list
with a new one.
|
void |
resetOrigins()
Resets the list of origin identifiers.
|
void |
setAcceptedClasses(List<IlpClass> newInclusion)
Sets the list of business classes that should be accepted by
this adapter.
|
void |
setExpansionStrategyFactory(IlpExpansionStrategyFactory factory)
Sets the expansion strategy that will be used by the representation
objects created by this adapter.
|
protected void |
setExpansionType(IlpObject ilpObject,
IlpExpansionType expansion)
Stores the expansion type for a given business object.
|
void |
setOrigins(List<Object> newOrigins,
boolean show)
Sets the list of origin identifiers.
|
protected boolean |
testObject(IlpObject ilpObject)
Returns
true if an object of the data source should be
represented. |
protected boolean |
testRootObject(IlpObject ilpObject)
Returns
true if an object of the data source should be
represented as a root object in the hierarchy. |
addAdapterListener, addPropertyChangeListener, addPropertyChangeListener, addRepresentation, applyConfiguration, batchEnded, batchStarted, beginRepresentation, clearIdToRepresentationObjectMap, clearRepresentationObjects, createRepresentationObject, endBatch, fillModel, firePropertyChange, fireRepresentationObjectsAdded, fireRepresentationObjectsRemoved, getContext, getDataSource, getExcludedClasses, getFilter, getRepresentationObject, getRepresentationObject, getRepresentationObjects, getSyncStrategy, hasModel, hasRepresentationObject, hasRepresentationObjects, initializeExcludedClasses, initializeRepresentationObjects, isRepresenting, refilter, refilterObjects, removeAdapterListener, removePropertyChangeListener, removePropertyChangeListener, replaceExcludedClasses, setBatchable, setDataSource, setExcludedClasses, setFilter, startBatch, stopRepresentation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
objectAttributeChanged, objectsAdded, objectsRemoved, objectStructureChanged
public IlpAbstractHierarchyAdapter()
IlpChild
and IlpContainer
interfaces.public IlpAbstractHierarchyAdapter(IlpContext context)
IlpChild
and IlpContainer
interfaces.context
- The context used by this adapter.public void resetOrigins()
After a call to this method, the list is empty and
isShowingOrigin()
returns false
. Thus, only the objects
that do not have a parent are considered root objects.
public void setOrigins(List<Object> newOrigins, boolean show)
Sets the list of origin identifiers.
By default, the list is empty and the origins are not shown, which means that only the objects that do not have a parent are considered root objects.
In the case where you specify identifiers in the list:
showOrigins
is set to
true
), the objects whose identifiers are included in the origin
list will be represented as root objects.
showOrigins
is set to
false
), the objects whose parent identifiers are included in the
origin list will be represented as root objects.
Note that, if you pass an empty list with showOrigin
set to
true
, no object will be represented.
The current removes all representation objects and recreates them.
Note: The predefined adapters extending this class allow this property to be customized using CSS, as illustrated below:
Adapter { origins[0]: NE1; origins[1]: NE2; showOrigin: true; }
newOrigins
- The list of object origin identifiers. Note that this
list is copied to the internal list of origins. This
parameter cannot be null
.show
- This Boolean indicates whether the origins as defined
in the newOrigins
parameter should be shown.public List<IlpRepresentationObject> getRoots()
The returned list shall not be modified.
public List<Object> getOrigins()
It may well be an empty list.
public boolean isEmptyOrigins()
true
if the list of origin identifiers is empty.
When this list is empty only the objects that do not have a parent are considered root objects.
public boolean isOrigin(Object id)
true
if the identifier is part of the list of origins.id
- The identifier to be checked.true
if the identifier is included in the list of origins.public boolean isShowingOrigin()
true
if the origins are shown.setOrigins(List,boolean)
protected Collection<IlpObject> getPossibleRoots()
getPossibleRoots
in class IlpAbstractAdapter
protected boolean testObject(IlpObject ilpObject)
true
if an object of the data source should be
represented.
By default, it returns true
if there is no filtering or
if the ilpObject
passes through the filter and the
excluded class list.
protected boolean testRootObject(IlpObject ilpObject)
Returns true
if an object of the data source should be
represented as a root object in the hierarchy.
In fact, an object is represented during this iteration if this method
returns true
and the
IlpAbstractAdapter.testObject(IlpObject)
method returns true
.
The behavior of this method depends on the list of origins. See
setOrigins(List,boolean)
for an explanation.
testRootObject
in class IlpAbstractAdapter
public void setExpansionStrategyFactory(IlpExpansionStrategyFactory factory)
Note: The predefined adapters extending this class allow this property to be customized using CSS, as illustrated below:
Adapter { expansionStrategyFactory: @+factoryDef; } Subobject#factoryDef { class: ...; }
IlpExpansionStrategyFactory
public IlpExpansionStrategyFactory getExpansionStrategyFactory()
protected IlpExpansionStrategy createExpansionStrategy(IlpObject ilpObject)
IlpExpansionStrategy
public abstract void loadChildren(IlpRepresentationObject representation)
Expansion strategies use this method to load objects that are present in the data source into the representation model.
IlpExpansionStrategy
public abstract void releaseChildren(IlpRepresentationObject representation)
Expansion strategies use this method to release objects that are present in the representation model.
IlpExpansionStrategy
public IlpExpansionType getExpansionType(IlpObject ilpObject)
Compatibility Note: In JViews 8.0,
ilog.cpl.model.IlpObject.ExpansionType
has been replaced by IlpExpansionType
.
ilpObject
- The business object containing the expansion type.protected void setExpansionType(IlpObject ilpObject, IlpExpansionType expansion)
The only way to modify the expansion type of an existing representation object is by recreating it accordingly. This method does not do that, thus, it should be called immediately before creating the corresponding representation object - subclasses can modify this behavior.
Note: The predefined adapters extending this class allow this property to be customized using CSS, as illustrated below:
object { expansion: NO_EXPANSION; }
Compatibility Note: In JViews 8.0,
ilog.cpl.model.IlpObject.ExpansionType
has been replaced by IlpExpansionType
.
ilpObject
- The business object.expansion
- The expansion type for the given object.protected IlpRepresentationObject removeRepresentation(Object id)
IlpAbstractAdapter
removeRepresentation
in class IlpAbstractAdapter
id
- Object identifierpublic void setAcceptedClasses(List<IlpClass> newInclusion)
By default, the list is empty. This means that all business objects will be converted to representation objects. However, this does not include the ones that do not match the current filter criteria. If you specify business classes in the list, only the business objects from the given classes or from one of its subclasses will be automatically filtered. Their representation will be created in the associated representation model.
Note: The predefined adapters extending this class allow this property to be customized using CSS, as illustrated below:
Adapter { acceptedClasses[0]: "business class A"; acceptedClasses[1]: "business class B"; }
newInclusion
- The list of IlpClass
. Note that
this list is copied to the internal list of accepted
classes.public List<IlpClass> getAcceptedClasses()
It may well be an empty list.
protected void initializeAcceptedClasses()
protected void replaceAcceptedClasses(List<IlpClass> newInclusion)
newInclusion
- New list. This is always a non-empty list.setAcceptedClasses(java.util.List<ilog.cpl.model.IlpClass>)
protected void customizeAllObjects()
This method should be called whenever a new style sheet is applied. At this adaptation level, the only thing to do is to update the expansionType structure. Subclasses of this adapter may require the updated objects to be removed and recreated.
protected abstract void customizeObject(IlpObject object)
createExpansionStrategy
to guarantee that every new
object (or updated) is customized before being added to this
adapter.object
- The object to be customized.protected boolean hasConfigurationChanged(Map<String,Object> properties)
hasConfigurationChanged
in class IlpAbstractAdapter
true
if one of the properties being set is different
from the current value in the adapter.IlpAbstractAdapter
protected void doApplyConfiguration(Map<String,Object> properties)
doApplyConfiguration
in class IlpAbstractAdapter
IlpAbstractAdapter
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.