Package org.fenrir.yggdrasil.core.service

Examples of org.fenrir.yggdrasil.core.service.IWorkspaceAdministrationService


    }

    @Override
    public void actionPerformed(ActionEvent evt)
    {     
        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);
                }
            }
            else{
                return;
            }
        }

        // Una vegada triat el workspace, s'obre la connexió a BDD.
        try{
            // Es guarden els valors a la configuració i es carrega el workspace. Això notifica l'event de càrrega de workspace
            boolean workspaceLoaded = workspaceService.isWorkspaceLoaded();               
            // Si no hi ha workspace carregat es segueix l'execució normal
            if(!workspaceLoaded){
                workspaceService.loadWorkspace(workspaceFolder);
            }
            // En el cas que hi hagi workspace carregat, es reinicia l'aplicació
            else{
                if(log.isDebugEnabled()){
                    log.debug("Especificat reinici en el workspace {}", workspaceFolder);
                }
                workspaceService.setRestartWorkspace(workspaceFolder);
                ApplicationWindowManager.getInstance().closeWindow();
            }
        }
        catch(PreferenceException e){
            log.error("Error al carregar workspace: {}", e.getMessage(), e);
View Full Code Here


        splashScreenManager.drawSplashScreenProgress(STARTUP_PROGRESS_INITIALIZING_SERVICES, "Inicialitzant serveis...");
        }

        ApplicationContext applicationContext = ApplicationContext.getInstance();
        try{
            IWorkspaceAdministrationService workspaceService = (IWorkspaceAdministrationService)applicationContext.getRegisteredComponent(IWorkspaceAdministrationService.class);
            workspaceService.loadDefaultWorkspace();
        }
        catch(PreferenceException e){  
            // En cas d'error s'amaga l'splash screen
          if(splashScreenManager!=null){
            splashScreenManager.closeSplashScreen();
View Full Code Here

TOP

Related Classes of org.fenrir.yggdrasil.core.service.IWorkspaceAdministrationService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.