Package org.openquark.cal.services

Examples of org.openquark.cal.services.CALWorkspace


       
        final JarOutputStream jos = new LoggingJarOutputStream(outputStream, manifest, monitor);

        final Set<String> classesAlreadyAdded = new HashSet<String>();
        final Set<String> sourcesAlreadyAdded = new HashSet<String>();
        final CALWorkspace workspace = workspaceManager.getWorkspace();
        final SortedSet<ModuleName> allRequredModules = new TreeSet<ModuleName>();
       
        try {
            ////
            /// First generate the main classes (and their associated classes and resources)
View Full Code Here


        final ModuleName rootModule,
        final ZipEntry classEntry,
        final byte[] classBytecode,
        final SourceGenerator sourceGen) throws IOException, InternalProblemException, JavaGenerationException {
       
        final CALWorkspace workspace = workspaceManager.getWorkspace();
       
        ////
        /// Write out the class.
        //
        jos.putNextEntry(classEntry);
View Full Code Here

        }
       
        // we have to search all instances in all modules to see if they're an instance of this type
        //todoBI the above comment is false. Need to just search all module imported, either directly or indirectly,
        //into the module in which the instance is defined.
        CALWorkspace workspace = owner.getPerspective().getWorkspace();
        List<TypeClass> classes = new ArrayList<TypeClass>();
        List<ClassInstance> instances = new ArrayList<ClassInstance>();
       
        for (int n = 0, numMods = workspace.getNMetaModules(); n < numMods; n++) {
           
            MetaModule metaModule = workspace.getNthMetaModule(n);
            ModuleTypeInfo moduleTypeInfo = metaModule.getTypeInfo();
           
            for (int i = 0, num = moduleTypeInfo.getNClassInstances(); i < num; i++) {
               
                ClassInstance instance = moduleTypeInfo.getNthClassInstance(i);
View Full Code Here

        // remove trailing <br>
        buffer.delete(buffer.length() - 4, buffer.length());
        buffer.append("</tt>");
       
        // we have to search all instances in all modules to see if they're an instance of this class
        CALWorkspace workspace = owner.getPerspective().getWorkspace();
        List<ClassInstance> instances = new ArrayList<ClassInstance>();
        List<TypeConstructor> types = new ArrayList<TypeConstructor>();
       
        for (int n = 0, numMods = workspace.getNMetaModules(); n < numMods; n++) {
           
            MetaModule metaModule = workspace.getNthMetaModule(n);
            ModuleTypeInfo moduleTypeInfo = metaModule.getTypeInfo();
           
            for (int i = 0, num = moduleTypeInfo.getNClassInstances(); i < num; i++) {
               
                ClassInstance instance = moduleTypeInfo.getNthClassInstance(i);
View Full Code Here

        // Compile all modules in workspace
        compileWorkspace(false);

        // Create the perspective
        CALWorkspace workspace = workspaceManager.getWorkspace();
        ModuleName workingModuleName = getInitialWorkingModuleName(workspace);
        MetaModule initialWorkingModule = workspace.getMetaModule(workingModuleName);
        perspective = new Perspective(workspace, initialWorkingModule);

        // Set the initial preferred working module name.
        setInitialPreferredWorkingModuleName();
       
View Full Code Here

        Cursor oldCursor = getCursor();
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
       
        try {
            Status syncStatus = new Status(getResourceString("SyncWorkspaceStatus"));
            CALWorkspace workspace = getWorkspace();
            CALWorkspace.SyncInfo syncInfo = new CALWorkspace.SyncInfo();
           
            for (final ModuleName moduleName : moduleNames) {
                CALWorkspace.SyncInfo newSyncInfo = workspace.syncModuleToRevision(moduleName, -1, false, syncStatus);
                syncInfo.addInfo(newSyncInfo);
            }
           
            handleUserSyncPerformed(syncInfo, syncStatus);
           
View Full Code Here

        Cursor oldCursor = getCursor();
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
       
        try{
            Status syncStatus = new Status(getResourceString("SyncWorkspaceStatus"));
            CALWorkspace workspace = getWorkspace();
            CALWorkspace.SyncInfo syncInfo = new CALWorkspace.SyncInfo();
           
            for (final ModuleRevision moduleRevision : moduleRevisions) {
                CALWorkspace.SyncInfo newSyncInfo =
                    workspace.syncModuleToRevision(moduleRevision.getModuleName(), moduleRevision.getRevisionNumber(), force, syncStatus);
                syncInfo.addInfo(newSyncInfo);
            }
           
            handleUserSyncPerformed(syncInfo, syncStatus);
           
View Full Code Here

                   
                    String clientID = WorkspaceConfiguration.getDiscreteWorkspaceID(DEFAULT_WORKSPACE_CLIENT_ID);
                    GemCutter.this.workspaceManager = WorkspaceManager.getWorkspaceManager(clientID);
                    initWorkspace(nextWorkspaceDeclarationStreamProvider);

                    final CALWorkspace workspace = workspaceManager.getWorkspace();
                   
                   
                    // Find number of modules to be loaded and pass this information to progress bar
                    int nModules = workspace.getModuleNames().length;
                    gemCutterSplashScreen.setProgressBarMaxValue(nModules);
                   
                    // Compile specified module or all modules in workspace
                    long compileStartTime = System.currentTimeMillis();
                    boolean foundErrors = compileWorkspace(false);
                    final String statusMessage;
                    if (!foundErrors) {
                        statusMessage = GemCutterMessages.getString("SM_RecompilationFinished", Double.toString((System.currentTimeMillis() - compileStartTime)/1000.0));               
                    } else {               
                        statusMessage = GemCutterMessages.getString("SM_RecompilationErrors");               
                    }
                   
                    SwingUtilities.invokeAndWait(new Runnable() {
                        public void run() {
                            statusMessageManager.displayMessage(this, statusMessage, StatusMessageDisplayer.MessageType.TRANSIENT, true);
                           
                            // The new working module, if any.
                            ModuleName newWorkingModuleName;
                           
                            // Change to the preferred working module if it's not the current module, and it exists.
                            if (preferredWorkingModuleName != null && workspace.getMetaModule(preferredWorkingModuleName) != null) {
                                newWorkingModuleName = preferredWorkingModuleName;
                            } else {
                                newWorkingModuleName = getInitialWorkingModuleName(workspace);
                            }
                           
                            // Create the perspective
                            MetaModule initialWorkingModule = workspace.getMetaModule(newWorkingModuleName);
                            perspective = new Perspective(workspace, initialWorkingModule);
                           
                            // Clear the TableTop before resetting the runners, so that value editors can be closed
                            // by the original ValueEditorHierarchyManager.
                            newTableTop();
View Full Code Here

        details.append(getResourceString("WorkspaceInfo_Declaration"));
        details.append("     " + getWorkspaceManager().getInitialWorkspaceDeclarationName() + "\n");
        details.append("        - " + getWorkspaceManager().getInitialWorkspaceDeclarationDebugInfo() + "\n");
       
        CALWorkspace workspace = getWorkspace();
        details.append(getResourceString("WorkspaceInfo_Location") + workspace.getWorkspaceLocationString() + "\n");

        // Modules loaded       
        details.append(getResourceString("WorkspaceInfo_ModulesLoaded"));
        ModuleName[] moduleNames = workspace.getModuleNames();
        Arrays.sort(moduleNames);
       
        int nModules = moduleNames.length;
        if (nModules > 0) {
            for (int i = 0; i < nModules; i++) {
                details.append("     " + moduleNames[i]);
               
                VaultElementInfo vaultInfo = workspace.getVaultInfo(moduleNames[i]);

                if (vaultInfo != null) {
                    long moduleRevision = vaultInfo.getRevision();

                    String descriptor = vaultInfo.getVaultDescriptor();
                    String locationString = vaultInfo.getLocationString();
                   
                    details.append("     " + descriptor);
                    if (locationString != null) {
                        details.append("(" + locationString + ")");
                    }
                    details.append("  " + GemCutterMessages.getString("WorkspaceInfo_Revision", new Long(moduleRevision)));
                }

                details.append("\n");
               
                String debugInfo = workspace.getDebugInfoForModule(moduleNames[i]);
               
                if (debugInfo != null) {
                    details.append("        - ").append(debugInfo).append("\n");
                }
            }
View Full Code Here

            CollectorGem collector = owner.getCollector(address.getBase());
            metadata = collector != null ? collector.getDesignMetadata() : null;
           
        } else {
            CALFeatureName featureName = address.toFeatureName();
            CALWorkspace workspace = owner.getPerspective().getWorkspace();
           
            if (workspace.getMetaModule(featureName.toModuleName()) != null) {
                metadata = workspace.getMetadata(featureName, owner.getLocaleForMetadata());
            } else {
                return null;
            }
        }
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.CALWorkspace

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.