|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
EditParts are the conceptual objects that populate an EditPartViewer. An EditPart ties together the application's model, a visual representation of some type, and all editing behavior. It can be composed of or have references to other EditParts.
The creator of an EditPart should call only setModel(Object). The
remaining API is used mostly by Tools, EditPolicies, and other EditParts.
CHANGES are made to the model, not the EditPart.
Most interaction with EditParts is acheived using Requests.
A Request specifies the type of interaction, and is used in targeting,
filtering, graphical feedback, and most importantly, obtaining commands.
Only Commands should change the model.
| Field Summary | |
static int |
SELECTED
Used to indicate non-primary selection |
static int |
SELECTED_NONE
Used to indicate no selection |
static int |
SELECTED_PRIMARY
Used to indicate primary selection, or "Anchor" selection. |
| Method Summary | |
void |
activate()
Indicates that editing has begun and the model may start changing. |
void |
addEditPartListener(EditPartListener listener)
Adds a listener to the EditPart. |
void |
deactivate()
Called by the managing EditPart(s). |
void |
dispose()
Called when the EditPart will no longer be used. |
void |
eraseSourceFeedback(Request request)
Erases feedback for which this EditPart is the source. |
void |
eraseTargetFeedback(Request request)
Erase feedback for which this Editpart is the target. |
List |
getChildren()
Returns the children for this EditPart. |
Command |
getCommand(Request request)
Returns the command to perform the given Request or null. |
DragTracker |
getDragTracker(Request request)
Return a drag tracker for dragging this EditPart. |
EditPolicy |
getEditPolicy(Object key)
Returns null or the EditPolicy installed with the given key. |
KeyHandler |
getKeyHandler()
Returns the KeyHandler for this EditPart or null. |
Object |
getModel()
Return the primary model object that this EditPart represents. |
EditPart |
getParent()
Returns the parent of this editpart. |
RootEditPart |
getRoot()
Returns the root EditPart. |
int |
getSelected()
Returns the selected state of this EditPart. |
EditPart |
getTargetEditPart(Request request)
Return the editpart that should be used as the target for the Request. |
boolean |
hasFocus()
Returns true if this EditPart has focus. |
void |
installEditPolicy(Object role,
EditPolicy ep)
installs an EditPolicy for a certain editing role. |
void |
performRequest(Request request)
Performs the specified Request. |
void |
refresh()
Called to force a refresh of all properties displayed by this EditPart. |
void |
removeEditPartListener(EditPartListener listener)
Removes the first entry for that listener in the list of listeners. |
void |
removeEditPolicy(Object role)
Removes the EditPolicy for the given role, if found. |
void |
setFocus(boolean hasFocus)
Tells the EditPart whether it is the focus owner. |
void |
setModel(Object model)
Sets the model. |
void |
setParent(EditPart parent)
Sets the parent. |
void |
setSelected(int value)
Sets the selected state. |
void |
showSourceFeedback(Request request)
Shows or updates source feedback for the given request. |
void |
showTargetFeedback(Request request)
Shows or updates target feedback for the given request. |
boolean |
understandsRequest(Request request)
Returns true if editpart understands the given Request. |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
| Field Detail |
public static final int SELECTED_NONE
public static final int SELECTED
public static final int SELECTED_PRIMARY
| Method Detail |
public void activate()
activate() and then deactivate() multiple times on
the receiver.
Activiation should initiate several things. First, the EditPart
should begin to observe its model if appropriate, and should continue
the observation until deactivate() is called. The EditPart
should create and activate all of its EditPolicies. EditPolicies
may also observe the model, and should also stop observing when deactivated.
Any EditParts managed by this EditPart should also be activated.
public void addEditPartListener(EditPartListener listener)
public void deactivate()
activate() and then deactivate() multiple
times on the receiver. The EditPart should unhook all listeners to
the model, and should deactivate its EditPolicies. It may be
reactivated later. The EditPart should deactivate all EditParts
that it manages.public void dispose()
deactivate(), such as unregistering
itself from the Viewer.public void eraseSourceFeedback(Request request)
public void eraseTargetFeedback(Request request)
public List getChildren()
public Command getCommand(Request request)
public DragTracker getDragTracker(Request request)
SelectionTool
makes such requests, but other Tools may also do so.public EditPolicy getEditPolicy(Object key)
null or the EditPolicy installed with the given key.public KeyHandler getKeyHandler()
null.public Object getModel()
public EditPart getParent()
public RootEditPart getRoot()
public int getSelected()
public EditPart getTargetEditPart(Request request)
public boolean hasFocus()
public void installEditPolicy(Object role,
EditPolicy ep)
null is a valid value for reservingpublic void performRequest(Request request)
public void refresh()
public void removeEditPartListener(EditPartListener listener)
public void removeEditPolicy(Object role)
null in
the place of the old policy.public void setFocus(boolean hasFocus)
EditPartListener.selectedStateChanged(EditPart).public void setModel(Object model)
public void setParent(EditPart parent)
Sets the parent. This should only be called by the managing EditPart.public void setSelected(int value)
Sets the selected state.
This should only be called by the EditPartViewer.
Fires selectedStateChanged(EditPart) to any EditPartListeners.public void showSourceFeedback(Request request)
public void showTargetFeedback(Request request)
public boolean understandsRequest(Request request)
|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||