clone: restore clone in project view by shortcut even if it is invisible ?! (IDEA-94828)

This commit is contained in:
anna
2012-11-13 20:36:51 +01:00
parent 7cee6ae2b4
commit 822c6cb9a4
@@ -39,13 +39,12 @@ public class CloneElementAction extends CopyElementAction {
}
protected void updateForToolWindow(String id, DataContext dataContext,Presentation presentation) {
if (!ToolWindowId.COMMANDER.equals(id)) {
presentation.setVisible(false);
return;
}
// work only with single selection
PsiElement[] elements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext);
presentation.setEnabled(elements != null && elements.length == 1 && CopyHandler.canClone(elements));
presentation.setVisible(true);
if (!ToolWindowId.COMMANDER.equals(id)) {
presentation.setVisible(false);
}
}
}