- copy something like String#getBytes from a bug comment
- press Ctrl+Shift+T in Eclipse
- paste the copied text Open Type dialog
- argh... no matches
- delete the method name
- open the type in an editor
- press Ctrl+O
- argh.. what was that method again?
- go back to bugzilla and read/copy the method name
- come back to Quick Outline and filter the method
- and finally reach the method
The new command opens a Java element or a Java stack trace from clipboard. If the clipboard content spans multiple lines then the it is pasted to the Java Stack Trace Console. If the clipboard content is a single line the command tries to open the matching Java element in an editor. Some examples
- java.lang.String
- String#getBytes
- java.lang.String.getBytes(String, int[], int)
- String.java:123
- at java.lang.String.matches(String.java:1550)
- java.lang.String.valueOf(char) line: 1456
This command (Bug 48880) is already in nightly builds and will be in the today's I-build.
As a final note I should also mention 2 'nasty' Platform bugs that I faced while implementing this command
- Bug 324160: [Commands] Platform should support to use the action IDs from the action set contribution in menuContribution
- Bug 324161: menu contributions added using 'endof' should appear before contributions added using 'after'
Hi Deepak,
ReplyDeleteI recently discovered that you added the cool "Open from Clipboard" feature to the JDT, and I wonder, is there a reason why this is exclusive to the JDT? It seems that this could work for C, C++ or any other Eclipse editor as well... In fact, is there a reason why so many cool Eclipse features are JDT only? All other supported languages in Eclipse often feel like second-class citizens...
Also, do you think it would be possible to make Eclipse use the same heuristics that it uses on the "Open from Clipboard" command when it opens a "file" from the command line? (i.e. that you could do "eclipse myfile.java:50" to open the file "myfile.java" and place the cursor at the line 50?
Cheers,
Angel