|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.cpl.datasource.IlpAbstractAdapter
ilog.cpl.datasource.IlpAbstractHierarchyAdapter
public abstract class IlpAbstractHierarchyAdapter
Abstract adapter for representing hierarchies of objects.
This class provides support for features that are common to the Tree, Network and Equipment adapters.
| Constructor Summary | |
|---|---|
IlpAbstractHierarchyAdapter()
Default constructor. |
|
IlpAbstractHierarchyAdapter(IlpContext context)
Constructor. |
|
| Method Summary | |
|---|---|
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 properties)
Apply the new configuration |
List |
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 |
getOrigins()
Returns the list of origin identifiers. |
protected Collection |
getPossibleRoots()
This method returns a list of possible root objects. |
List |
getRoots()
Returns the list of root objects created by this adapter. |
protected boolean |
hasConfigurationChanged(Map 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 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 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 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ilog.cpl.datasource.DataSourceListener |
|---|
objectAttributeChanged, objectsAdded, objectsRemoved, objectStructureChanged |
| Constructor Detail |
|---|
public IlpAbstractHierarchyAdapter()
IlpChild and IlpContainer
interfaces.
public IlpAbstractHierarchyAdapter(IlpContext context)
IlpChild and IlpContainer
interfaces.
context - The context used by this adapter.| Method Detail |
|---|
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 newOrigins,
boolean show)
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 implementation is not very efficient, as it 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 getRoots()
The returned list shall not be modified.
public List 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 getPossibleRoots()
getPossibleRoots in class IlpAbstractAdapterprotected 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.
testObject in class IlpAbstractAdapterIlpAbstractAdapter.setFilter(ilog.cpl.util.IlpFilter),
IlpAbstractAdapter.setExcludedClasses(java.util.List)protected boolean testRootObject(IlpObject ilpObject)
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 IlpAbstractAdapterpublic 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: ...;
}
IlpExpansionStrategyFactorypublic IlpExpansionStrategyFactory getExpansionStrategyFactory()
protected IlpExpansionStrategy createExpansionStrategy(IlpObject ilpObject)
IlpExpansionStrategypublic abstract void loadChildren(IlpRepresentationObject representation)
Expansion strategies use this method to load objects that are present in the data source into the representation model.
IlpExpansionStrategypublic abstract void releaseChildren(IlpRepresentationObject representation)
Expansion strategies use this method to release objects that are present in the representation model.
IlpExpansionStrategypublic 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 IlpAbstractAdapterid - Object identifierpublic void setAcceptedClasses(List 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 getAcceptedClasses()
It may well be an empty list.
protected void initializeAcceptedClasses()
protected void replaceAcceptedClasses(List newInclusion)
newInclusion - New list. This is always a non-empty list.setAcceptedClasses(java.util.List)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 properties)
hasConfigurationChanged in class IlpAbstractAdaptertrue if one of the properties being set is different
from the current value in the adapter.IlpAbstractAdapterprotected void doApplyConfiguration(Map properties)
doApplyConfiguration in class IlpAbstractAdapterIlpAbstractAdapter
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||