VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class ContentPartPool<VR>
extends java.lang.Object
IContentPart
s that is used by
ContentBehavior
s. They will add IContentPart
s, which are
removed from the viewer during content synchronization (e.g. because the
related content element was deleted), to be re-used (i.e. removed again and
restored within the viewer) when the content element re-appears during
synchronization, e.g. because of an undo of a delete operation. The
motivation behind recycling IContentPart
s is that after an undo the
viewer is in the exact same state as before the execution of an operation
(which may be important for feedback or handles).Constructor and Description |
---|
ContentPartPool() |
Modifier and Type | Method and Description |
---|---|
void |
add(IContentPart<VR,? extends VR> part)
Adds an
IContentPart to this pool. |
void |
clear()
Clears the pool, that is removes all
IContentPart s. |
IContentPart<VR,? extends VR> |
remove(java.lang.Object content)
Retrieves an
IContentPart for the given content element and
removes it from the pool. |
public void add(IContentPart<VR,? extends VR> part)
IContentPart
to this pool. The IContentPart
will
be stored under its content element (IContentPart.getContent()
)
and may later be retrieved back via this content element (see
remove(Object)
.part
- The IContentPart
to add to the pool.public void clear()
IContentPart
s.public IContentPart<VR,? extends VR> remove(java.lang.Object content)
IContentPart
for the given content element and
removes it from the pool.content
- The IContentPart
that was registered for the content
element, or null
if no IContentPart
could
be retrieved for the content element.null
if none could be found.Copyright (c) 2014 itemis AG and others. All rights reserved.