buglix.org

Minor Eclipse util plugin

February 28th, 2006

Workbench Restart ActionI have discovered that during development in Eclipse, you sometimes have to restart the workbench for various reasons. The "File->Switch workspace" feature is ok for that I guess, but sometimes when you are working with several different workspaces, the value in the switch workspace dialog is not in sync with what you are currently using - which will cause some unecessary delay.

Since it is so little effort needed creating something that just restarts from the current workspace, I decided to create a plug-in for it and publish it for anyone who feel the need to be able to restart Eclipse swiftly.

The only piece of code needed (except the bulk of plugin.xml, manifest etc..) is these lines in the action:

JAVA:
  1. public void run(IAction action) {
  2.     PlatformUI.getWorkbench().restart();
  3. }

And of course this little piece of code in the plugin.xml:

XML:
  1. <extension point="org.eclipse.ui.actionSets">
  2.     <actionset label="Restart set"
  3.         visible="true"
  4.         id="org.buglix.workspacerestarter.restart">
  5.         <action label="Restart workbench"
  6.             class="org.buglix.workspacerestarter.Action"
  7.             id="org.buglix.workspacerestarter.Action"
  8.             menubarPath="file/exit.ext" />
  9.     </actionset>
  10. </extension>

You can install the plug-in via my Eclipse update site http://buglix.org/update/, or download as a zip-file with source here.

Leave a Reply

Proudly powered by WordPress. Theme developed with WordPress Theme Generator.
Copyright © buglix.org. All rights reserved.