* @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
public void fillContextMenu(IMenuManager menu) {
ISelection selection = this.getContext().getSelection();
EditPart part = findCommonAncesterPart(selection);
if (!(part instanceof NodeEditPart)) {
return;
}
NodeEditPart original = (NodeEditPart) part;
// start from the parent of part
while (part.getParent() instanceof ElementEditPart) {
ElementEditPart elementEditPart = (ElementEditPart) part
.getParent();
IElementEdit elementEdit = elementEditPart.getElementEdit();
if (elementEdit != null) {
boolean filled = elementEdit.fillContainerContextMenu(menu,
elementEditPart, original, selection);
if (filled) {
break;
}
}
part = part.getParent();
}
}