public class ToolUtilities
extends java.lang.Object
Tools
.Constructor and Description |
---|
ToolUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
filterEditPartsUnderstanding(java.util.List list,
Request request)
Filters the given list of EditParts so that the list only contains the
EditParts that understand the given request (i.e. return
true from EditPart.understandsRequest(Request) when
passed the given request). |
static EditPart |
findCommonAncestor(EditPart ll,
EditPart rr)
Returns the common parent editpart for given pair of EditParts.
|
static java.util.List |
getSelectionWithoutDependants(EditPartViewer viewer)
Returns a list containing the top level selected edit parts based on the
viewer's selection.
|
static java.util.List |
getSelectionWithoutDependants(java.util.List selectedParts)
Returns a list containing the top level selected edit parts based on the
passed in list of selection.
|
static boolean |
isAncestorContainedIn(java.util.Collection c,
EditPart ep)
Checks if collection contains any ancestor of editpart
ep |
public static java.util.List getSelectionWithoutDependants(EditPartViewer viewer)
viewer
- the viewerpublic static java.util.List getSelectionWithoutDependants(java.util.List selectedParts)
selectedParts
- the complete selectionpublic static void filterEditPartsUnderstanding(java.util.List list, Request request)
true
from EditPart.understandsRequest(Request)
when
passed the given request).list
- the list of edit parts to filterrequest
- the requestpublic static boolean isAncestorContainedIn(java.util.Collection c, EditPart ep)
ep
c
- - collection of editpartsep
- - the editparts to check ancestors fortrue
if collection contains any ancestor(s) of the
editpart ep
public static EditPart findCommonAncestor(EditPart ll, EditPart rr)
ll
- the first editpartrr
- the second editpartCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.