Saturday, September 18, 2010

e4 - Eclipse 4.0 : First Impression

Looks a bit funny

Off is On and On is Off - I saw that Build Automatically was Off so I switched it On, and then my code changes had no effect... few minutes later I realized that if something is turned Off in the UI, it may mean that it is actually turned On! e.g.Mark Occurrences, Build Automatically.  Or in the case of 'Edit > Smart Insert Mode' I cannot even toggle it.

Layout and minimized Views - I like the overall layout and the fact that I can put views in the editor area. I also like the way when minimized views are selected they open in a pop-up sort of a way. Overall the UI/layout feels nice.

Custom Key Bindings - mmh...


Order of menu and toolbar items - The ordering of items in menus and toolbars can be a bit different from 3.x versions. e.g. navigate menu, run/debug toolbar
I can use it for my daily work, except for some minor glitches and some funny behavior I have been able to use it for last few days. And I do like the layout, mixing of editors and views, and the overall feel of the UI to not go back to 3.x (at least for now).

Monday, September 6, 2010

New Command in JDT : Open from Clipboard

This is what I used to end up doing very frequently
- 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  
I use this command with a key binding of Ctrl+Shift+V. After doing a Ctrl+C the most natural thing to do is Ctrl+V so the key binding for this command should be similar. Plus Ctrl+Shift+V is also similar to Ctrl+Shift+T and Ctrl+Shift+R, making it a bit easier for me to remember it.

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'
I say nasty because in its current form the whole menu contribution, command, actionSet, action story can be very confusing...