Package org.eclipse.emf.ecore.resource

Examples of org.eclipse.emf.ecore.resource.ResourceSet


        if (logger.isDebugEnabled())
        {
            logger.debug("Registering resource factories");
        }

        final ResourceSet resourceSet = new EMXProxyResolvingResourceSet();
        final Map extensionToFactoryMap = resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap();

        // - we need to perform these registrations in order to load a UML2 model into EMF
        //   see: http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E/uml2-home/faq.html#6
        resourceSet.getPackageRegistry().put(UML2Package.eNS_URI, UML2Package.eINSTANCE);
        extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, UML2Resource.Factory.INSTANCE);

        // if IBM's metamodel jars are on the classpath, we can register the
        // package factories
        registerOptionalRsmMetamodels(resourceSet.getPackageRegistry());

        // - populate the load options
        final Map loadOptions = this.getLoadOptions();
        loadOptions.put(UML2Resource.OPTION_DISABLE_NOTIFY, Boolean.FALSE);
        loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
View Full Code Here


  @Inject
  private JavaIoFileSystemAccess fileAccess;

  protected void runGenerator(String string) {
    // load the resource
    ResourceSet set = resourceSetProvider.get();
    Resource resource = set.getResource(URI.createURI(string), true);
   
    // validate the resource
    List<Issue> list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
    if (!list.isEmpty()) {
      for (Issue issue : list) {
View Full Code Here

    }
    return true;
  }

  private Resource loadTargetPlatform(URI fileLocation) {
    ResourceSet resourceSet = resourceSetProvider.get();
    return resourceSet.getResource(fileLocation, true);
  }
View Full Code Here

      IRunnableWithProgress operation = new IRunnableWithProgress() {
        public void run(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

      return;
    }
    aPage.bringToTop(editor);
    if (editor instanceof DiagramEditor) {
      DiagramEditor diagramEditor = (DiagramEditor) editor;
      ResourceSet diagramEditorResourceSet = diagramEditor
          .getEditingDomain().getResourceSet();
      EObject selectedView = diagramEditorResourceSet.getEObject(
          EcoreUtil.getURI(navigatorView), true);
      if (selectedView == null) {
        return;
      }
      GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
View Full Code Here

  public boolean performFinish() {
    List affectedFiles = new LinkedList();
    IPath diagramModelPath = myFileCreationPage.getContainerFullPath()
        .append(myFileCreationPage.getFileName());
    URI diagramModelURI = URI.createFileURI(diagramModelPath.toString());
    ResourceSet resourceSet = myEditingDomain.getResourceSet();
    final Resource diagramResource = resourceSet
        .createResource(diagramModelURI);
    AbstractTransactionalCommand command = new AbstractTransactionalCommand(
        myEditingDomain,
        OntoUML.diagram.part.Messages.OntoUMLNewDiagramFileWizard_InitDiagramCommand,
        affectedFiles) {
View Full Code Here

      IRunnableWithProgress operation = new IRunnableWithProgress() {
        public void run(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

   * @return the de-serialized data graph.
   * @throws IOException
   */
  public static DataGraph loadDataGraph(InputStream inputStream, Map options) throws IOException
  {
    ResourceSet resourceSet = DataObjectUtil.createResourceSet();
    Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
    resource.load(inputStream, options);
    return (DataGraph)resource.getContents().get(0);
  }
View Full Code Here

            // Populate the typeMapping table that will be given to the Axis2 WSDL2Java
            Map<QName, SDODataBindingTypeMappingEntry> typeMapping =
                                    new HashMap<QName, SDODataBindingTypeMappingEntry>();
            if (!packageRegistry.values().isEmpty()) {
                ResourceSet resourceSet = DataObjectUtil.createResourceSet();

                // Populate list of GenPackages and a map of GenClasses keyed by EClass
                List<GenPackage> genPackages = new ArrayList<GenPackage>();
                Map<EClass, GenClass> genClasses = new HashMap<EClass, GenClass>();
                for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) {
View Full Code Here

  public static DataGraph getDataGraph(DataObject dataObject)
  {
    Resource resource = ((EObject)dataObject).eResource();
    if (resource != null)
    {
      ResourceSet resourceSet = resource.getResourceSet();
      if (resourceSet != null)
      {
        return (DataGraphImpl)EcoreUtil.getAdapter(resourceSet.eAdapters(), DataGraph.class);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.resource.ResourceSet

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.