Java Reference
In-Depth Information
Other Selection Requests
EditPart s might be asked to perform two additional Request s related to selec-
tion. These requests are related to selection, in that they are interactions associ-
ated with clicking the primary mouse button. The first is a double-click, which
is called an open request ( REQ_OPEN ). This interaction can be used for
EditPart s that you can open or expand or that can display a dialog. The other
interaction is called a direct edit ( REQ_DIRECT_EDIT ). As an example of direct
editing, imagine that a user wants to modify the text of a label. The user must
first select the part and then click it again after it is selected. After a brief delay
(to rule out a double-click), the request is sent.
Selection Actions
GEF provides a SelectAllAction . Given a viewer, this action selects all the
contents part's children when invoked.
Selection Using the Keyboard
Keyboard selection is supported in graphical viewers by installing a
GraphicalViewerKeyHandler . The key handler receives only key events that
the current tool sends it. The Selection Tool forwards key events necessary for
selection.
Drag trackers are not needed inside GEF's TreeViewer . The native tree han-
dles selection already, and dragging of TreeItems is processed internally using
native DND.
Basic Model Operations (Delete)
Table 9-3 details the elements involved in delete operations.
Table 9-3
Delete Operations
Tools
Requests
Edit Policies and Roles
Actions
REQ_DELETE
COMPONENT_ROLE
DeleteAction
CONNECTION_ROLE
RootComponentEditPolicy
The only universal interaction that all GEF applications should support is
delete. The workbench places a global delete action on the Edit menu, as seen in
Figure 9-13. All applications should register a handler such as the included
DeleteAction .
 
Search WWH ::




Custom Search