|
||||||||||
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.AbstractTreeEditPart
de.tu_berlin.cs.tfs.muvitorkit.gef.editparts.AdapterTreeEditPart<T>
public abstract class AdapterTreeEditPart<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
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
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart |
---|
AbstractEditPart.EditPolicyIterator |
Field Summary |
---|
Fields inherited from class org.eclipse.gef.editparts.AbstractTreeEditPart |
---|
widget |
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.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 | |
---|---|
AdapterTreeEditPart(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. |
DragTracker |
getDragTracker(Request req)
|
protected String |
getText()
By default, if the model is an ENamedElement , the text of this
tree edit part will be its name. |
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 MuvitorTreeDirectEditManager by default,
handling direct editing, if this edit part implements
IDirectEditPart . |
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 a custom Adapter on this
editpart's model. |
void |
registerAdapter(Adapter adapter,
EObject model)
Via this method subclasses can install custom Adapter s in
AbstractEditPart.activate() listening to changes on a specific EObject . |
void |
registerAdapter(EObject model)
Convenience method to let notifyChanged(Notification) receive
notifications from additional EObjects. |
void |
setWidget(Widget widget)
This forces the top element to be shown as a tree element. |
Methods inherited from class org.eclipse.gef.editparts.AbstractTreeEditPart |
---|
addChildVisual, checkTreeItem, createEditPolicies, getImage, getWidget, refreshVisuals, removeChildVisual, reorderChild, setWidgetImage, setWidgetText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.gef.EditPart |
---|
activate, addEditPartListener, addNotify, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest |
Constructor Detail |
---|
public AdapterTreeEditPart(T model)
notifyChanged(Notification)
and to the
MuvitorNotifierService
.
model
- the model of this editpartMethod Detail |
---|
public final void setWidget(Widget widget)
setWidget
in interface TreeEditPart
setWidget
in class AbstractTreeEditPart
AbstractTreeEditPart.setWidget(org.eclipse.swt.widgets.Widget)
public final void registerAdapter(Adapter adapter, EObject model)
Adapter
s in
AbstractEditPart.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.
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 AbstractEditPart
AbstractGraphicalEditPart.deactivate()
protected String getText()
ENamedElement
, the text of this
tree edit part will be its name.
getText
in class AbstractTreeEditPart
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()
MuvitorTreeDirectEditManager
by default,
handling direct editing, if this edit part implements
IDirectEditPart
. 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 AbstractEditPart
IAdaptable.getAdapter(java.lang.Class)
protected IPropertySource createPropertySource()
EObjectPropertySource
showing all model
features for this edit part. Subclasses may override.
public DragTracker getDragTracker(Request req)
getDragTracker
in interface EditPart
getDragTracker
in class AbstractTreeEditPart
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |