Package org.eclipse.gef.mvc.fx.behaviors
Class ContentBehavior
java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.mvc.fx.behaviors.ContentBehavior
- All Implemented Interfaces:
IActivatable,IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>,IDisposable,IBehavior
A behavior that can be adapted to an
IRootPart or an
IContentPart to synchronize the list of IContentPart children
and (only in case of an IContentPart) anchorages with the list of
content children and anchored.-
Property Summary
Properties inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
active, adaptable -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable> -
Field Summary
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected voiddisposeIfObsolete(IContentPart<? extends javafx.scene.Node> contentPart) If the givenIContentPartdoes neither have a parent nor any anchoreds, then it's content is set tonulland the part is added to theContentPartPool.protected voidPostAbstractBehavior.activate()hook that may be overwritten to e.g. register listeners.protected voidPreAbstractBehavior.deactivate()hook that may be overwritten to e.g. unregister listeners.protected IContentPart<? extends javafx.scene.Node>findOrCreatePartFor(Object content) Finds/Revives/Creates anIContentPartfor the given contentObject.protected IContentPartFactoryReturns theIContentPartFactoryof the current viewer.protected ContentPartPoolReturns theContentPartPoolthat is used to recycle content parts in the context of anIViewer.voidsynchronizeContentPartAnchorages(IVisualPart<? extends javafx.scene.Node> anchored, SetMultimap<? extends Object, ? extends String> contentAnchorages) Updates the hostIVisualPart'sIContentPartanchorages (seeIVisualPart.getAnchoragesUnmodifiable()) so that it is in sync with the set of content anchorages that is passed in.voidsynchronizeContentPartChildren(IVisualPart<? extends javafx.scene.Node> parent, List<? extends Object> contentChildren) Updates the hostIVisualPart'sIContentPartchildren (seeIVisualPart.getChildrenUnmodifiable()) so that it is in sync with the set of content children that is passed in.Methods inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
activate, activeProperty, adaptableProperty, addAnchoreds, addAnchoreds, addFeedback, addFeedback, addHandles, addHandles, clearFeedback, clearHandles, deactivate, getAdaptable, getFeedback, getFeedback, getFeedbackPartFactory, getFeedbackPartFactory, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, getHost, hasFeedback, hasFeedback, hasHandles, hasHandles, isActive, removeAnchoreds, removeFeedback, removeFeedback, removeFeedback, removeHandles, removeHandles, removeHandles, setAdaptable, updateHandles, updateHandles
-
Constructor Details
-
ContentBehavior
public ContentBehavior()
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfaceIDisposable
-
disposeIfObsolete
If the givenIContentPartdoes neither have a parent nor any anchoreds, then it's content is set tonulland the part is added to theContentPartPool.- Parameters:
contentPart- TheIContentPartthat is eventually disposed.
-
doActivate
protected void doActivate()Description copied from class:AbstractBehaviorPostAbstractBehavior.activate()hook that may be overwritten to e.g. register listeners.- Overrides:
doActivatein classAbstractBehavior
-
doDeactivate
protected void doDeactivate()Description copied from class:AbstractBehaviorPreAbstractBehavior.deactivate()hook that may be overwritten to e.g. unregister listeners.- Overrides:
doDeactivatein classAbstractBehavior
-
findOrCreatePartFor
Finds/Revives/Creates anIContentPartfor the given contentObject. If anIContentPartfor the given contentObjectcan be found in the viewer's content-part-map, then this part is returned. If anIContentPartfor the given contentObjectis stored in theContentPartPool, then this part is returned. Otherwise, the injectedIContentPartFactoryis used to create a newIContentPartfor the given contentObject.- Parameters:
content- The contentObjectfor which the correspondingIContentPartis to be returned.- Returns:
- The
IContentPartcorresponding to the given contentObject.
-
getContentPartFactory
Returns theIContentPartFactoryof the current viewer.- Returns:
- the
IContentPartFactoryof the current viewer.
-
getContentPartPool
Returns theContentPartPoolthat is used to recycle content parts in the context of anIViewer.- Returns:
- The
ContentPartPoolof theIViewer.
-
synchronizeContentPartAnchorages
public void synchronizeContentPartAnchorages(IVisualPart<? extends javafx.scene.Node> anchored, SetMultimap<? extends Object, ? extends String> contentAnchorages) Updates the hostIVisualPart'sIContentPartanchorages (seeIVisualPart.getAnchoragesUnmodifiable()) so that it is in sync with the set of content anchorages that is passed in.- Parameters:
anchored- The anchoredIVisualPartwhose content part anchorages to synchronize with the given content anchorages.contentAnchorages- * The map of content anchorages with roles to be synchronized with the list ofIContentPartanchorages (IVisualPart.getAnchoragesUnmodifiable()).- See Also:
-
synchronizeContentPartChildren
public void synchronizeContentPartChildren(IVisualPart<? extends javafx.scene.Node> parent, List<? extends Object> contentChildren) Updates the hostIVisualPart'sIContentPartchildren (seeIVisualPart.getChildrenUnmodifiable()) so that it is in sync with the set of content children that is passed in.- Parameters:
parent- The parentIVisualPartwhose content part children to synchronize against the given content children.contentChildren- The list of content part children to be synchronized with the list ofIContentPartchildren (IVisualPart.getChildrenUnmodifiable()).- See Also:
-