Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Why "Switch workspace" fail?
Why "Switch workspace" fail? [message #433390] Tue, 05 July 2005 07:22 Go to next message
Yulin Wang is currently offline Yulin Wang
Messages: 2
Registered: July 2009
Junior Member
I complete a rcp application based on eclipse 3.1. The subclass of
ActionBarAdvisor is similar to WorkbenchActionBuilder.
Everything is okey, but "Switch workspace" fail. The workspace is always the
first. I debug the OpenWorkspaceAction and find the command line includes
the new workspace path. Why does the workspace not change after restart?
Thanks!
Re: Why "Switch workspace" fail? [message #449785 is a reply to message #433390] Fri, 19 May 2006 12:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: cboudjennah.hotmail.com

I have the same problem... :-/
Does anybody know from where it could come from???
Re: Why "Switch workspace" fail? [message #449906 is a reply to message #449785] Wed, 24 May 2006 15:42 Go to previous messageGo to next message
Eclipse User
Originally posted by: cboudjennah.hotmail.com

I watched the eclipse sources, and especially org.eclipse.ui.internal.ide. IDEApplication and I modified my class which implements Runnable in order to let her know about the “EXIT_RELAUNCH” constant:
    
if (returnCode != PlatformUI.RETURN_RESTART)                return EXIT_OK;            
// if the exit code property has been set to the relaunch //code, then            
// return that code now, otherwise this is a normal restart                        
return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ? EXIT_RELAUNCH                    : EXIT_RESTART;


After that, the switch workspace action seems to lead to a simple stop of the application… :-/Then, I tried to debug Eclipse in order to know what was going on…And when I came to the org.eclipse.core.launcher.Main class, I could see that it seems that the setExitData() method needs a command line argument “-exitdata” and that if this one isn’t there, the program simply returns:

  
 private void setExitData() {        
String data = System.getProperty(PROP_EXITDATA);        
if (exitData == null || data == null)            
return;        
// sync call to the launcher       
runCommand(true, new String[] {EXITDATA, exitData, data}); //$NON-NLS-1$    }


So I have 2 questions:->Am I on the good way??->Does anybody know anything about this “exitdata” argument?

Thanks by advance!
Re: Why "Switch workspace" fail? [message #450189 is a reply to message #449906] Tue, 30 May 2006 10:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: cboudjennah.hotmail.com

Well, I tried something this morning: I launched an instance of Eclipse
from Eclipse itself to see if the switch workspace worked: it didn’t!!!
Same behavior as my application since I added references to
“EXIT_RELAUNCH” into my IplatformRunnable: it ended without launching any
new process….So I tried again to export my product and to use the “switch
workspace” and it worked!!!So, in conclusion, you need to add the
IDEActionFactory.OPEN_WORKSPACE action, and you have to modify your
IplatformRunnable implementing class this way:
    if (returnCode != 
PlatformUI.RETURN_RESTART)                return EXIT_OK;            // if 
the exit code property has been set to the relaunch code, then            
// return that code now, otherwise this is a normal restart                
        return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ? 
EXIT_RELAUNCH                    : EXIT_RESTART;
and it should work,
but not if you launch your product from Eclipse!
icon14.gif  Re: Why "Switch workspace" fail? [message #817519 is a reply to message #450189] Sat, 10 March 2012 07:05 Go to previous message
zhou jian is currently offline zhou jian
Messages: 1
Registered: January 2012
Junior Member
The way to resolve "Switch workspace" problem is helpful. Thanks!
Previous Topic:Popup menu, objectContribution
Next Topic:[Solved] List every available perspective by default
Goto Forum:
  


Current Time: Sun Oct 26 09:40:59 GMT 2014

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

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