}
@Override
public boolean canHandle(ActionContext context) {
actionContext = (ActionContextImpl) context;
MCTHousing activeHousing = actionContext.getTargetHousing();
if (activeHousing == null)
return false;
Collection<View> selection =
activeHousing.getSelectionProvider().getSelectedManifestations();
if (selection.isEmpty())
return false;
ViewInfo vi = selection.iterator().next().getInfo();
if (selection.isEmpty() ||
!(vi != null && vi.getViewType() == ViewType.NODE)){
return false;
}
if (!(activeHousing.getDirectoryArea() instanceof MCTDirectoryArea)) {
return false;
}
MCTDirectoryArea directory = MCTDirectoryArea.class.cast(activeHousing.getDirectoryArea());
MCTMutableTreeNode firstSelectedNode = directory.getSelectedDirectoryNode();
if (firstSelectedNode == null)
return false;
JTree tree = firstSelectedNode.getParentTree();