Package org.eclipse.gef.editpolicies
Class SelectionEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.SelectionEditPolicy
- All Implemented Interfaces:
- EditPolicy,- RequestConstants
- Direct Known Subclasses:
- ScrollableSelectionFeedbackEditPolicy,- SelectionHandlesEditPolicy
A GraphicalEditPolicy that is sensitive to the host's selection. The overall
 selection of the host EditPart includes whether or not it has focus.
 Subclasses will typically decorate the GraphicalEditPart with things like
 selection handles and/or focus feedback.
 
 This EditPolicy adds itself as an EditPartListener so that it can
 observe selection. When selection or focus changes, the EditPolicy will
 update itself and call the appropriate methods.
- Since:
- 2.0
- 
Field SummaryFields inherited from interface org.eclipse.gef.EditPolicyCOMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLEFields inherited from interface org.eclipse.gef.RequestConstantsREQ_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivate()Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.protected voidAdds an EditPartListener to the host to observe selection/focus changes.voidExtends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.getTargetEditPart(Request request) Returnsnullby default.protected voidOverride to hide focusprotected abstract voidOverride to hide selectionprotected voidRemoves the EditPartListener used to observe selectionprotected voidsetFocus(boolean value) Sets the internal focus value.protected voidsetSelectedState(int type) Sets the internal selection value.protected voidOverride to show focus.protected voidCallsshowSelection()by default.protected abstract voidOverride to show selectionMethods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicyaddFeedback, getFeedbackLayer, getHost, getHostFigure, getLayer, removeFeedbackMethods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicydebugFeedback, eraseSourceFeedback, eraseTargetFeedback, getCommand, setHost, showSourceFeedback, showTargetFeedback, toString, understandsRequest
- 
Constructor Details- 
SelectionEditPolicypublic SelectionEditPolicy()
 
- 
- 
Method Details- 
activatepublic void activate()Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.- Specified by:
- activatein interface- EditPolicy
- Overrides:
- activatein class- AbstractEditPolicy
- See Also:
 
- 
addSelectionListenerprotected void addSelectionListener()Adds an EditPartListener to the host to observe selection/focus changes.
- 
deactivatepublic void deactivate()Extends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.- Specified by:
- deactivatein interface- EditPolicy
- Overrides:
- deactivatein class- AbstractEditPolicy
- See Also:
 
- 
getTargetEditPartDescription copied from class:AbstractEditPolicyReturnsnullby default.nullindicates that this policy is unable to determine the target for the specifiedRequest.- Specified by:
- getTargetEditPartin interface- EditPolicy
- Overrides:
- getTargetEditPartin class- AbstractEditPolicy
- Parameters:
- request- the Request
- Returns:
- nullor the appropriate target- EditPart
- See Also:
 
- 
hideFocusprotected void hideFocus()Override to hide focus- See Also:
 
- 
hideSelectionprotected abstract void hideSelection()Override to hide selection
- 
removeSelectionListenerprotected void removeSelectionListener()Removes the EditPartListener used to observe selection
- 
setFocusprotected void setFocus(boolean value) Sets the internal focus value. This method is called automatically by the listener. If the focus value is changed, eithershowFocus()orhideFocus()will be called.- Parameters:
- value-- trueif the EditPolicy should show focus
 
- 
setSelectedStateprotected void setSelectedState(int type) Sets the internal selection value. This method is called automatically by the listener. If the selection value is changed, the appropriate method is called to show the specified selection type.- Parameters:
- type- the type of selection the EditPolicy should display
 
- 
showFocusprotected void showFocus()Override to show focus.- See Also:
 
- 
showPrimarySelectionprotected void showPrimarySelection()CallsshowSelection()by default. Override to distinguish between primary and normal selection.
- 
showSelectionprotected abstract void showSelection()Override to show selection
 
-