VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class CreationPolicy<VR> extends AbstractPolicy<VR> implements ITransactional
CreationPolicy is an ITransactional
AbstractPolicy that handles the creation of content.
It handles the creation by initiating the adding of a content child to the
content parent via the ContentPolicy of the parent
IContentPart, as well as the attachment of anchored content elements
via the ContentPolicys of anchored IContentParts.
This policy should be registered at an IRootPart. It depends on
ContentPolicys being registered on all IContentParts that are
affected by the creation.
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 |
|---|
CreationPolicy() |
| Modifier and Type | Method and Description |
|---|---|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the last ITransactional.init() call. |
IContentPart<VR,? extends VR> |
create(java.lang.Object content,
IContentPart<VR,? extends VR> parent,
int index,
com.google.common.collect.SetMultimap<IContentPart<VR,? extends VR>,java.lang.String> anchoreds)
Creates an
IContentPart for the given content Object and
establishes parent and anchored relationships for the newly created part. |
IContentPart<VR,? extends VR> |
create(java.lang.Object content,
IContentPart<VR,? extends VR> parent,
com.google.common.collect.SetMultimap<IContentPart<VR,? extends VR>,java.lang.String> anchoreds)
Creates an
IContentPart for the given content Object and
establishes parent and anchored relationships for the newly created part. |
protected ITransactionalOperation |
createFocusOperation(IContentPart<VR,? extends VR> part)
Returns an
ITransactionalOperation that adds the given
IContentPart to the FocusModel of the corresponding
IViewer. |
protected ITransactionalOperation |
createSelectOperation(IContentPart<VR,? extends VR> part)
Returns an
ITransactionalOperation that adds the given
IContentPart to the SelectionModel of the corresponding
IViewer. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
commit, getAdaptable, getHost, init, restoreRefreshVisuals, setAdaptable, storeAndDisableRefreshVisualspublic 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 IContentPart<VR,? extends VR> create(java.lang.Object content, IContentPart<VR,? extends VR> parent, int index, com.google.common.collect.SetMultimap<IContentPart<VR,? extends VR>,java.lang.String> anchoreds)
IContentPart for the given content Object and
establishes parent and anchored relationships for the newly created part.
Besides, operations are created for the establishment of the parent and
anchored relationships within the content model. These operations are
part of the operation returned by commit().content - The content Object to be created.parent - The IContentPart where the content is added as
a child.index - The index for the new element.anchoreds - The IContentPart whose content should be attached to
the new content under the given roles.IContentPart controlling the newly created content.public IContentPart<VR,? extends VR> create(java.lang.Object content, IContentPart<VR,? extends VR> parent, com.google.common.collect.SetMultimap<IContentPart<VR,? extends VR>,java.lang.String> anchoreds)
IContentPart for the given content Object and
establishes parent and anchored relationships for the newly created part.
Besides, operations are created for the establishment of the parent and
anchored relationships within the content model. These operations are
part of the operation returned by commit().content - The content Object to be created.parent - The IContentPart where the content is added as
a child.anchoreds - The IContentPart whose content should be attached to
the new content under the given roles.IContentPart controlling the newly created content.protected ITransactionalOperation createFocusOperation(IContentPart<VR,? extends VR> part)
ITransactionalOperation that adds the given
IContentPart to the FocusModel of the corresponding
IViewer.part - The IContentPart that is added to the viewer models.ITransactionalOperation that changes the viewer
models.protected ITransactionalOperation createSelectOperation(IContentPart<VR,? extends VR> part)
ITransactionalOperation that adds the given
IContentPart to the SelectionModel of the corresponding
IViewer.part - The IContentPart that is added to the viewer models.ITransactionalOperation that changes the viewer
models.public void init()
ITransactionalIllegalStateException. It is safe to call ITransactional.init()
multiple times in sequence.init in interface ITransactionalCopyright (c) 2014 itemis AG and others. All rights reserved.