Package org.eclipse.gef.mvc.fx.parts
Class AbstractContentPart<V extends javafx.scene.Node>
java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
org.eclipse.gef.mvc.fx.parts.AbstractContentPart<V>
- Type Parameters:
V- The visualNodeused by thisAbstractContentPart.
- All Implemented Interfaces:
IActivatable,IAdaptable,IAdaptable.Bound<IViewer>,IDisposable,IContentPart<V>,IVisualPart<V>
public abstract class AbstractContentPart<V extends javafx.scene.Node>
extends AbstractVisualPart<V>
implements IContentPart<V>
The
AbstractContentPart is an IContentPart implementation
that binds the VR type parameter (visual root type) to Node.-
Property Summary
PropertiesTypePropertyDescriptionReturns an unmodifiable read-only set-multimap property containing the content anchorages.javafx.beans.property.ReadOnlyListProperty<Object>Returns an unmodfiable read-only property containing the content children.final javafx.beans.property.ObjectProperty<Object>A writable property representing theIContentPart's content.Properties inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart
active, adaptable, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisualProperties inherited from interface org.eclipse.gef.common.activate.IActivatable
activeProperties inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperties inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable
IAdaptable.Bound<A extends IAdaptable>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_PROPERTYFields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTYFields inherited from interface org.eclipse.gef.mvc.fx.parts.IContentPart
CONTENT_ANCHORAGES_PROPERTY, CONTENT_CHILDREN_PROPERTY, CONTENT_PROPERTYFields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddContentChild(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 toIContentPart.getContentChildrenUnmodifiable().final voidattachToContentAnchorage(Object contentAnchorage, String role) Attaches this part's content to the given contentAnchorage under the specified role, so that it will be returned by subsequent calls toIContentPart.getContentAnchoragesUnmodifiable().Returns an unmodifiable read-only set-multimap property containing the content anchorages.javafx.beans.property.ReadOnlyListProperty<Object>Returns an unmodfiable read-only property containing the content children.final javafx.beans.property.ObjectProperty<Object>A writable property representing theIContentPart's content.final voiddetachFromContentAnchorage(Object contentAnchorage, 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 toIContentPart.getContentAnchoragesUnmodifiable().protected voiddoAddContentChild(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 todoGetContentChildren().protected voiddoAttachToContentAnchorage(Object contentAnchorage, String role) Attaches this part's content to the given contentAnchorage under the specified role, so that it will be returned by subsequent calls todoGetContentAnchorages().protected voiddoDetachFromContentAnchorage(Object contentAnchorage, 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 todoGetContentAnchorages().protected abstract SetMultimap<? extends Object,String> Hook method to return the current list of content anchorages.Hook method to return the current list of content children.protected voiddoRemoveContentChild(Object contentChild) Removes the given contentChild from this part's content children, so that it will no longer be returned by subsequent calls todoGetContentChildren().protected voiddoReorderContentChild(Object contentChild, int newIndex) Rearranges the given contentChild to the new index position.Returns this part's content.Gets the value of the property contentAnchoragesUnmodifiable.javafx.collections.ObservableList<Object>Gets the value of the property contentChildrenUnmodifiable.booleanReturnstrueif policies and other parts of the application are allowed to assign focus to this part by changing theFocusModel.booleanReturnstrueif policies and other parts of the application are allowed to add this part to the selection maintained by theSelectionModel.voidTriggers a re-computation of the content anchorages of thisIContentPart.voidTriggers a re-computation of the content children of thisIContentPart.protected voidCalled when a link to theIVieweris obtained.protected voidregisterAtContentPartMap(IViewer viewer, Object content) Registers the model in theIViewer.getContentPartMap().final voidremoveContentChild(Object contentChild) Removes the given contentChild from this part's content children, so that it will no longer be returned by subsequent calls toIContentPart.getContentChildrenUnmodifiable().voidreorderContentChild(Object contentChild, int newIndex) Rearranges the given contentChild to the new index position.voidsetContent(Object content) Set the primary content object that this EditPart represents.protected voidunregister(IViewer viewer) Called when the link to theIVieweris lost.protected voidunregisterFromContentPartMap(IViewer viewer, Object content) Unregisters the model in theIViewer.getContentPartMap().Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart
activate, activateAdapters, activateChildren, activeProperty, adaptableProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, deactivate, deactivateAdapters, deactivateChildren, detachAnchored, detachFromAnchorage, detachFromAnchorage, determineViewer, dispose, doActivate, doAddChildVisual, doAttachToAnchorageVisual, doCreateVisual, doDeactivate, doDetachFromAnchorageVisual, doRefreshVisual, doRemoveChildVisual, getAdaptable, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, registerAtVisualPartMap, removeChild, removeChildren, reorderChild, setAdaptable, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregisterFromVisualPartMap, unsetAdapterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.gef.common.activate.IActivatable
activate, activeProperty, deactivate, isActiveMethods inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapterMethods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptableMethods inherited from interface org.eclipse.gef.common.dispose.IDisposable
disposeMethods inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getViewer, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual
-
Property Details
-
contentAnchoragesUnmodifiable
- Specified by:
contentAnchoragesUnmodifiablePropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- An unmodifiable read-only set-multimap property.
- See Also:
-
contentChildrenUnmodifiable
- Specified by:
contentChildrenUnmodifiablePropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- An unmodifiable read-only property named
IContentPart.CONTENT_CHILDREN_PROPERTY. - See Also:
-
content
- Specified by:
contentPropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- A writable property named
IContentPart.CONTENT_PROPERTY. - See Also:
-
-
Constructor Details
-
AbstractContentPart
public AbstractContentPart()Creates a newAbstractContentPart.
-
-
Method Details
-
addContentChild
Inserts the given contentChild as a child to this part's content, so that it will be returned by subsequent calls toIContentPart.getContentChildrenUnmodifiable().Delegates to
doAddContentChild(Object, int), which is to be overwritten by subclasses.- Specified by:
addContentChildin interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
contentChild- AnObjectwhich should be added as a child to this part's content.index- The index at which the contentChild should be added.
-
attachToContentAnchorage
Attaches this part's content to the given contentAnchorage under the specified role, so that it will be returned by subsequent calls toIContentPart.getContentAnchoragesUnmodifiable().Delegates to
doAttachToContentAnchorage(Object, String), which is to be overwritten by subclasses.- Specified by:
attachToContentAnchoragein interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
contentAnchorage- AnObjectto which this part's content should be attached to.role- The role under which the attachment is to be established.
-
contentAnchoragesUnmodifiableProperty
Description copied from interface:IContentPartReturns an unmodifiable read-only set-multimap property containing the content anchorages.- Specified by:
contentAnchoragesUnmodifiablePropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- An unmodifiable read-only set-multimap property.
- See Also:
-
contentChildrenUnmodifiableProperty
Description copied from interface:IContentPartReturns an unmodfiable read-only property containing the content children.- Specified by:
contentChildrenUnmodifiablePropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- An unmodifiable read-only property named
IContentPart.CONTENT_CHILDREN_PROPERTY. - See Also:
-
contentProperty
Description copied from interface:IContentPartA writable property representing theIContentPart's content.- Specified by:
contentPropertyin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- A writable property named
IContentPart.CONTENT_PROPERTY. - See Also:
-
detachFromContentAnchorage
Detaches this part's content from the given contentAnchorage under the specified role, so that it will no longer be returned by subsequent calls toIContentPart.getContentAnchoragesUnmodifiable().Delegates to
doDetachFromContentAnchorage(Object, String), which is to be overwritten by subclasses.- Specified by:
detachFromContentAnchoragein interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
contentAnchorage- AnObjectfrom which this part's content should be detached from.role- The role under which the attachment is established.
-
doAddContentChild
Adds the given contentChild to this part's content children, so that it will no longer be returned by subsequent calls todoGetContentChildren().- Parameters:
contentChild- AnObjectwhich should be removed from this part's content children.index- The index of the contentChild that is removed.
-
doAttachToContentAnchorage
Attaches this part's content to the given contentAnchorage under the specified role, so that it will be returned by subsequent calls todoGetContentAnchorages().- Parameters:
contentAnchorage- AnObjectto which this part's content should be attached to.role- The role under which the attachment is to be established.
-
doDetachFromContentAnchorage
Detaches this part's content from the given contentAnchorage under the specified role, so that it will no longer be returned by subsequent calls todoGetContentAnchorages().- Parameters:
contentAnchorage- AnObjectfrom which this part's content should be detached from.role- The role under which the attachment is established.
-
doGetContentAnchorages
Hook method to return the current list of content anchorages. Has to be overwritten by clients.- Returns:
- The current list of content anchorages.
-
doGetContentChildren
Hook method to return the current list of content children. Has to be overwritten by clients.- Returns:
- The current list of content children.
-
doRemoveContentChild
Removes the given contentChild from this part's content children, so that it will no longer be returned by subsequent calls todoGetContentChildren().- Parameters:
contentChild- AnObjectwhich should be removed from this part's content children.
-
doReorderContentChild
Rearranges the given contentChild to the new index position.- Parameters:
contentChild- TheObjectwhich is to be reordered.newIndex- The index to which the content child is to be reordered.
-
getContent
Description copied from interface:IContentPartReturns this part's content.- Specified by:
getContentin interfaceIContentPart<V extends javafx.scene.Node>- Returns:
- This part's content.
- See Also:
-
getContentAnchoragesUnmodifiable
Gets the value of the property contentAnchoragesUnmodifiable.- Specified by:
getContentAnchoragesUnmodifiablein interfaceIContentPart<V extends javafx.scene.Node>- Property description:
- Returns:
- An unmodifiable
ObservableSetMultimapof 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)).
-
getContentChildrenUnmodifiable
Gets the value of the property contentChildrenUnmodifiable.- Specified by:
getContentChildrenUnmodifiablein interfaceIContentPart<V extends javafx.scene.Node>- Property description:
- Returns:
- A
Listof all of this part's content children.
-
isFocusable
public boolean isFocusable()Description copied from interface:IContentPartReturnstrueif policies and other parts of the application are allowed to assign focus to this part by changing theFocusModel. Otherwise returnsfalse.- Specified by:
isFocusablein interfaceIContentPart<V extends javafx.scene.Node>- Returns:
trueif policies and other parts of the application are allowed to assign focus to this part by changing theFocusModel, otherwisefalse.
-
isSelectable
public boolean isSelectable()Description copied from interface:IContentPartReturnstrueif policies and other parts of the application are allowed to add this part to the selection maintained by theSelectionModel. Otherwise returnsfalse.- Specified by:
isSelectablein interfaceIContentPart<V extends javafx.scene.Node>- Returns:
trueif policies and other parts of the application are allowed to add this part to the selection maintained by theSelectionModel, otherwisefalse.
-
refreshContentAnchorages
public void refreshContentAnchorages()Description copied from interface:IContentPartTriggers a re-computation of the content anchorages of thisIContentPart.- Specified by:
refreshContentAnchoragesin interfaceIContentPart<V extends javafx.scene.Node>
-
refreshContentChildren
public void refreshContentChildren()Description copied from interface:IContentPartTriggers a re-computation of the content children of thisIContentPart.- Specified by:
refreshContentChildrenin interfaceIContentPart<V extends javafx.scene.Node>
-
register
Description copied from class:AbstractVisualPartCalled when a link to theIVieweris obtained. Registers thisIVisualPartfor its "main" visual (i.e. the one returned byAbstractVisualPart.getVisual()) at theIViewer.getVisualPartMap()of the givenIViewer. To simplify matters, thisIVisualPartonly 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 anIVisualPartfor a given visual in the visual-part-map, it is required to walk up the visual hierarchy until a registered visual is found.- Overrides:
registerin classAbstractVisualPart<V extends javafx.scene.Node>- Parameters:
viewer- TheIViewerto register at.
-
registerAtContentPartMap
Registers the model in theIViewer.getContentPartMap(). Subclasses should only extend this method if they need to register this EditPart in additional ways.- Parameters:
viewer- The viewer to register at.content- The content to register.
-
removeContentChild
Removes the given contentChild from this part's content children, so that it will no longer be returned by subsequent calls toIContentPart.getContentChildrenUnmodifiable().Delegates to
doRemoveContentChild(Object), which is to be overwritten by subclasses.- Specified by:
removeContentChildin interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
contentChild- AnObjectwhich should be removed from this part's content children.
-
reorderContentChild
Rearranges the given contentChild to the new index position. Fires property change events usingIContentPart.CONTENT_CHILDREN_PROPERTYasproperty name.Delegates to
doReorderContentChild(Object, int), which is to be overwritten by subclasses.- Specified by:
reorderContentChildin interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
contentChild- TheObjectwhich is to be reordered.newIndex- The index to which the content child is to be reordered.
-
setContent
Set the primary content object that this EditPart represents. This method is used by anIContentPartFactorywhen creating anIContentPart.- Specified by:
setContentin interfaceIContentPart<V extends javafx.scene.Node>- Parameters:
content- The new content for this part.- See Also:
-
unregister
Description copied from class:AbstractVisualPartCalled when the link to theIVieweris lost. Unregisters thisIVisualPartfor its "main" visual (i.e. the one returned byAbstractVisualPart.getVisual()) from theIViewer.getVisualPartMap()of the givenIViewer. To simplify matters, thisIVisualPartonly 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 anIVisualPartfor a given visual in the visual-part-map, it is required to walk up the visual hierarchy until a registered visual is found.- Overrides:
unregisterin classAbstractVisualPart<V extends javafx.scene.Node>- Parameters:
viewer- TheIViewerto unregister from.
-
unregisterFromContentPartMap
Unregisters the model in theIViewer.getContentPartMap(). Subclasses should only extend this method if they need to unregister this EditPart in additional ways.- Parameters:
viewer- The viewer to unregister from.content- The content to unregister.
-