});
return true;
}
private void createAndShowPopupMenu(ProjectConsoleAction[] consoleActions, Component source, int x, int y) {
KongaPopupMenu popup = null;
// HACK: The current implementation of how we populate the context menu forces us
// to this rather ugly workaround for placing the Delete Project action last in the
// popup menu (see bug 3217674).
Action deleteProject = null;
for (ProjectConsoleAction consoleAction : consoleActions) {
Action a = consoleAction.getAction();
if (a.isEnabled()) {
if (popup == null) {
popup = new KongaPopupMenu();
}
if (isDeleteProjectAction(a)) {
deleteProject = a;
} else {
popup.add(a);
}
}
}
if (popup != null) {
addDeleteProject(popup, deleteProject);
popup.show(source, x, y);
}
}