use of com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl in project intellij-community by JetBrains.
the class ResumeThreadAction method update.
public void update(AnActionEvent e) {
DebuggerTreeNodeImpl[] selectedNodes = getSelectedNodes(e.getDataContext());
boolean visible = false;
boolean enabled = false;
String text = DebuggerBundle.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);
}
use of com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl in project intellij-community by JetBrains.
the class ResumeThreadAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
if (debugProcess == null)
return;
//noinspection ConstantConditions
for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl) debuggerTreeNode.getDescriptor());
if (threadDescriptor.isSuspended()) {
final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
debugProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
SuspendContextImpl suspendingContext = SuspendManagerUtil.getSuspendingContext(debugProcess.getSuspendManager(), thread);
if (suspendingContext != null) {
debugProcess.createResumeThreadCommand(suspendingContext, thread).run();
}
debuggerTreeNode.calcValue();
}
});
}
}
}
Aggregations