VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class CreationPolicy<VR> extends AbstractTransactionPolicy<VR>
CreationPolicy
is an AbstractTransactionPolicy
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 ContentPolicy
s of anchored IContentPart
s.
This policy should be registered at an IRootPart
. It depends on
ContentPolicy
s being registered on all IContentPart
s that are
affected by the creation.
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
CreationPolicy() |
Modifier and Type | Method and Description |
---|---|
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 |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. |
protected ITransactionalOperation |
createSelectOperation(IContentPart<VR,? extends VR> part)
Returns an
ITransactionalOperation that adds the given
IContentPart to the SelectionModel of the corresponding
IViewer . |
protected AbstractCompositeOperation |
getCompositeOperation()
Extracts a
AbstractCompositeOperation from the operation created
by createOperation() . |
checkInitialized, commit, getOperation, init, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, getHost, setAdaptable
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 AbstractTransactionPolicy.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 AbstractTransactionPolicy.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 createOperation()
AbstractTransactionPolicy
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. The created operation should allow for
local execution
at each time.createOperation
in class AbstractTransactionPolicy<VR>
ITransactionalOperation
to encapsulate all applied
changes.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.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.Copyright (c) 2014 itemis AG and others. All rights reserved.