VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class ContentPolicy<VR> extends AbstractPolicy<VR> implements ITransactional
ITransactional.NoOperation, ITransactional.UnexecutableOperation| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized
Stores the initialized flag for this policy, i.e.
|
NOOP, UNEXECUTABLE| 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. |
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the last ITransactional.init() call. |
void |
deleteContent()
Creates and records operations to delete the
host of
this ContentPolicy from the content model, i.e. detaches all
content anchoreds, detaches from all content anchorages, and removes from
its parent's content children. |
void |
detachAllContentAnchoreds()
Creates and records operations to detach all content anchoreds from the
host of this ContentPolicy. |
void |
detachFromAllContentAnchorages()
Creates and records operations to detach the
host of
this ContentPolicy from all content anchorages. |
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. |
IContentPart<VR,? extends VR> |
getHost()
|
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
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 |
removeFromParent()
Creates and records operations to remove the content of this
ContentPolicy's host from its parent. |
void |
setAdaptable(IVisualPart<VR,? extends VR> adaptable) |
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, initpublic 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.public ITransactionalOperation commit()
ITransactionalITransactionalOperation that performs all
manipulations applied by the policy since the last ITransactional.init() call.
When called multiple times in sequence, only the first call will yield an
operation, the subsequent calls will yield null.
You can return ITransactional.NOOP if no changes have to be applied. The domain
will filter out all ITransactional.NOOPs before their execution.
You can return ITransactional.UNEXECUTABLE to prevent any composite operation
that contains the ITransactional.UNEXECUTABLE from execution.
commit in interface ITransactionalITransactionalOperation that performs all
manipulations applied by the policy since the last
ITransactional.init() call.public void deleteContent()
host of
this ContentPolicy from the content model, i.e. detaches all
content anchoreds, detaches from all content anchorages, and removes from
its parent's content children.public void detachAllContentAnchoreds()
host of this ContentPolicy.public void detachFromAllContentAnchorages()
host of
this ContentPolicy from all content anchorages.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.public IContentPart<VR,? extends VR> getHost()
IPolicypublic void init()
ITransactionalIllegalStateException. It is safe to call ITransactional.init()
multiple times in sequence.init in interface ITransactionalpublic 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 removeFromParent()
ContentPolicy's host from its parent.public void setAdaptable(IVisualPart<VR,? extends VR> adaptable)
setAdaptable in interface IAdaptable.Bound<IVisualPart<VR,? extends VR>>setAdaptable in class AbstractPolicy<VR>Copyright (c) 2014 itemis AG and others. All rights reserved.