void (@NotNull AnActionEvent e) { DebuggerTreeNodeImpl[] selectedNodes = getSelectedNodes(e.getDataContext()); boolean visible = false; boolean enabled = false; String text = JavaDebuggerBundle.message("action.resume.thread.text.resume"); if (selectedNodes != null && selectedNodes.length > 0) { visible = true; enabled = true; for (DebuggerTreeNodeImpl selectedNode : selectedNodes) { final NodeDescriptorImpl threadDescriptor = selectedNode.getDescriptor(); if (!(threadDescriptor instanceof ThreadDescriptorImpl) || !((ThreadDescriptorImpl)threadDescriptor).isSuspended()) { visible = false; break; } } } final Presentation presentation = e.getPresentation(); presentation.setText(text); presentation.setVisible(visible); presentation.setEnabled(enabled); }