Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Restarting workspace or workbench programmatically
Restarting workspace or workbench programmatically [message #290164] Fri, 19 August 2005 05:14 Go to next message
Eclipse UserFriend
Originally posted by: swolk.ariba.com

Hi there, I'm developing a plugin that unzips a file to the user's
workspace. The zip contains edits to the .metadata files for external
tool launching, code formatter settings, etc. Once these files are
unzipped to the workspace I need to either reload the workspace or restart
the workbench. Is there a programmatic way to do this from a plugin?
I've tried IPlatformUI.getWorkbench().restart(), but that gives me
exception complaining about invalid thread access...

Thanks,
Scott
Re: Restarting workspace or workbench programmatically [message #290170 is a reply to message #290164] Fri, 19 August 2005 08:46 Go to previous message
Stephen Rowles is currently offline Stephen RowlesFriend
Messages: 14
Registered: July 2009
Junior Member
AFAIK getWorkbench().restart() should work (I've used it succesfully).
If you have invalid thread access sounds like you need to call it from
the GUI thread.

You will need to get hold of the display and then use a new runable,
something like the following should work...

Display.getDefault().asyncExec(new Runnable() {
public void run() {
IPlatformUI.getWorkbench().restart();
}
});

Scott Wolk wrote:
> Hi there, I'm developing a plugin that unzips a file to the user's
> workspace. The zip contains edits to the .metadata files for external
> tool launching, code formatter settings, etc. Once these files are
> unzipped to the workspace I need to either reload the workspace or
> restart the workbench. Is there a programmatic way to do this from a
> plugin? I've tried IPlatformUI.getWorkbench().restart(), but that gives
> me exception complaining about invalid thread access...
>
> Thanks,
> Scott
>
Previous Topic:How to toggle "insert" edition mode on a keyboard without "insert" key (eg. Mac
Next Topic:Remove/disable a Plugin from the registry at runtime
Goto Forum:
  


Current Time: Fri Apr 26 04:00:24 GMT 2024

Powered by FUDForum. Page generated in 0.02512 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top