public class ContentPolicy extends AbstractPolicy
ITransactionalOperations that delegate
to respective operations of the host IContentPart upon execution.
In detail, the following delegations are performed to operations of the host
IContentPart:
addContentChild(Object, int) will delegate through a
AddContentChildOperation to
IContentPart.addContentChild(Object, int)removeContentChild(Object) will delegate through a
RemoveContentChildOperation to
IContentPart.removeContentChild(Object)attachToContentAnchorage(Object, String) will delegate through a
AttachToContentAnchorageOperation to
IContentPart.attachToContentAnchorage(Object, String)detachFromContentAnchorage(Object, String) will delegate through
a DetachFromContentAnchorageOperation to
IContentPart#detachFromContentAnchorage(Object, String)}
This policy should be registered on each IContentPart.
adaptableadaptableIAdaptable.Bound.Impl<T extends IAdaptable>| Constructor and Description |
|---|
ContentPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
addContentChild(java.lang.Object contentChild,
int index)
Creates and records operations to add the given contentChild to
the
host of this ContentPolicy at the
specified index. |
void |
attachToContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
Creates and records operations to attach the
host of
this ContentPolicy to the specified contentAnchorage under
the specified role. |
protected ITransactionalOperation |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractPolicy through its
"work" methods. |
void |
detachFromContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
Creates and records operations to detach the
host of
this ContentPolicy from the specified contentAnchorage
under the specified role. |
protected AbstractCompositeOperation |
getCompositeOperation()
Extracts a
AbstractCompositeOperation from the operation created
by createOperation(). |
IContentPart<? extends javafx.scene.Node> |
getHost()
|
void |
removeContentChild(java.lang.Object contentChild)
Creates and records operations to remove the given contentChild
from the content children of the
host of this
ContentPolicy. |
void |
setAdaptable(IVisualPart<? extends javafx.scene.Node> adaptable) |
checkInitialized, commit, getOperation, init, isInitialized, locallyExecuteOperation, rollbackadaptableProperty, getAdaptableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptableProperty, getAdaptablepublic void addContentChild(java.lang.Object contentChild,
int index)
host of this ContentPolicy at the
specified index.contentChild - The content Object that is to be added to the
host of this ContentPolicy.index - The index of the new content child.public void attachToContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
host of
this ContentPolicy to the specified contentAnchorage under
the specified role.contentAnchorage - The content Object to which the host of this ContentPolicy is to be attached.role - The role for the attachment.protected ITransactionalOperation createOperation()
AbstractPolicyITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractPolicy through its
"work" methods. The created operation should allow for
local execution at each time.createOperation in class AbstractPolicyITransactionalOperation to encapsulate all applied
changes.public void detachFromContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
host of
this ContentPolicy from the specified contentAnchorage
under the specified role.contentAnchorage - The content Object from which the getHost()
of this ContentPolicy is detached.role - The role under which the anchorage is detached.protected AbstractCompositeOperation getCompositeOperation()
AbstractCompositeOperation from the operation created
by createOperation(). The composite operation is used to combine
individual content change operations.AbstractCompositeOperation that is used to combine
the individual content change operations.public IContentPart<? extends javafx.scene.Node> getHost()
IPolicyIPolicy.public void removeContentChild(java.lang.Object contentChild)
host of this
ContentPolicy.contentChild - The content Object that is removed from content
children of the host of this
ContentPolicy.public void setAdaptable(IVisualPart<? extends javafx.scene.Node> adaptable)
setAdaptable in interface IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>setAdaptable in class IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.