Class ResourceSetHelpers
- java.lang.Object
-
- org.eclipse.emfforms.spi.editor.helpers.ResourceSetHelpers
-
public final class ResourceSetHelpers extends java.lang.ObjectThe Class ResourceSetHelpers. It is a utility class to perform operations on ResourceSet objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaddResourceToSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI resourceURI)Deprecated.static booleanaddResourceToSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI resourceURI, java.util.Map<java.lang.Object,java.lang.Object> loadOptions)Loads a resource from resourceURI and adds it to the resourceSet.static org.eclipse.emf.ecore.resource.ResourceSetcreateResourceSet(org.eclipse.emf.common.command.CommandStack commandStack)Creates a ResourceSet with a CommandStack attached to it.static org.eclipse.emf.ecore.resource.ResourceSetcreateResourceSet(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain domain)Creates a ResourceSet with the given EditingDomain.static <T> java.util.List<T>findAllOf(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.lang.Class<T> clazz, boolean includeEcorePackage)Find all of type in the ResourceSet.static <T> java.util.List<T>findAllOfTypeInResourceSet(org.eclipse.emf.ecore.EObject object, java.lang.Class<T> clazz, boolean includeEcorePackage)Find all of type in resource set.static java.util.List<?>findAllOfTypeInResourceSet(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EClassifier type, boolean includeEcorePackage)Find all of type in resource set.static org.eclipse.emf.ecore.resource.ResourceSetloadResourceSetWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.common.command.BasicCommandStack commandStack)Deprecated.static org.eclipse.emf.ecore.resource.ResourceSetloadResourceSetWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.common.command.BasicCommandStack commandStack, java.util.Map<java.lang.Object,java.lang.Object> options)Load resource set with proxies.static org.eclipse.emf.ecore.resource.ResourceSetloadResourceWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Deprecated.static org.eclipse.emf.ecore.resource.ResourceSetloadResourceWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.util.Map<java.lang.Object,java.lang.Object> loadOptions)Load resource set with proxies.static voidresolveAllProxies(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Visits all proxies in the resource set and tries to resolve them.static booleansave(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Deprecated.static booleansave(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.util.Map<java.lang.Object,java.lang.Object> saveOptions)Save all changes in a ResourceSet.
-
-
-
Method Detail
-
save
@Deprecated public static boolean save(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Deprecated.Save all changes in a ResourceSet.- Parameters:
resourceSet- the resource set- Returns:
- true, if successful
-
save
public static boolean save(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.util.Map<java.lang.Object,java.lang.Object> saveOptions)Save all changes in a ResourceSet.- Parameters:
resourceSet- the resource setsaveOptions- the save options- Returns:
- true, if successful
- Since:
- 1.19
-
loadResourceSetWithProxies
@Deprecated public static org.eclipse.emf.ecore.resource.ResourceSet loadResourceSetWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.common.command.BasicCommandStack commandStack)Deprecated.Load resource set with proxies.- Parameters:
resourceURI- the resource uri (= File to load)commandStack- the command stack- Returns:
- the resource set
-
loadResourceSetWithProxies
public static org.eclipse.emf.ecore.resource.ResourceSet loadResourceSetWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.common.command.BasicCommandStack commandStack, java.util.Map<java.lang.Object,java.lang.Object> options) throws java.io.IOExceptionLoad resource set with proxies.- Parameters:
resourceURI- the resource uri (= File to load)commandStack- the command stackoptions- the resource load options- Returns:
- the resource set
- Throws:
java.io.IOException- if an error occurred while loading the resource- Since:
- 1.19
-
loadResourceWithProxies
@Deprecated public static org.eclipse.emf.ecore.resource.ResourceSet loadResourceWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Deprecated.Load resource set with proxies.- Parameters:
resourceURI- the resource uri (= File to load)resourceSet- the resource set- Returns:
- the resource set
- Since:
- 1.10
-
loadResourceWithProxies
public static org.eclipse.emf.ecore.resource.ResourceSet loadResourceWithProxies(org.eclipse.emf.common.util.URI resourceURI, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.util.Map<java.lang.Object,java.lang.Object> loadOptions) throws java.io.IOExceptionLoad resource set with proxies.- Parameters:
resourceURI- the resource uri (= File to load)resourceSet- the resource setloadOptions- the resource load options- Returns:
- the resource set
- Throws:
java.io.IOException- if an error occurred while loading the resource- Since:
- 1.19
-
createResourceSet
public static org.eclipse.emf.ecore.resource.ResourceSet createResourceSet(org.eclipse.emf.common.command.CommandStack commandStack)
Creates a ResourceSet with a CommandStack attached to it.- Parameters:
commandStack- the command stack- Returns:
- the resource set
- Since:
- 1.10
-
createResourceSet
public static org.eclipse.emf.ecore.resource.ResourceSet createResourceSet(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain domain)
Creates a ResourceSet with the given EditingDomain.- Parameters:
domain- the editing domain- Returns:
- the resource set
- Since:
- 1.11
-
addResourceToSet
@Deprecated public static boolean addResourceToSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI resourceURI)Deprecated.Loads a resource from resourceURI and adds it to the resourceSet.- Parameters:
resourceSet- the resource setresourceURI- the resource uri- Returns:
- true, if successful
-
addResourceToSet
public static boolean addResourceToSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.common.util.URI resourceURI, java.util.Map<java.lang.Object,java.lang.Object> loadOptions) throws java.io.IOExceptionLoads a resource from resourceURI and adds it to the resourceSet.- Parameters:
resourceSet- the resource setresourceURI- the resource uriloadOptions- the resource load options- Returns:
- true, if successful
- Throws:
java.io.IOException- if an error occurred while loading the resource- Since:
- 1.18
-
resolveAllProxies
public static void resolveAllProxies(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Visits all proxies in the resource set and tries to resolve them. Recursively also resolves all resources added during the resolvement of the initial resources.- Parameters:
resourceSet- TheResourceSetcontaining theResourcesto resolve- Since:
- 1.22
-
findAllOfTypeInResourceSet
public static java.util.List<?> findAllOfTypeInResourceSet(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EClassifier type, boolean includeEcorePackage)Find all of type in resource set.- Parameters:
object- the objecttype- the typeincludeEcorePackage- the include ecore package- Returns:
- the list
-
findAllOfTypeInResourceSet
public static <T> java.util.List<T> findAllOfTypeInResourceSet(org.eclipse.emf.ecore.EObject object, java.lang.Class<T> clazz, boolean includeEcorePackage)Find all of type in resource set.- Type Parameters:
T- the generic type- Parameters:
object- the objectclazz- the clazzincludeEcorePackage- the include ecore package- Returns:
- the list
-
findAllOf
public static <T> java.util.List<T> findAllOf(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.lang.Class<T> clazz, boolean includeEcorePackage)Find all of type in the ResourceSet.- Type Parameters:
T- the generic type- Parameters:
resourceSet- the resource setclazz- the clazzincludeEcorePackage- the include ecore package- Returns:
- the list
-
-