List<GeneratedElement> elementsToCheck = new ArrayList<GeneratedElement>();
// iterate over the selected elements, and
for (Object o : selected) {
if (o instanceof IGraphicalEditPart) {
IGraphicalEditPart part = (IGraphicalEditPart) o;
// it must be a GeneratedElement...
if (part.resolveSemanticElement() instanceof GeneratedElement) {
GeneratedElement g = (GeneratedElement) part.resolveSemanticElement();
elementsToCheck.add(g);
}
if (part.getEditingDomain() != null) {
editingDomain = part.getEditingDomain();
}
}
}
checkElements(elementsToCheck);