Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added debug logging related to switch workspace
  • Loading branch information
jonalv committed Apr 17, 2012
1 parent f2f9355 commit 9aad01f
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -47,22 +47,33 @@ public ApplicationWorkbenchAdvisor() {
Location instanceLoc = Platform.getInstanceLocation();
// if the location is already set, we start from eclipse
if(!instanceLoc.isSet()){
logger.debug( "The instance location was not set" );
// startedFromWorkspace=true means we do a restart from "switch workspace" and therefore
// get the workspace location from dialog, if not, we use the default one or the remembered one set by user.
boolean startedFromWorkspace = PickWorkspaceDialog.isStartedFromSwitchWorkspace();
logger.debug( "We are " + (startedFromWorkspace? " " : "not ") + "starting from switch workspace" );
try {
if(startedFromWorkspace){
instanceLoc.set(new URL("file", null, PickWorkspaceDialog.getLastSetWorkspaceDirectory()), false);
PickWorkspaceDialog.setStartedFromSwitchWorkspace( false );
logger.debug("Workspace set to: " + PickWorkspaceDialog.getLastSetWorkspaceDirectory());
}else{
// get what the user last said about remembering the workspace location
boolean remember = PickWorkspaceDialog.isRememberWorkspace();
if (!remember) {
logger.debug( "The user wants to do new starts with default workspace" );
}
else {
logger.debug( "The user wants to do new starts with non-default workspace" );
}
if(remember){
// get the last used workspace location
String lastUsedWs = PickWorkspaceDialog.getLastSetWorkspaceDirectory();
instanceLoc.set(new URL("file", null, lastUsedWs), false);
logger.debug("Workspace set to: " + lastUsedWs);
}else{
instanceLoc.set(new URL("file", null, PickWorkspaceDialog.getWorkspacePathSuggestion()), false);
logger.debug("Workspace set to: " + PickWorkspaceDialog.getLastSetWorkspaceDirectory());
}
}
} catch (Exception exception) {
Expand Down

0 comments on commit 9aad01f

Please sign in to comment.