Package org.eclipse.emf.ecore.resource

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


        final Resource resource = element.eResource();
        final URI uri = URI.createURI(location);
        resource.setURI(uri);
        try
        {
            resource.save(null);
        }
        catch (IOException exception)
        {
            throw new RepositoryFacadeException("Could not save model", exception);
        }
View Full Code Here


              // Save the contents of the resource to the file system.
              //
              Map<Object, Object> options = new HashMap<Object, Object>();
              options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
              resource.save(options);
            }
            catch (Exception exception) {
              OntoUMLEditorPlugin.INSTANCE.log(exception);
            }
            finally {
View Full Code Here

                      nextResource.getURI()));
          if (nextResource.isLoaded()
              && !info.getEditingDomain()
                  .isReadOnly(nextResource)) {
            try {
              nextResource
                  .save(OntoUML.diagram.part.OntoUMLDiagramEditorUtil
                      .getSaveOptions());
            } catch (IOException e) {
              fireElementStateChangeFailed(element);
              throw new CoreException(
View Full Code Here

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

      }
    };
    try {
      OperationHistoryFactory.getOperationHistory().execute(command,
          new NullProgressMonitor(), null);
      diagramResource.save(OntoUML.diagram.part.OntoUMLDiagramEditorUtil
          .getSaveOptions());
      OntoUML.diagram.part.OntoUMLDiagramEditorUtil
          .openDiagram(diagramResource);
    } catch (ExecutionException e) {
      OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
View Full Code Here

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

        try {
          modelResource
              .save(OntoUML.diagram.part.OntoUMLDiagramEditorUtil
                  .getSaveOptions());
          diagramResource
              .save(OntoUML.diagram.part.OntoUMLDiagramEditorUtil
                  .getSaveOptions());
View Full Code Here

              // Save the contents of the resource to the file system.
              //
              Map<Object, Object> options = new HashMap<Object, Object>();
              options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
              resource.save(options);
            }
            catch (Exception exception) {
              OntoUMLEditorPlugin.INSTANCE.log(exception);
            }
            finally {
View Full Code Here

                }

                private void saveAndUnload() throws IOException {
                    final Resource resource = page.eResource();

                    resource.save(ProjectPlugin.getPlugin().saveOptions);
                    if (!resource.getContents().contains(
                            ProjectPlugin.getPlugin().getProjectRegistry()))
                        ;
                    resource.unload();
                }
View Full Code Here

                            if (p.eResource() != null && p.eResource().isModified()) {
                                p.eResource().save(ProjectPlugin.getPlugin().saveOptions);
                            }

                            final Resource resource = getMap().eResource();
                            resource.save(ProjectPlugin.getPlugin().saveOptions);

                            // need to kick the Project so viewers will update
                            p.eNotify(new ENotificationImpl((InternalEObject) p, Notification.SET,
                                    ProjectPackage.PROJECT__ELEMENTS_INTERNAL, null, null));
View Full Code Here

                                    ProjectPackage.PROJECT__ELEMENTS_INTERNAL, null, null));

                        } else {
                            final Resource resource = getMap().eResource();
                            if (resource != null)
                                resource.save(ProjectPlugin.getPlugin().saveOptions);
                        }
                        viewer.dispose();
                        // setMap(null);
                    }
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.