Package org.openquark.cal.services

Examples of org.openquark.cal.services.ResourceName


     *          be an absolute path to the file in the filesystem.
     */
    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)) {
View Full Code Here


     */
    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);
            }
View Full Code Here

     * @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;
View Full Code Here

         */
        private String getModulePath() {
           
            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)) {
View Full Code Here

       
        List<Element> elements = XMLPersistenceHelper.getChildElements(metadataNode);
        Iterator<Element> it = elements.iterator();
       
        Node element = it.next();       
        ResourceName persistedResourceName = ResourceName.getResourceNameWithCALFeatureNameFromXML(element);
        if (!persistedResourceName.getFeatureName().equals(getFeatureName())) {
            throw new BadXMLDocumentException(element, "CAL feature name " + getFeatureName() + " does not match the persisted feature name");
        }
       
        element = it.next();
        XMLPersistenceHelper.checkIsTagElement(element, MetadataPersistenceConstants.DISPLAY_NAME_TAG);
View Full Code Here

        // Check whether the module name exists.
        // This goes to the workspace source manager -- so it's a bit hacky.
        // We can't just ask the workspace if it has the module though, since it might be the case where the workspace isn't
        //   using a module in the nullary case.
        if (perspective.getWorkspace().getSourceManager(moduleName).getResourceStore().hasFeature(
                new ResourceName(CALFeatureName.getModuleFeatureName(moduleName)))) {
           
            String message = GeneratorMessages.getString("JFIMF_ModuleExists");
           
            statusLabel.setText(message);
            statusLabel.setToolTipText(message);
View Full Code Here

                    WorkspaceResource metadataResource = it.next();
                    if (statusListener != null) {
                        statusListener.willUseResource(metadataResource);
                    }
                   
                    ResourceName oldMetadataResourceName = metadataResource.getIdentifier().getResourceName();
                    Locale metadataLocale = LocalizedResourceName.localeOf(oldMetadataResourceName);
                   
                    // We want to keep a copy of the old metadata without any changes made to it so we can restore it later if an error occurs.
                    CALFeatureMetadata oldMetadata = metadataManager.getMetadata((CALFeatureName)oldMetadataResourceName.getFeatureName(), metadataLocale);
                   
                    // Make sure the metadata's module is in the current workspace
                    ModuleName metadataModuleName = oldMetadata.getFeatureName().toModuleName();
                    if (moduleContainer.containsModule(metadataModuleName)) {
                        continue;
View Full Code Here

                    Document oldDesignDoc = (Document)designDoc.cloneNode(true);
                   
                    boolean changesMade = updateDesignDocument(designDoc, gemDesign.getDesignName(), moduleNameResolver);
                   
                    if (changesMade) {                   
                        if (!designManager.getResourceStore().isWriteable(new ResourceName(CALFeatureName.getFunctionFeatureName(gemDesign.getDesignName())))) {
                            throw new RenamingException("Can not update the design for " + gemDesign.getDesignName().getQualifiedName() + " because it is not writeable.");
                           
                        }
                       
                        Status saveGemStatus = new Status("Save gem design status");
View Full Code Here

                    // Check whether the module name exists, and if so confirm that the user wished to clobber.
                    // This goes to the workspace source manager -- so it's a bit hacky.
                    // We can't just ask the workspace if it has the module though, since it might be the case where the workspace isn't
                    //   using a module in the nullary case.
                    if (getWorkspace().getSourceManager(generatedModuleName).getResourceStore().hasFeature(
                            new ResourceName(CALFeatureName.getModuleFeatureName(generatedModuleName)))) {
                       
                        // TODOEL: Ideally, if the user does not want to clobber the existing module, we should
                        //   go back to the dialog with the existing inputs.
                       
                        String warningTitle = getResourceString("WarningDialogTitle");
View Full Code Here

TOP

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

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.