Package org.eclipse.emf.ecore.resource

Examples of org.eclipse.emf.ecore.resource.Resource.save()


          diagram.setName(diagramName);
          diagram.setElement(model);
        }

        try {
          modelResource
              .save(eu.admire.workbench.pd.diagram.part.DispelDiagramEditorUtil
                  .getSaveOptions());
          diagramResource
              .save(eu.admire.workbench.pd.diagram.part.DispelDiagramEditorUtil
                  .getSaveOptions());
View Full Code Here


      }
    };
    try {
      OperationHistoryFactory.getOperationHistory().execute(command,
          new NullProgressMonitor(), null);
      diagramResource.save(DispelDiagramEditorUtil.getSaveOptions());
      DispelDiagramEditorUtil.openDiagram(diagramResource);
    } catch (ExecutionException e) {
      DispelDiagramEditorPlugin.getInstance().logError(
          "Unable to create model and diagram", e); //$NON-NLS-1$
    } catch (IOException ex) {
View Full Code Here

                  nextResource.getURI()));
          if (nextResource.isLoaded()
              && !info.getEditingDomain()
                  .isReadOnly(nextResource)) {
            try {
              nextResource.save(DispelDiagramEditorUtil
                  .getSaveOptions());
            } catch (IOException e) {
              fireElementStateChangeFailed(element);
              throw new CoreException(new Status(IStatus.ERROR,
                  DispelDiagramEditorPlugin.ID,
View Full Code Here

              throws ExecutionException {
            newResource.getContents().add(diagramCopy);
            return CommandResult.newOKCommandResult();
          }
        }.execute(monitor, null);
        newResource.save(DispelDiagramEditorUtil.getSaveOptions());
      } catch (ExecutionException e) {
        fireElementStateChangeFailed(element);
        throw new CoreException(new Status(IStatus.ERROR,
            DispelDiagramEditorPlugin.ID, 0,
            e.getLocalizedMessage(), null));
View Full Code Here

      }
    };
    try {
      OperationHistoryFactory.getOperationHistory().execute(command,
          new NullProgressMonitor(), null);
      diagramResource
          .save(eu.admire.visual.pmml.radviz._40.diagram.part.PMMLDiagramEditorUtil
              .getSaveOptions());
      eu.admire.visual.pmml.radviz._40.diagram.part.PMMLDiagramEditorUtil
          .openDiagram(diagramResource);
    } catch (ExecutionException e) {
View Full Code Here

       
       
        resource.getContents().add(documentRoot);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
          resource.save(os, null);
        }
        catch(IOException exc) {
          exc.printStackTrace();
        }
    return os.toString();
View Full Code Here

      System.out.println("Enter a list of file paths or URIs that have content like this:");
      try {
        Resource resource = resourceSet.createResource(URI.createURI("http:///My.smartgen"));
        Data root = SmartGenFactory.eINSTANCE.createData();
        resource.getContents().add(root);
        resource.save(System.out, null);
      }
      catch (IOException exception) {
        exception.printStackTrace();
      }
    }
View Full Code Here

          for (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); ) {
            Resource resource = (Resource)i.next();
            if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
              try {
                savedResources.add(resource);
                resource.save(saveOptions);
              }
              catch (Exception exception) {
                resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
              }
              first = false;
View Full Code Here

      System.out.println("Enter a list of file paths or URIs that have content like this:");
      try {
        Resource resource = resourceSet.createResource(URI.createURI("http:///My.message"));
        fr.tm.elibel.smartqvt.message.Error root = MessageFactory.eINSTANCE.createError();
        resource.getContents().add(root);
        resource.save(System.out, null);
      }
      catch (IOException exception) {
        exception.printStackTrace();
      }
    }
View Full Code Here

          for (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); ) {
            Resource resource = (Resource)i.next();
            if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
              try {
                savedResources.add(resource);
                resource.save(saveOptions);
              }
              catch (Exception exception) {
                resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
              }
              first = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.