Package org.eclipse.emf.ecore.resource

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


    public void dispose() {
      getResourceSet().eAdapters().remove(myResourceSetListener);
      for (Iterator/*<org.eclipse.emf.ecore.resource.Resource>*/it = getLoadedResourcesIterator(); it
          .hasNext();) {
        Resource resource = (Resource) it.next();
        resource.unload();
      }
    }

    /**
     * @generated
 
View Full Code Here


                    resource.save(ProjectPlugin.getPlugin().saveOptions);
                    if (!resource.getContents().contains(
                            ProjectPlugin.getPlugin().getProjectRegistry()))
                        ;
                    resource.unload();
                }
            });
        } catch (Exception e) {
            ProjectPlugin.log("", e); //$NON-NLS-1$
        }
View Full Code Here

    Iterator iter=registryResource.getResourceSet().getResources().iterator();
    while ( iter.hasNext() ){
      Resource resource=(Resource) iter.next();
      if( resource==registry.eResource() )
        continue;
      resource.unload();
      File file = new File(resource.getURI().toFileString());
      if( file.exists() )
        file.delete();
    }
  }
View Full Code Here

      project.eSetDeliver(true);

      Resource resource = project.eResource();
            resources.add(resource);
            if( resource!=null)
                resource.unload();
        }
       
        projects.clear();
       
        for( Resource r : resources ) {
View Full Code Here

        EList list=registry.eResource().getResourceSet().getResources();
        Set<Resource> toRemove=new HashSet<Resource>();
        for (Iterator iter = list.iterator(); iter.hasNext();) {
            Resource element = (Resource) iter.next();
            if( element!=registry.eResource() ){
                element.unload();
                toRemove.add(element);
            }
        }
       
        project=registry.getDefaultProject();
View Full Code Here

            try{
                element.save(null);
            }catch (Exception e) {
            }
            if( !element.getContents().contains(ProjectPlugin.getPlugin().getProjectRegistry()) )
                element.unload();
    }
   
    ResourceSet set=new ResourceSetImpl();
    Project project=(Project) set.getResource(URI.createURI("file://"+file.getAbsolutePath()), true).getAllContents().next(); //$NON-NLS-1$
    assertFalse(project.eIsProxy());
View Full Code Here

                    project.getElementsInternal().remove(element);
            }
            Resource resource = element.eResource();
            if (resource != null) {
                resource.getContents().remove(element);
                resource.unload();
            }
            if (deleteFiles) {
                try {
                    if (resource == null) {
                        return;
View Full Code Here

                try {
                    if (resource == null) {
                        return;
                    }
                    String path = resource.getURI().toFileString();
                    resource.unload();
                    int lastIndexOf = path.lastIndexOf('/');
                    if (lastIndexOf == -1)
                        lastIndexOf = path.length();
                    path = path.substring(0, lastIndexOf);
                    final File file = new File(path);
View Full Code Here

            ProjectPlugin.getPlugin().getProjectRegistry().getProjects().remove(project);
            resource.getContents().clear();
            ResourceSet resourceSet = resource.getResourceSet();
            String path = resource.getURI().toFileString();

            resource.unload();

            if (deleteProjectFiles) {
                try {
                    resourceSet.getResources().remove(resource);
                    resource.unload();
View Full Code Here

            resource.unload();

            if (deleteProjectFiles) {
                try {
                    resourceSet.getResources().remove(resource);
                    resource.unload();
                    int lastIndexOf = path.lastIndexOf('/');
                    if (lastIndexOf == -1)
                        lastIndexOf = path.length();
                    path = path.substring(0, lastIndexOf);
                    final File file = new File(path);
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.