public class IlpEquipmentAdapter extends IlpAbstractNodeAdapter implements IlpStylableAdapter
This adapter gets IlpObject
s from a data source and
creates corresponding equipment nodes and equipment links in an equipment
model.
This class is stylable using cascading style sheets. The
CSS customization is done using files that are loaded in method
setStyleSheets(java.lang.String[])
.
The following extract illustrates the adapter customization for the equipment component:
Equipment { 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.
FILTER_BREADTH_FIRST_THRESHOLD
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 |
---|
IlpEquipmentAdapter()
Default constructor.
|
IlpEquipmentAdapter(IlpContext context)
Constructor with a given context.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers a property change listener.
|
protected IlpBusinessObjectCustomization |
applyObjectCustomization(IlpObject ilpObject)
Returns the object that contains all the customization properties
of the given business object.
|
protected void |
clearRepresentationObjects()
Removes all objects created by this adapter
|
protected IlpRepresentationLink |
createLink(IlpObject ilpObject,
IlpRepresentationNode fromNode,
IlpRepresentationNode toNode)
Creates a representation link object from a given business object.
|
protected IlpRepresentationNode |
createNode(IlpObject ilpObject)
Creates a representation node object from a given business object.
|
protected void |
doApplyConfiguration(Map properties)
Applies the new configuration.
|
void |
endChangingEquipmentModel()
Deprecated.
Use
IlpAbstractDataSource.endBatch()
instead. |
protected ilog.cpl.datasource.css.internal.IlpStylableAdapterSupport |
getCSSDelegate()
Returns the context information needed to provide support to
cascading style sheets.
|
IlpEquipmentNode |
getEquipmentNode(IlpObject ilpObject)
Returns the equipment node representing the
IlpObject . |
IlpEquipmentNode |
getEquipmentNode(Object identifier)
Returns the equipment node that represents the
IlpObject
that is identified by identifier . |
IlpEquipmentLinkFactory |
getLinkFactory()
Returns the equipment link factory.
|
IlpMutableEquipmentModel |
getModel()
Returns the equipment model.
|
IlpMutableStyleSheet |
getMutableStyleSheet()
Returns a mutable style sheet that can be used to change the adapter
configuration dynamically.
|
IlpEquipmentNodeFactory |
getNodeFactory()
Returns the equipment node factory.
|
int |
getStyleSheetDebugMask()
Returns the current debug level.
|
String[] |
getStyleSheets()
Returns the cascading style sheets.
|
String |
getStyleSheets(int index)
Returns one of the cascading style sheets.
|
protected boolean |
hasConfigurationChanged(Map properties)
Checks if the new configuration has changed compared
with the current configuration.
|
boolean |
hasStyleSheets()
Returns if cascading style sheets have been configured for this
adapter instance.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Unregisters a property change listener.
|
protected IlpRepresentationObject |
removeRepresentation(Object id)
Removes the representation object that corresponds to the given
identifier.
|
void |
setLinkFactory(IlpEquipmentLinkFactory linkFactory)
Sets the equipment link factory.
|
void |
setModel(IlpMutableEquipmentModel model)
Sets the equipment model.
|
void |
setNodeFactory(IlpEquipmentNodeFactory nodeFactory)
Sets the equipment node factory.
|
void |
setStyleSheetDebugMask(int mask)
Sets the debug level while parsing the cascading 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 |
startChangingEquipmentModel()
Deprecated.
Use
IlpAbstractDataSource.startBatch()
instead. |
clearTemporaryRepresentationObjects, createRepresentationObject, customizeAllObjects, customizeObject, fillModel, getDefaultExpansionType, getExpansionType, getPendingLinksCount, getPositionAttribute, getPositionAttribute, getRepresentationModel, getRepresentationNode, getRepresentationNode, hasModel, hasTemporaryRepresentationObject, initializeExcludedClasses, isPendingLink, loadChildren, objectAttributeChanged, objectsAdded, objectsRemoved, objectStructureChanged, refilterObjects, releaseChildren, removeTemporaryRepresentationObject, setPositionAttribute, setRepresentationModel, storeTemporaryRepresentationObject
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, initializeRepresentationObjects, isRepresenting, refilter, removeAdapterListener, removePropertyChangeListener, replaceExcludedClasses, setBatchable, setDataSource, setExcludedClasses, setFilter, startBatch, stopRepresentation
public IlpEquipmentAdapter()
IlpDefaultEquipmentNodeFactory
instance; the equipment
link factory with an IlpDefaultEquipmentLinkFactory
and the expansion strategy factory with an instance of
IlpDefaultNodeExpansionStrategyFactory
.public IlpEquipmentAdapter(IlpContext context)
IlpDefaultEquipmentNodeFactory
instance; the equipment
link factory with an IlpDefaultEquipmentLinkFactory
and the expansion strategy factory with an instance of
IlpDefaultNodeExpansionStrategyFactory
.context
- The context.IlpContext
,
IlpDefaultEquipmentNodeFactory
,
IlpDefaultEquipmentLinkFactory
,
IlpDefaultNodeExpansionStrategyFactory
public void setStyleSheets(String[] css) throws IlvStylingException
This method uses the context URL Access Service to convert file names into URLs.
setStyleSheets
in interface IlvStylable
css
- An array of strings containing the URLs or the file names of
CSS files (usually with a .css
suffix).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
or the file names of CSS files (usually with a
.css
suffix).updateMask
- Flag that indicates if the adapter and/or the business
object must be updated to use this new configuration.
When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the adapter is reconfigured with the new style
sheets. When
IlpStylable.UPDATE_OBJECTS_MASK
is set, the business objects that are handled by this
adapter 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
setStyleSheets(java.lang.String[])
.
It lets you change one particular style sheet file, instead of setting
the whole style sheet array.
This method uses the context URL Access Service to convert file names into URLs.
setStyleSheets
in interface IlvStylable
index
- The index of the style sheet to replace.css
- The URL or file name of the new style sheet file.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 if you want to
reapply this configuration immediately to the adapter and all the
representation objects that are already being managed by it.
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
- Flag that indicates whether the adapter and/or the
business objects must be updated to use this new
configuration. When
IlpStylable.UPDATE_COMPONENT_MASK
is set, the adapter is reconfigured with the new style
sheets. When
IlpStylable.UPDATE_OBJECTS_MASK
is
set, the business objects that are handled by this
adapter are reconfigured according to the new style
sheets.IlvStylingException.
IlvStylingException
IlpStylable.UPDATE_COMPONENT_MASK
,
IlpStylable.UPDATE_OBJECTS_MASK
,
getStyleSheets(int)
public String getStyleSheets(int index)
getStyleSheets
in interface IlvStylable
index
- The position of the cascading style sheet to return.index
-th position.setStyleSheets(int,String)
,
setStyleSheets(String[])
public String[] getStyleSheets()
getStyleSheets
in interface IlvStylable
setStyleSheets(String[])
public boolean hasStyleSheets()
true
if cascading style sheets have been set in this
context.public void setStyleSheetDebugMask(int mask)
setStyleSheets(java.lang.String[])
to debug
problems during configuration.
Note: This property can be set using a CSS, as illustrated below:
StyleSheet { styleSheetDebugMask: 'BAD_PROP_MASK|BAD_CLASS_MASK'; }
setStyleSheetDebugMask
in interface IlvStylable
mask
- The debug mask, expressed as an OR combination of the
predefined flags.setStyleSheets(java.lang.String[])
,
getStyleSheetDebugMask()
,
IlvStylable.APPLIED_RULE_MASK
,
IlvStylable.BAD_CLASS_MASK
,
IlvStylable.BAD_PROP_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 addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface IlvStylable
addPropertyChangeListener
in class IlpAbstractAdapter
listener
- The listener to register.public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface IlvStylable
removePropertyChangeListener
in class IlpAbstractAdapter
listener
- The listener to unregister.public IlpMutableStyleSheet getMutableStyleSheet()
IlpStylableAdapter
The mutable style sheet is created and registered in this adapter when this method is called for the first time.
Note: if you replace the existing style sheets, the mutable style sheet will no longer be connected to this adapter. Once this happens, a future call to this method will then create a new mutable style sheet and register it.
getMutableStyleSheet
in interface IlpStylableAdapter
protected ilog.cpl.datasource.css.internal.IlpStylableAdapterSupport getCSSDelegate()
protected IlpBusinessObjectCustomization applyObjectCustomization(IlpObject ilpObject)
applyObjectCustomization
in class IlpAbstractNodeAdapter
ilpObject
- Business objectnull
if customization is
not available.protected boolean hasConfigurationChanged(Map properties)
hasConfigurationChanged
in class IlpAbstractHierarchyAdapter
true
if one of the properties being set is different
from the current value in the adapter.IlpAbstractAdapter
protected void doApplyConfiguration(Map properties)
This method is used during css configuration.
doApplyConfiguration
in class IlpAbstractHierarchyAdapter
IlpAbstractAdapter
protected IlpRepresentationNode createNode(IlpObject ilpObject)
This method returns a representation object that is not a link.
createNode
in class IlpAbstractNodeAdapter
ilpObject
- The business objectprotected IlpRepresentationLink createLink(IlpObject ilpObject, IlpRepresentationNode fromNode, IlpRepresentationNode toNode)
createLink
in class IlpAbstractNodeAdapter
ilpObject
- The business object.fromNode
- The from
endpoint for the link.toNode
- The to
endpoint for the link.protected void clearRepresentationObjects()
clearRepresentationObjects
in class IlpAbstractNodeAdapter
protected IlpRepresentationObject removeRepresentation(Object id)
IlpAbstractAdapter
removeRepresentation
in class IlpAbstractNodeAdapter
id
- Object identifierpublic IlpMutableEquipmentModel getModel()
This is a bound property.
public void setModel(IlpMutableEquipmentModel model)
This is a bound property.
model
- The model in which the adapter puts the representation objects.public IlpEquipmentNode getEquipmentNode(IlpObject ilpObject)
IlpObject
.
All objects in an equipment model are equipment nodes, even equipment links.public IlpEquipmentNode getEquipmentNode(Object identifier)
IlpObject
that is identified by identifier
.
All objects in an equipment model are equipment nodes, even equipment
links.public void setLinkFactory(IlpEquipmentLinkFactory linkFactory)
Note: This property can be customized using CSS, as illustrated below:
Adapter { linkFactory: @+factoryDef; } Subobject#factoryDef { class: ...; }
linkFactory
- The link representation object factory.public IlpEquipmentLinkFactory getLinkFactory()
public void setNodeFactory(IlpEquipmentNodeFactory nodeFactory)
Note: This property can be customized using a CSS.
Adapter { nodeFactory: @+factoryDef; } Subobject#factoryDef { class: ...; }
nodeFactory
- The node representation object factory.public IlpEquipmentNodeFactory getNodeFactory()
@Deprecated public void startChangingEquipmentModel()
IlpAbstractDataSource.startBatch()
instead.
After this call, the model notification events are delayed
until the next call to endChangingEquipmentModel
.
This method ensures that the
startChangingEquipmentModel
method of the model is called
using the proper synchronization strategy; that is, in the Swing event
thread in a regular application.
Note that this method does nothing if the adapter does not have a model.
endChangingEquipmentModel()
,
IlpMutableEquipmentModel.startChangingEquipmentModel()
@Deprecated public void endChangingEquipmentModel()
IlpAbstractDataSource.endBatch()
instead.startChangingEquipmentModel
.
Contrary to the method
IlpMutableEquipmentModel
, this method ensures that the
endChangingEquipmentModel
method of the model is called using
the proper synchronization strategy; that is, in the Swing event thread in
a regular application.
Note that this method does nothing if the adapter does not have a model.
startChangingEquipmentModel()
,
IlpMutableEquipmentModel.endChangingEquipmentModel()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.