|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gef.editparts.AbstractConnectionEditPart
de.tu_berlin.cs.tfs.muvitorkit.gef.editparts.AdapterConnectionEditPart<T>
public abstract class AdapterConnectionEditPart<T extends EObject>
This edit part is a convenience implementation with the following frequently used features for EObjects:
notifyChanged(Notification)
and to the
MuvitorNotifierService
. More adapters can freely be installed which
will be removed on deactivation.
createPropertySource()
an default
EObjectPropertySource
showing all model features is created for this
edit part. getAdapter(Class)
provides the property source the the
properties view. Subclasses may override both.
IDirectEditPart.IGraphicalDirectEditPart
to enable this feature.
performDirectEdit()
and performOpen()
may be overridden
to handle direct edit or open requests differently. By default,
performOpen()
will try to open a view with the model,
performDirectEdit()
will try to directly edit the property of the
specified feature ID specified by implementing
IDirectEditPart.IGraphicalDirectEditPart
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart |
---|
AbstractConnectionEditPart.DefaultAccessibleAnchorProvider |
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart |
---|
AbstractGraphicalEditPart.AccessibleGraphicalEditPart |
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart |
---|
AbstractEditPart.EditPolicyIterator |
Field Summary |
---|
Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart |
---|
figure, sourceConnections, targetConnections |
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart |
---|
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG |
Fields inherited from interface org.eclipse.gef.EditPart |
---|
SELECTED, SELECTED_NONE, SELECTED_PRIMARY |
Fields inherited from interface org.eclipse.gef.LayerConstants |
---|
CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER |
Fields inherited from interface org.eclipse.gef.RequestConstants |
---|
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER |
Constructor Summary | |
---|---|
AdapterConnectionEditPart(T model)
By default, an Adapter will be installed on the model, passing the notifications to notifyChanged(Notification) and to the
MuvitorNotifierService . |
Method Summary | |
---|---|
protected IPropertySource |
createPropertySource()
Creates a default EObjectPropertySource showing all model
features for this edit part. |
void |
deactivate()
Removes this edit part's adapters from the model. |
Object |
getAdapter(Class key)
Subclasses may override but must call super implementation! |
T |
getCastedModel()
Convenience method that casts the model to the appropriate type. |
protected void |
notifyChanged(Notification notification)
By default, an Adapter will be registered with this editpart's model that passes notifications to this method, which subclasses are expected to override. |
protected void |
performDirectEdit()
Creates and opens a MuvitorDirectEditManager by default, handling
direct editing, if this edit part implements
IDirectEditPart.IGraphicalDirectEditPart . |
protected void |
performOpen()
Calls MuvitorTreeEditor.showView(getCastedModel) by default. |
void |
performRequest(Request request)
Handles the standard GEF requests "direct edit" and "open" on this edit part. |
void |
registerAdapter(Adapter adapter)
Convenience method to register an Adapter on this editpart's
model in AbstractGraphicalEditPart.activate() . |
void |
registerAdapter(Adapter adapter,
EObject model)
Via this method subclasses can install Adapter s in
AbstractGraphicalEditPart.activate() listening to changes on a specific EObject . |
void |
registerAdapter(EObject model)
Convenience method to let notifyChanged(Notification) receive
notifications from additional EObjects. |
Methods inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart |
---|
activateFigure, addNotify, createFigure, deactivateFigure, getConnectionFigure, getDragTracker, getSource, getSourceConnectionAnchor, getTarget, getTargetConnectionAnchor, refresh, refreshSourceAnchor, refreshTargetAnchor, removeNotify, setParent, setSource, setTarget |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.gef.GraphicalEditPart |
---|
addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint |
Methods inherited from interface org.eclipse.gef.EditPart |
---|
activate, addEditPartListener, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, removeEditPartListener, removeEditPolicy, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest |
Constructor Detail |
---|
public AdapterConnectionEditPart(T model)
notifyChanged(Notification)
and to the
MuvitorNotifierService
.
model
- the model of this editpartMethod Detail |
---|
public final void registerAdapter(Adapter adapter, EObject model)
Adapter
s in
AbstractGraphicalEditPart.activate()
listening to changes on a specific EObject
.
All registered adapters will be deregistered by default in
deactivate()
.
adapter
- an Adapter
to register on the modelmodel
- an EObject
to observe with the passed adapterpublic final void registerAdapter(Adapter adapter)
Adapter
on this editpart's
model in AbstractGraphicalEditPart.activate()
.
adapter
- an Adapter
to register on this editpart's modelregisterAdapter(Adapter, EObject)
public final void registerAdapter(EObject model)
notifyChanged(Notification)
receive
notifications from additional EObjects. This method registers an
Adapter
on some EObject that just forwards its notifications.
adapter
- an Adapter
to register on this editpart's modelregisterAdapter(Adapter, EObject)
public final T getCastedModel()
public void deactivate()
deactivate
in interface EditPart
deactivate
in class AbstractGraphicalEditPart
AbstractGraphicalEditPart.deactivate()
public void performRequest(Request request)
performRequest
in interface EditPart
performRequest
in class AbstractEditPart
performDirectEdit()
,
performOpen()
,
AbstractEditPart.performRequest(org.eclipse.gef.Request)
protected void performOpen()
protected void performDirectEdit()
MuvitorDirectEditManager
by default, handling
direct editing, if this edit part implements
IDirectEditPart.IGraphicalDirectEditPart
. Subclasses may override to perform some
other action here.
protected void notifyChanged(Notification notification)
registerAdapter(EObject)
.
public Object getAdapter(Class key)
getAdapter
in interface IAdaptable
getAdapter
in class AbstractConnectionEditPart
IAdaptable.getAdapter(java.lang.Class)
protected IPropertySource createPropertySource()
EObjectPropertySource
showing all model
features for this edit part. Subclasses may override.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |