Package org.eclipse.gef.tools
Class ToolUtilities
java.lang.Object
org.eclipse.gef.tools.ToolUtilities
Utilities for 
Tools.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidfilterEditPartsUnderstanding(List<? extends EditPart> list, Request request) Filters the given list of EditParts so that the list only contains the EditParts that understand the given request (i.e. returntruefromEditPart.understandsRequest(Request)when passed the given request).static EditPartfindCommonAncestor(EditPart ll, EditPart rr) Returns the common parent editpart for given pair of EditParts.getSelectionWithoutDependants(List<? extends EditPart> selectedParts) Returns a list containing the top level selected edit parts based on the passed in list of selection.Returns a list containing the top level selected edit parts based on the viewer's selection.static booleanisAncestorContainedIn(Collection<? extends EditPart> c, EditPart ep) Checks if collection contains any ancestor of editpartep
- 
Constructor Details- 
ToolUtilitiespublic ToolUtilities()
 
- 
- 
Method Details- 
getSelectionWithoutDependantsReturns a list containing the top level selected edit parts based on the viewer's selection.- Parameters:
- viewer- the viewer
- Returns:
- the selection excluding dependants
 
- 
getSelectionWithoutDependantspublic static List<? extends EditPart> getSelectionWithoutDependants(List<? extends EditPart> selectedParts) Returns a list containing the top level selected edit parts based on the passed in list of selection.- Parameters:
- selectedParts- the complete selection
- Returns:
- the selection excluding dependants
 
- 
filterEditPartsUnderstandingFilters the given list of EditParts so that the list only contains the EditParts that understand the given request (i.e. returntruefromEditPart.understandsRequest(Request)when passed the given request).- Parameters:
- list- the list of edit parts to filter
- request- the request
 
- 
isAncestorContainedInChecks if collection contains any ancestor of editpartep- Parameters:
- c- - collection of editparts
- ep- - the editparts to check ancestors for
- Returns:
- trueif collection contains any ancestor(s) of the editpart- ep
- Since:
- 3.6
 
- 
findCommonAncestorReturns the common parent editpart for given pair of EditParts. If the two parts are identical, the result is that part. If the two parts do not have a common ancestor, some form of RuntimeException will be thrown.- Parameters:
- ll- the first editpart
- rr- the second editpart
- Returns:
- the editpart which is the common ancestor.
- Since:
- 3.1
 
 
-