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.| Type | Property and Description |
|---|---|
ReadOnlySetMultimapProperty<java.lang.Object,java.lang.String> |
contentAnchoragesUnmodifiable
Returns an unmodifiable read-only set-multimap property containing the
content anchorages.
|
javafx.beans.property.ReadOnlyListProperty<java.lang.Object> |
contentChildrenUnmodifiable
Returns an unmodfiable read-only property containing the content
children.
|
javafx.beans.property.ObjectProperty<java.lang.Object> |
content
A writable property representing the
IContentPart's content. |
active, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, children, parent, refreshVisualanchoragesUnmodifiable, anchoredsUnmodifiable, children, parent, refreshVisualadaptersactiveIAdaptable.Bound<A extends IAdaptable>CONTENT_ANCHORAGES_PROPERTY, CONTENT_CHILDREN_PROPERTY, CONTENT_PROPERTYANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTYADAPTERS_PROPERTYACTIVE_PROPERTY| Constructor and Description |
|---|
AbstractContentPart()
Creates a new
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.getContentChildrenUnmodifiable(). |
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.getContentAnchoragesUnmodifiable(). |
ReadOnlySetMultimapProperty<java.lang.Object,java.lang.String> |
contentAnchoragesUnmodifiableProperty()
Returns an unmodifiable read-only set-multimap property containing the
content anchorages.
|
javafx.beans.property.ReadOnlyListProperty<java.lang.Object> |
contentChildrenUnmodifiableProperty()
Returns an unmodfiable read-only property containing the content
children.
|
javafx.beans.property.ObjectProperty<java.lang.Object> |
contentProperty()
A writable property representing the
IContentPart's content. |
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.getContentAnchoragesUnmodifiable(). |
protected void |
doAddContentChild(java.lang.Object contentChild,
int index)
Adds the given contentChild to this part's content children, so
that it will no longer be returned by subsequent calls to
doGetContentChildren(). |
protected void |
doAttachToContentAnchorage(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
doGetContentAnchorages(). |
protected void |
doDetachFromContentAnchorage(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
doGetContentAnchorages(). |
protected abstract com.google.common.collect.SetMultimap<? extends java.lang.Object,java.lang.String> |
doGetContentAnchorages()
Hook method to return the current list of content anchorages.
|
protected abstract java.util.List<? extends java.lang.Object> |
doGetContentChildren()
Hook method to return the current list of content children.
|
protected void |
doRemoveContentChild(java.lang.Object contentChild)
Removes the given contentChild from this part's content children,
so that it will no longer be returned by subsequent calls to
doGetContentChildren(). |
protected void |
doReorderContentChild(java.lang.Object contentChild,
int newIndex)
Rearranges the given contentChild to the new index position.
|
java.lang.Object |
getContent()
Returns this part's content.
|
ObservableSetMultimap<java.lang.Object,java.lang.String> |
getContentAnchoragesUnmodifiable()
Gets the value of the property contentAnchoragesUnmodifiable.
|
javafx.collections.ObservableList<java.lang.Object> |
getContentChildrenUnmodifiable()
Gets the value of the property contentChildrenUnmodifiable.
|
boolean |
isFocusable()
Returns
true if policies and other parts of the application
are allowed to assign focus to this part by changing the
FocusModel. |
boolean |
isSelectable()
Returns
true if policies and other parts of the application
are allowed to add this part to the selection maintained by the
SelectionModel. |
protected void |
onContentChanged(java.lang.Object oldContent,
java.lang.Object newContent)
Called whenever the content of this
IContentPart changed. |
void |
refreshContentAnchorages()
Triggers a re-computation of the content anchorages of this
IContentPart. |
void |
refreshContentChildren()
Triggers a re-computation of the content children of this
IContentPart. |
protected void |
register(IViewer<VR> viewer)
Called when a link to the
IViewer 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)
Removes the given contentChild from this part's content children,
so that it will no longer be returned by subsequent calls to
IContentPart.getContentChildrenUnmodifiable(). |
void |
reorderContentChild(java.lang.Object contentChild,
int newIndex)
Rearranges the given contentChild to the new index position.
|
void |
setContent(java.lang.Object content)
Set the primary content object that this EditPart represents.
|
protected void |
unregister(IViewer<VR> viewer)
Called when the link to the
IViewer is lost. |
protected void |
unregisterFromContentPartMap(IViewer<VR> viewer,
java.lang.Object content)
Unregisters the model in the
IViewer.getContentPartMap(). |
activate, activateChildren, activeProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, addChildVisual, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, attachToAnchorageVisual, childrenProperty, createVisual, deactivate, deactivateChildren, detachAnchored, detachFromAnchorage, detachFromAnchorage, detachFromAnchorageVisual, determineViewer, dispose, doActivate, doDeactivate, doRefreshVisual, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getParent, getPolicies, getRoot, getViewer, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, registerAtVisualPartMap, removeChild, removeChildren, removeChildVisual, reorderChild, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregisterFromVisualPartMap, unsetAdapterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getParent, getPolicies, getRoot, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisualadaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapteractivate, activeProperty, deactivate, isActivedisposepublic ReadOnlySetMultimapProperty<java.lang.Object,java.lang.String> contentAnchoragesUnmodifiableProperty
contentAnchoragesUnmodifiableProperty in interface IContentPart<VR,V extends VR>getContentAnchoragesUnmodifiable()public javafx.beans.property.ReadOnlyListProperty<java.lang.Object> contentChildrenUnmodifiableProperty
contentChildrenUnmodifiableProperty in interface IContentPart<VR,V extends VR>IContentPart.CONTENT_CHILDREN_PROPERTY.getContentChildrenUnmodifiable()public final javafx.beans.property.ObjectProperty<java.lang.Object> contentProperty
contentProperty in interface IContentPart<VR,V extends VR>IContentPart.CONTENT_PROPERTY.getContent(),
setContent(Object)public AbstractContentPart()
AbstractContentPart.public final void addContentChild(java.lang.Object contentChild,
int index)
IContentPart.getContentChildrenUnmodifiable().
Delegates to doAddContentChild(Object, int), which is to be
overwritten by subclasses.
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 final void attachToContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
IContentPart.getContentAnchoragesUnmodifiable().
Delegates to doAttachToContentAnchorage(Object, String), which
is to be overwritten by subclasses.
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 ReadOnlySetMultimapProperty<java.lang.Object,java.lang.String> contentAnchoragesUnmodifiableProperty()
IContentPartcontentAnchoragesUnmodifiableProperty in interface IContentPart<VR,V extends VR>getContentAnchoragesUnmodifiable()public javafx.beans.property.ReadOnlyListProperty<java.lang.Object> contentChildrenUnmodifiableProperty()
IContentPartcontentChildrenUnmodifiableProperty in interface IContentPart<VR,V extends VR>IContentPart.CONTENT_CHILDREN_PROPERTY.getContentChildrenUnmodifiable()public final javafx.beans.property.ObjectProperty<java.lang.Object> contentProperty()
IContentPartIContentPart's content.contentProperty in interface IContentPart<VR,V extends VR>IContentPart.CONTENT_PROPERTY.getContent(),
setContent(Object)public final void detachFromContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
IContentPart.getContentAnchoragesUnmodifiable().
Delegates to doDetachFromContentAnchorage(Object, String), which
is to be overwritten by subclasses.
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.protected void doAddContentChild(java.lang.Object contentChild,
int index)
doGetContentChildren().contentChild - An Object which should be removed from this part's
content children.index - The index of the contentChild that is removed.protected void doAttachToContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
doGetContentAnchorages().contentAnchorage - An Object to which this part's content should be
attached to.role - The role under which the attachment is to be established.protected void doDetachFromContentAnchorage(java.lang.Object contentAnchorage,
java.lang.String role)
doGetContentAnchorages().contentAnchorage - An Object from which this part's content should be
detached from.role - The role under which the attachment is established.protected abstract com.google.common.collect.SetMultimap<? extends java.lang.Object,java.lang.String> doGetContentAnchorages()
protected abstract java.util.List<? extends java.lang.Object> doGetContentChildren()
protected void doRemoveContentChild(java.lang.Object contentChild)
doGetContentChildren().contentChild - An Object which should be removed from this part's
content children.protected void doReorderContentChild(java.lang.Object contentChild,
int newIndex)
contentChild - The Object which is to be reordered.newIndex - The index to which the content child is to be reordered.public java.lang.Object getContent()
IContentPartgetContent in interface IContentPart<VR,V extends VR>IContentPart.getContent()public ObservableSetMultimap<java.lang.Object,java.lang.String> getContentAnchoragesUnmodifiable()
getContentAnchoragesUnmodifiable in interface IContentPart<VR,V extends VR>ObservableSetMultimap 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 javafx.collections.ObservableList<java.lang.Object> getContentChildrenUnmodifiable()
getContentChildrenUnmodifiable in interface IContentPart<VR,V extends VR>List of all of this part's content children.public boolean isFocusable()
IContentParttrue if policies and other parts of the application
are allowed to assign focus to this part by changing the
FocusModel. Otherwise returns false.isFocusable in interface IContentPart<VR,V extends VR>true if policies and other parts of the application
are allowed to assign focus to this part by changing the
FocusModel, otherwise false.public boolean isSelectable()
IContentParttrue if policies and other parts of the application
are allowed to add this part to the selection maintained by the
SelectionModel. Otherwise returns false.isSelectable in interface IContentPart<VR,V extends VR>true if policies and other parts of the application
are allowed to add this part to the selection maintained by the
SelectionModel, otherwise false.protected void onContentChanged(java.lang.Object oldContent,
java.lang.Object newContent)
IContentPart changed.oldContent - The old content.newContent - The new/current content.public void refreshContentAnchorages()
IContentPartIContentPart.refreshContentAnchorages in interface IContentPart<VR,V extends VR>public void refreshContentChildren()
IContentPartIContentPart.refreshContentChildren in interface IContentPart<VR,V extends VR>protected void register(IViewer<VR> viewer)
AbstractVisualPartIViewer is obtained. Registers this
IVisualPart for its "main" visual (i.e. the one returned by
AbstractVisualPart.getVisual()) at the IViewer.getVisualPartMap() of the
given IViewer. To simplify matters, this IVisualPart only
has to register itself for its "main" visual, i.e. if the "main" visual
contains a number of children visuals, it does not need to register
itself for those children visuals. Therefore, if the visualization
changes dynamically, the registration at the visual-part-map does not
need to be updated. Consequently, when looking up an IVisualPart
for a given visual in the visual-part-map, it is required to walk up the
visual hierarchy until a registered visual is found.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 final void removeContentChild(java.lang.Object contentChild)
IContentPart.getContentChildrenUnmodifiable().
Delegates to doRemoveContentChild(Object), which is to be
overwritten by subclasses.
removeContentChild in interface IContentPart<VR,V extends VR>contentChild - An Object which should be removed from this part's
content children.public void reorderContentChild(java.lang.Object contentChild,
int newIndex)
IContentPart.CONTENT_CHILDREN_PROPERTY as
property name.
Delegates to doReorderContentChild(Object, int), which is to be
overwritten by subclasses.
reorderContentChild in interface IContentPart<VR,V extends VR>contentChild - The Object which is to be reordered.newIndex - The index to which the content child is to be reordered.public void setContent(java.lang.Object content)
IContentPartFactory when creating an
IContentPart.setContent in interface IContentPart<VR,V extends VR>content - The new content for this part.IContentPart.setContent(Object)protected void unregister(IViewer<VR> viewer)
AbstractVisualPartIViewer is lost. Unregisters this
IVisualPart for its "main" visual (i.e. the one returned by
AbstractVisualPart.getVisual()) from the IViewer.getVisualPartMap() of the
given IViewer. To simplify matters, this IVisualPart only
has to unregister itself for its "main" visual, i.e. if the "main" visual
contains a number of children visuals, it does not need to unregister
itself for those children visuals. Therefore, if the visualization
changes dynamically, the registration at the visual-part-map does not
need to be updated. Consequently, when looking up an IVisualPart
for a given visual in the visual-part-map, it is required to walk up the
visual hierarchy until a registered visual is found.unregister in class AbstractVisualPart<VR,V extends VR>viewer - The IViewer 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.