Eclipse Tips and Tricks

Keyboarding Tips

  • When using Ctrl+Shift+T (Open Type), you can actually enter the capital letters of the CamelCase class names, which filters quickly, and much more specifically. Hit Ctrl+Shift+T, and then start typing ‘IWorkbench’ – you’ll get around 41 things. But, if you type ‘IWBS’, you’ll get the individual interface IWorkbenchBrowserSupport. A little nicer for those projects where you have lots of AbstractBlah* classes…

Reverse Engineering Plugins

Say you want to use the Install/Update Wizard in your RCP application, but you don’t know where to start.

  • Open the Plug-in Registry View (Window -> Show View -> Other -> PDE Runtime -> Plug-in Registry)
  • We know the text for the Install Wizard is ‘Find and Install…’ – a quick browse through the extensions for the org.eclipse.ui.ide plug-in gives us the ‘&Find and Install…’ under Software Updates, which is under the second org.eclipse.ui.actionSets in org.eclipse.ui.ide
  • Selecting this shows that the class ‘InstallWizardAction’ is located in the package org.eclipse.ui.internal.ide.update.
  • Open the Plug-in View (Window -> Show View -> Other -> PDE -> Plug-ins)
  • Browse down to the org.eclipse.ui.ide plug-in, right click and select Import -> Source Project from context menu. This will create a project in your workspace out of the plugin.
  • We can now open the ‘InstallWizardAction’ class using Ctrl+Shft+T. From here we can either copy the class, or use it as a reference to create a similar action. Note that the plugin.xml also has the required xml fragment for the action.
  • We can see how the action is hooked in to the RCP app, and should be able to run with it from here.

Jar Management for Plugins

Have you ever wanted to set aside a group of jars for one aspect of your plugin, but you ended up needed to manually build a jar out of them along with the MANIFEST, etc? I know we did one project at one point, and it was really messy. We tried to put all of our external jars in one project, and we just never got the whole thing set up quite right. So, here is a page for you to look at when developing an Eclipse plug-in when you want to manage jars.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply