How to distinct descriptor is in debug console or run console

to assume i have 2 descriptor, one i opened in debug console, and another is opened in run console, how to disctinct them? i try following code

RunContentManager cm = ExecutionManager.getInstance(curPj()).getContentManager();
Object ds = cm.getAllDescriptors();


but i can't find difference between the both

4 comments
Comment actions Permalink

You can use RunContentManager.getToolWindowByDescriptor().getTitle() to distinguish whether a RunContentDescriptor belongs to a Run or Debug toolwindow. What are you trying to achieve, though? There may be a better possibility.

0
Comment actions Permalink

Dmitry Jemerov, getTitle can't solution all question, since if i run "Ex.java" and debug "Ex.java" too, their title is same, i found the way is following

// the diff is "jdwp"
// debug descriptor
// ExecutionManager.getInstance(curPj()).getContentManager().getAllDescriptors().get(0).getProcessHandler().getCommandLine()
/usr/local/java/jdk1.8.0_05/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:33481,suspend=y,server=n -javaagent:/home/roroco/Downloads/idea-IU-139.224.1/plugins/Groovy/lib/agent/gragent.jar -Dfile.encoding=UTF-8 -classpath /usr/local/java/jdk1.8.0_05/jre/lib/jsse.jar:/usr/local/java/jdk1.8.0_05/jre/lib/management-agent.jar:/usr/local/java/jdk1.8.0_05/jre/lib/resources.jar:/usr/local/java/jdk1.8.0_05/jre/lib/charsets.jar:/usr/local/java/jdk1.8.0_05/jre/lib/javaws.jar:/usr/local/java/jdk1.8.0_05/jre/lib/plugin.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jfr.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jfxswt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jce.jar:/usr/local/java/jdk1.8.0_05/jre/lib/rt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/deploy.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/dnsns.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/localedata.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunec.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunjce_provider.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/cldrdata.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunpkcs11.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/jfxrt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/zipfs.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/nashorn.jar:/home/roroco/Dropbox/jvs/try/build/classes/main:/home/roroco/Dropbox/jvs/try/build/resources/main:/home/roroco/Downloads/idea-IU-139.224.1/lib/idea_rt.jar Ex

// run descriptor
// ExecutionManager.getInstance(curPj()).getContentManager().getAllDescriptors().get(1).getProcessHandler().getCommandLine()
/usr/local/java/jdk1.8.0_05/bin/java -Didea.launcher.port=7532 -Didea.launcher.bin.path=/home/roroco/Downloads/idea-IU-139.224.1/bin -Dfile.encoding=UTF-8 -classpath /usr/local/java/jdk1.8.0_05/jre/lib/jsse.jar:/usr/local/java/jdk1.8.0_05/jre/lib/management-agent.jar:/usr/local/java/jdk1.8.0_05/jre/lib/resources.jar:/usr/local/java/jdk1.8.0_05/jre/lib/charsets.jar:/usr/local/java/jdk1.8.0_05/jre/lib/javaws.jar:/usr/local/java/jdk1.8.0_05/jre/lib/plugin.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jfr.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jfxswt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/jce.jar:/usr/local/java/jdk1.8.0_05/jre/lib/rt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/deploy.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/dnsns.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/localedata.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunec.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunjce_provider.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/cldrdata.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/sunpkcs11.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/jfxrt.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/zipfs.jar:/usr/local/java/jdk1.8.0_05/jre/lib/ext/nashorn.jar:/home/roroco/Dropbox/jvs/try/build/classes/main:/home/roroco/Dropbox/jvs/try/build/resources/main:/home/roroco/Downloads/idea-IU-139.224.1/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain Ex
0
Comment actions Permalink

Well, this may work for Java but will definitely not work for any non-JVM-based language. Let me ask again: What are you trying to achieve?

0
Comment actions Permalink

i wanna restart debug console with one key whereever my focus is located in.

0

Please sign in to leave a comment.