/**
* @generated
*/
private static int findElementsInDiagramByID(DiagramEditPart diagramPart,
EObject element, List<EditPart> editPartCollector) {
IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart
.getViewer();
final int intialNumOfEditParts = editPartCollector.size();
if (element instanceof View) { // support notation element lookup
EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(
element);
if (editPart != null) {
editPartCollector.add(editPart);
return 1;
}
}
String elementID = EMFCoreUtil.getProxyID(element);
@SuppressWarnings("unchecked")
List<EditPart> associatedParts = viewer.findEditPartsForElement(
elementID, IGraphicalEditPart.class);
// perform the possible hierarchy disjoint -> take the top-most parts only
for (EditPart nextPart : associatedParts) {
EditPart parentPart = nextPart.getParent();
while (parentPart != null && !associatedParts.contains(parentPart)) {