{
IWorkspaceAdministrationService workspaceService = (IWorkspaceAdministrationService)ApplicationContext.getInstance().getRegisteredComponent(IWorkspaceAdministrationService.class);
// No s'ha indicat cap directori. S'obre la finestra de sel.lecció
if(StringUtils.isBlank(workspaceFolder)){
WorkspaceDialog dialog = new WorkspaceDialog();
int returnCode = dialog.open();
if(returnCode==WorkspaceDialog.DIALOG_OK){
workspaceFolder = dialog.getWorkspacePath();
// S'afegeix al registre el nou workspace
try{
workspaceService.addWorkspace(workspaceFolder, dialog.isDefaultWorkspace());
}
catch(PreferenceException e){
log.error("Error al carregar workspace: {}", e.getMessage(), e);
JOptionPane.showMessageDialog(null, "Error al carregar workspace: " + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
}