VR
- The visual root node of the UI toolkit this
AbstractContentPart
is used in, e.g. javafx.scene.Node in
case of JavaFX.V
- The visual node used by this AbstractContentPart
.public abstract class AbstractContentPart<VR,V extends VR> extends AbstractVisualPart<VR,V> implements IContentPart<VR,V>
IContentPart
, intended to be
sub-classed by clients to create their own custom IContentPart
.IAdaptable.Bound<A extends IAdaptable>
pcs
CONTENT_PROPERTY
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY
ADAPTERS_PROPERTY
ACTIVE_PROPERTY
Constructor and Description |
---|
AbstractContentPart() |
Modifier and Type | Method and Description |
---|---|
void |
addContentChild(java.lang.Object contentChild,
int index)
Inserts the given contentChild as a child to this part's content,
so that it will be returned by subsequent calls to
IContentPart.getContentChildren() . |
void |
attachToContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
Attaches this part's content to the given contentAnchorage under
the specified role, so that it will be returned by subsequent
calls to
IContentPart.getContentAnchorages() . |
void |
detachFromContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
Detaches this part's content from the given contentAnchorage under
the specified role, so that it will no longer be returned by
subsequent calls to
IContentPart.getContentAnchorages() . |
java.lang.Object |
getContent()
Returns this part's content.
|
com.google.common.collect.SetMultimap<? extends java.lang.Object,java.lang.String> |
getContentAnchorages()
Returns the content objects that are to be regarded as anchorages of this
IContentPart 's content (IContentPart.getContent() ) with an (optional)
role qualifier for each anchorage-anchored link that has to be
established. |
java.util.List<? extends java.lang.Object> |
getContentChildren()
Returns a
List of all of this part's content children. |
protected void |
register(IViewer<VR> viewer)
Called when a link to the Viewer is obtained.
|
protected void |
registerAtContentPartMap(IViewer<VR> viewer,
java.lang.Object content)
Registers the model in the
IViewer.getContentPartMap() . |
void |
removeContentChild(java.lang.Object contentChild,
int index)
Removes the given contentChild from this part's content children,
so that it will no longer be returned by subsequent calls to
IContentPart.getContentChildren() . |
void |
setContent(java.lang.Object content)
Set the primary model object that this EditPart represents.
|
protected void |
unregister(IViewer<VR> viewer)
Called when the link to the Viewer is lost.
|
protected void |
unregisterFromContentPartMap(IViewer<VR> viewer,
java.lang.Object content)
Unregisters the model in the
IViewer.getContentPartMap() . |
activate, addAnchorage, addAnchorage, addAnchored, addChild, addChild, addChildren, addChildren, addChildVisual, addPropertyChangeListener, attachToAnchorageVisual, createVisual, deactivate, detachFromAnchorageVisual, dispose, doActivate, doDeactivate, doRefreshVisual, getAdapter, getAdapter, getAdapter, getAdapters, getAdapters, getAnchorages, getAnchoreds, getBehaviors, getChildren, getParent, getPolicies, getRoot, getViewer, getVisual, isActive, isRefreshVisual, refreshVisual, registerAtVisualPartMap, removeAnchorage, removeAnchorage, removeAnchored, removeChild, removeChildren, removeChildVisual, removePropertyChangeListener, reorderChild, setAdapter, setAdapter, setAdapter, setAdapters, setParent, setRefreshVisual, unregisterFromVisualPartMap, unsetAdapter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAnchorage, addAnchorage, addAnchored, addChild, addChild, addChildren, addChildren, getAnchorages, getAnchoreds, getBehaviors, getChildren, getParent, getPolicies, getRoot, getVisual, isRefreshVisual, refreshVisual, removeAnchorage, removeAnchorage, removeAnchored, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual
getAdapter, getAdapter, getAdapter, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, unsetAdapter
activate, deactivate, isActive
addPropertyChangeListener, removePropertyChangeListener
dispose
public void addContentChild(java.lang.Object contentChild, int index)
IContentPart
IContentPart.getContentChildren()
.addContentChild
in interface IContentPart<VR,V extends VR>
contentChild
- An Object
which should be added as a child to this
part's content.index
- The index at which the contentChild should be added.public void attachToContentAnchorage(java.lang.Object contentAnchorage, java.lang.String role)
IContentPart
IContentPart.getContentAnchorages()
.attachToContentAnchorage
in interface IContentPart<VR,V extends VR>
contentAnchorage
- An Object
to which this part's content should be
attached to.role
- The role under which the attachment is to be established.public void detachFromContentAnchorage(java.lang.Object contentAnchorage, java.lang.String role)
IContentPart
IContentPart.getContentAnchorages()
.detachFromContentAnchorage
in interface IContentPart<VR,V extends VR>
contentAnchorage
- An Object
from which this part's content should be
detached from.role
- The role under which the attachment is established.public java.lang.Object getContent()
IContentPart
getContent
in interface IContentPart<VR,V extends VR>
IContentPart.getContent()
public com.google.common.collect.SetMultimap<? extends java.lang.Object,java.lang.String> getContentAnchorages()
IContentPart
IContentPart
's content (IContentPart.getContent()
) with an (optional)
role qualifier for each anchorage-anchored link that has to be
established.
In case of a connection, one anchorage could have the "START" role, and another the "END" role. Using the role mechanism, the same anchorage may also have both roles, which can, for instance, be used for self connections.
getContentAnchorages
in interface IContentPart<VR,V extends VR>
SetMultimap
of the content anchorages with a role to
qualify each anchorage-anchored link. If there is only a single
anchorage-anchored link to a respective anchorage, its role may
be left undefined (i.e. the map will contain an entry of the form
(anchorage, null
)).public java.util.List<? extends java.lang.Object> getContentChildren()
IContentPart
List
of all of this part's content children.getContentChildren
in interface IContentPart<VR,V extends VR>
List
of all of this part's content children.protected void register(IViewer<VR> viewer)
AbstractVisualPart
register
in class AbstractVisualPart<VR,V extends VR>
viewer
- The viewer to register at.protected void registerAtContentPartMap(IViewer<VR> viewer, java.lang.Object content)
IViewer.getContentPartMap()
.
Subclasses should only extend this method if they need to register this
EditPart in additional ways.viewer
- The viewer to register at.content
- The content to register.public void removeContentChild(java.lang.Object contentChild, int index)
IContentPart
IContentPart.getContentChildren()
.removeContentChild
in interface IContentPart<VR,V extends VR>
contentChild
- An Object
which should be removed from this part's
content children.index
- The index of the contentChild that is removed.public void setContent(java.lang.Object content)
EditPartFactory
when creating an EditPart.setContent
in interface IContentPart<VR,V extends VR>
content
- The new content for this part.IContentPart.setContent(Object)
protected void unregister(IViewer<VR> viewer)
AbstractVisualPart
unregister
in class AbstractVisualPart<VR,V extends VR>
viewer
- The viewer to unregister from.protected void unregisterFromContentPartMap(IViewer<VR> viewer, java.lang.Object content)
IViewer.getContentPartMap()
.
Subclasses should only extend this method if they need to unregister this
EditPart in additional ways.viewer
- The viewer to unregister from.content
- The content to unregister.Copyright (c) 2014 itemis AG and others. All rights reserved.