Package org.openquark.cal.services

Examples of org.openquark.cal.services.ResourceStore


    protected String getModulePath(ModuleName moduleName) {
       
        CALFeatureName moduleFeatureName = CALFeatureName.getModuleFeatureName(moduleName);
        ResourceName moduleResourceName = new ResourceName(moduleFeatureName);
       
        ResourceStore sourceStore = getWorkspaceManager().getWorkspace().getSourceManager(moduleName).getResourceStore();
       
        // If the source store doesn't know about this module, then we don't know how to find its file
        if (!sourceStore.hasFeature(moduleResourceName)) {
            return null;
        }
       
        if (sourceStore instanceof ResourcePathStore) {
            ResourcePathStore sourcePathStore = (ResourcePathStore)sourceStore;
View Full Code Here


        CALWorkspace workspace = workspaceManager.getWorkspace();
       
        WorkspaceDeclarationManager workspaceDeclarationManager = workspace.getWorkspaceDeclarationManager();
       
        if (workspaceDeclarationManager != null) {
            ResourceStore resourceStore = workspaceDeclarationManager.getResourceStore();
           
           
            for (Iterator<WorkspaceResource> it = resourceStore.getResourceIterator(); it.hasNext(); ) {
                final WorkspaceResource decl = it.next();
                cwsNames.add(decl.getIdentifier().getFeatureName().getName());
            }
        }
       
View Full Code Here

        final String workspaceLocation = workspace.getWorkspaceLocationString();
       
        WorkspaceDeclarationManager workspaceDeclarationManager = workspace.getWorkspaceDeclarationManager();
       
        if (workspaceDeclarationManager != null) {
            ResourceStore resourceStore = workspaceDeclarationManager.getResourceStore();
           
            for (Iterator<WorkspaceResource> it = resourceStore.getResourceIterator(); it.hasNext(); ) {
                final WorkspaceResource decl = it.next();
               
                if (workspaceName.equals(decl.getIdentifier().getFeatureName().getName())) {
                    newStreamProvider = new WorkspaceDeclaration.StreamProvider() {
                       
View Full Code Here

     * @param builtInModuleName The name of the built in module.
     * @return A ModuleSourceDefinition object
     */
    private static ModuleSourceDefinition makeSourceDefFromBuiltIn (ModuleName builtInModuleName, CALWorkspace workspace) {
       
        final ResourceStore sourceStore = workspace.getSourceManager(builtInModuleName).getResourceStore();
        final CALFeatureName moduleFeatureName = CALFeatureName.getModuleFeatureName(builtInModuleName);
        final ResourceName moduleResourceName = new ResourceName(moduleFeatureName);
        return new ModuleSourceDefinition(builtInModuleName) {
            @Override
            public InputStream getInputStream(Status status) {
                return sourceStore.getInputStream(moduleResourceName);
            }
           
            @Override
            public long getTimeStamp() {
                return sourceStore.getTimeStamp(moduleResourceName);
            }

            @Override
            public String getDebugInfo() {
                return sourceStore.getDebugInfo(moduleResourceName);
            }
        };
    }
View Full Code Here

     * A testing module is a module with an ancestor directory named 'test'.
     * @param moduleName the name of the module.
     * @return true if the specified module is a testing module; false otherwise.
     */
    private boolean isTestingModule(final ModuleName moduleName) {
        final ResourceStore sourceStore = workspace.getSourceManager(moduleName).getResourceStore();
        final CALFeatureName moduleFeatureName = CALFeatureName.getModuleFeatureName(moduleName);
        final ResourceName resourceName = new ResourceName(moduleFeatureName);
       
        // If the source store doesn't know about this module, then it is not a testing module
        // (because it wasn't loaded from disk)
        if (!sourceStore.hasFeature(resourceName)) {
            return false;
        }
       
        if (sourceStore instanceof ResourcePathStore) {
            final ResourcePathStore sourcePathStore = (ResourcePathStore)sourceStore;
View Full Code Here

           
            ModuleName moduleName = getModuleNameFromCurrentSourcePosition();
            CALFeatureName moduleFeatureName = CALFeatureName.getModuleFeatureName(moduleName);
            ResourceName moduleResourceName = new ResourceName(moduleFeatureName);
           
            ResourceStore sourceStore = perspective.getWorkspace().getSourceManager(moduleName).getResourceStore();
           
            // If the source store doesn't know about this module, then we don't know how to find its file
            if (!sourceStore.hasFeature(moduleResourceName)) {
                return null;
            }
           
            if (sourceStore instanceof ResourcePathStore) {
                ResourcePathStore sourcePathStore = (ResourcePathStore)sourceStore;
View Full Code Here

        final String workspaceLocation = workspace.getWorkspaceLocationString();
       
        WorkspaceDeclarationManager workspaceDeclarationManager = workspace.getWorkspaceDeclarationManager();
       
        if (workspaceDeclarationManager != null) {
            ResourceStore resourceStore = workspaceDeclarationManager.getResourceStore();
            Iterator<WorkspaceResource> it = resourceStore.getResourceIterator();
           
            while (it.hasNext()) {
                final WorkspaceResource decl = it.next();
                providers.add(new ResourceBasedWorkspaceDeclarationStreamProvider(decl, workspaceLocation));
            }
View Full Code Here

TOP

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

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.