Package org.eclipse.emf.ecore.resource

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


        Project project = ProjectPlugin.getPlugin().getProjectRegistry()
                .getProject(projectPath + File.separator + projectName + ".udig"); //$NON-NLS-1$ //$NON-NLS-2$
        project.setName(projectName);
        Resource projectResource = project.eResource();
        try {
            projectResource.save(Collections.EMPTY_MAP);
        } catch (IOException e) {
            ProjectUIPlugin.log(
                    "Error during saving the project file of an anew created project", e); //$NON-NLS-1$
        }
View Full Code Here


        ArrayList<String> errors = new ArrayList<String>();
        for (Project project : projects) {
            try {
                Resource eResource = project.eResource();
                Map<String, String> saveOptions = getPlugin().saveOptions;
                eResource.save(saveOptions);
                List<ProjectElement> elementsInternal = project.getElementsInternal();
                for (ProjectElement projectElement : elementsInternal) {
                    projectElement.eResource().save(saveOptions);
                }
            } catch (Exception e) {
View Full Code Here

                            continue;
                        }
                        Object next = resource.getAllContents().next();
                        if (resource.isModified() && next != null && !((EObject) next).eIsProxy()) {
                            try {
                                resource.save(saveOptions);
                            } catch (Exception e) {
                                ProjectPlugin.log("Error saving " + resource.getURI(), e); //$NON-NLS-1$
                            }
                        }
                        monitor.worked(1);
View Full Code Here

    EList list=project.eResource().getResourceSet().getResources();
   
    for (Iterator iter = list.iterator(); iter.hasNext();) {
      Resource element = (Resource) iter.next();
            try{
                element.save(null);
            }catch (Exception e) {
            }
            if( !element.getContents().contains(ProjectPlugin.getPlugin().getProjectRegistry()) )
                element.unload();
    }
View Full Code Here

                             * but if you are removing the map, its no longer available.
                             */
                            final Map map = getMap();
                            final Resource resource = map.eResource();
                            if (resource != null)
                                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);
                        }
                        if( viewer != null ){
                            viewer.dispose();
                            viewer = null;
                        }
View Full Code Here

    protected final void doDelete( Project project, boolean deleteProjectFiles, int returncode ) {
        if (returncode != Window.CANCEL) {
            Resource resource = project.eResource();
            if (!deleteProjectFiles) {
                try {
                    resource.save(null);
                    resource.getContents().remove(project);
                } catch (IOException e) {
                    ProjectUIPlugin.log(null, e);
                }
            }
View Full Code Here

                    Map saveMap = new HashMap();
                    saveMap.put( XMLResource.OPTION_ENCODING, "UTF-8"  );
                    saveMap.put( XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true );
                    saveMap.put( XMLResource.OPTION_DISABLE_NOTIFY, true );
                    saveMap.put( XMLResource.OPTION_PROCESS_DANGLING_HREF, XMLResource.OPTION_PROCESS_DANGLING_HREF_RECORD );
                    res.save(outputStream, saveMap);
                    return outputStream.toString();
                } catch (JsonParseException e) {
                    _logger.error(e.getMessage(), e);
                } catch (IOException e) {
                    _logger.error(e.getMessage(), e);
View Full Code Here

                IAdaptable info) throws ExecutionException {

              Resource modelResource = domain.getResourceSet().createResource(modelPage.getURI());
              modelResource.getContents().add(object);
              try {
                modelResource.save(org.openiaml.model.diagram.part.IamlDiagramEditorUtil
                    .getSaveOptions());
              } catch (IOException e) {
                return CommandResult.newErrorCommandResult(e);
              }
View Full Code Here

        return CommandResult.newOKCommandResult();
      }
    };
    OperationHistoryFactory.getOperationHistory().execute(command,
        new NullProgressMonitor(), null);
    diagramResource.save(options.saveOptions);
   
    return diagramResource;
   
  }
   
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.