public final class UMLModeler
extends java.lang.Object
API clients should not instantiate this class.
Modifier and Type | Method and Description |
---|---|
static org.eclipse.emf.ecore.EObject |
absorbFragment(org.eclipse.emf.ecore.resource.Resource resource)
Absorbs the specified fragment.
|
static org.eclipse.emf.ecore.EObject |
absorbFragmentSilently(org.eclipse.emf.ecore.resource.Resource resource,
boolean refactorReferences)
Absorbs the specified fragment.
|
static void |
addRemoveAllListener(java.lang.Runnable runnable) |
static java.util.List<org.eclipse.emf.ecore.EModelElement> |
batchAbsorbFragments(java.util.List<? extends org.eclipse.emf.ecore.resource.Resource> resources,
boolean refactorReferences)
Absorbs the specified fragments.
|
static java.util.List<org.eclipse.emf.ecore.resource.Resource> |
batchCreateFragments(java.util.List<org.eclipse.emf.common.util.URI> fragmentUris,
java.util.List<? extends org.eclipse.emf.ecore.EModelElement> fragmentRoots,
boolean refactorReferences)
Creates fragment resources.
|
static void |
closeModel(org.eclipse.uml2.uml.Model model)
Deprecated.
Since 7.5, use the
closeModelResource(Element) method,
instead |
static void |
closeModelFragment(org.eclipse.emf.ecore.EObject element)
Closes the model fragment resource specified by the given root
element . |
static void |
closeModelResource(org.eclipse.uml2.uml.Element element)
Closes the model specified by the given root
element . |
static void |
closeProfile(org.eclipse.uml2.uml.Profile profile)
Closes the profile specified by
profile |
static org.eclipse.emf.ecore.resource.Resource |
createFragment(org.eclipse.emf.common.util.URI fragmentUri,
org.eclipse.emf.ecore.EModelElement fragmentRoot)
Creates the fragment resource.
|
static org.eclipse.emf.ecore.resource.Resource |
createFragmentSilently(org.eclipse.emf.common.util.URI fragmentUri,
org.eclipse.emf.ecore.EModelElement fragmentRoot,
boolean refactorReferences)
Creates the fragment resource.
|
static org.eclipse.uml2.uml.Model |
createModel(java.lang.String file)
Deprecated.
Since 7.5, use the
createModelResource(Class, String)
method, instead, with the Model.class root metaclass
argument |
static org.eclipse.uml2.uml.Model |
createModel(org.eclipse.emf.common.util.URI uri)
Deprecated.
Since 7.5, use the
createModelResource(Class, URI)
method, instead, with the Model.class root metaclass
argument |
static <E extends org.eclipse.uml2.uml.Element> |
createModelResource(java.lang.Class<E> rootMetaclass,
java.lang.String file)
Creates a UML model resource (as distinguished from a profile resource)
given a file path and a root element metaclass.
|
static <E extends org.eclipse.uml2.uml.Element> |
createModelResource(java.lang.Class<E> rootMetaclass,
org.eclipse.emf.common.util.URI uri)
Creates a UML model resource (as distinguished from a profile resource)
given a file path and a root element metaclass.
|
static org.eclipse.uml2.uml.Profile |
createProfile(java.lang.String file)
Creates a UML profile given a file path
|
static org.eclipse.uml2.uml.Profile |
createProfile(org.eclipse.emf.common.util.URI uri)
Creates a UML profile given a URI
|
static boolean |
forceMigrate(java.lang.String file)
Migrates specified logical model.
|
static IProfileDescriptor |
getDeployedProfile(java.lang.String id)
Retrieves the deployed profile given its unique identifier from the
extension point.
|
static java.util.Collection<IProfileDescriptor> |
getDeployedProfiles()
Retrieves all deployed profiles from the extension point.
|
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain()
Returns the UMLModeler's EditingDomain.
|
static ILogicalResource |
getLogicalResource(org.eclipse.emf.ecore.EObject eObj)
Returns the logical UML resource of the specified EObject.
|
static ILogicalResource |
getLogicalResource(org.eclipse.emf.ecore.resource.Resource resource)
Returns the logical UML resource of the specified resource.
|
static IOclQueryHelper |
getOclQueryHelper()
Returns a helper to perform OCL queries
|
static java.util.Collection<org.eclipse.uml2.uml.Model> |
getOpenedModels()
Deprecated.
Since 7.5, use the
getOpenModelRoots() method, instead. |
static java.util.Collection<org.eclipse.uml2.uml.Element> |
getOpenModelRoots()
Returns the root elements of all open UML model resources.
|
static IQueryHelper |
getQueryHelper()
Returns a helper to perform queries
|
static IUMLDiagramHelper |
getUMLDiagramHelper()
Returns a user helper to work with classes implementing
View |
static IUMLHelper |
getUMLHelper()
Returns a helper to work with classes implementing
Element |
static IUMLUIHelper |
getUMLUIHelper()
Returns a user interface helper to work with classes implementing
Element |
static org.eclipse.uml2.uml.Model |
openModel(java.lang.String file)
Deprecated.
Since 7.5, use the
openModelResource(String) method,
instead. |
static org.eclipse.uml2.uml.Model |
openModel(org.eclipse.emf.common.util.URI uri)
Deprecated.
Since 7.5, use the
openModelResource(URI) method,
instead. |
static org.eclipse.uml2.uml.Element |
openModelResource(java.lang.String file)
Opens the UML model resource whose filename is described by
file . |
static org.eclipse.uml2.uml.Element |
openModelResource(org.eclipse.emf.common.util.URI uri)
Opens the UML model whose filename is described by
uri . |
static org.eclipse.uml2.uml.Profile |
openProfile(java.lang.String file)
Opens the UML profile whose filename is described by
file . |
static org.eclipse.uml2.uml.Profile |
openProfile(org.eclipse.emf.common.util.URI uri)
Opens the UML profile whose URI is described by
uri . |
static void |
removeRemoveAllListener(java.lang.Runnable runnable) |
static void |
saveModel(org.eclipse.uml2.uml.Model model)
Deprecated.
Since 7.5, use the
saveModelResource(Element) method,
instead. |
static void |
saveModelAs(org.eclipse.uml2.uml.Model model,
java.lang.String file)
Deprecated.
Since 7.5, use the
saveModelResourceAs(Element, String)
method, instead. |
static void |
saveModelAs(org.eclipse.uml2.uml.Model model,
org.eclipse.emf.common.util.URI uri)
Deprecated.
Since 7.5, use the
saveModelResourceAs(Element, URI)
method, instead. |
static void |
saveModelResource(org.eclipse.uml2.uml.Element model)
Saves the UML model resource specified by
model . |
static void |
saveModelResourceAs(org.eclipse.uml2.uml.Element model,
java.lang.String file)
Saves the model specified by a root
model element to the location
specified by file . |
static void |
saveModelResourceAs(org.eclipse.uml2.uml.Element model,
org.eclipse.emf.common.util.URI uri)
Saves the model specified by a root
model element to the location
specified by uri . |
static void |
saveProfile(org.eclipse.uml2.uml.Profile profile)
Saves the UML profile specified by
profile . |
static void |
saveProfileAs(org.eclipse.uml2.uml.Profile profile,
java.lang.String file)
Saves the profile specified by
profile to the location
specified by file . |
static void |
saveProfileAs(org.eclipse.uml2.uml.Profile profile,
org.eclipse.emf.common.util.URI uri)
Saves the profile specified by
profile to the location
specified by uri . |
static void |
saveResource(org.eclipse.emf.ecore.resource.Resource resource,
int options)
Saves the resource specified by
resource . |
static void |
triggerRemoveAllListeners() |
public static IUMLHelper getUMLHelper()
Element
IUMLHelper
public static IUMLUIHelper getUMLUIHelper()
Element
IUMLUIHelper
public static IQueryHelper getQueryHelper()
IQueryHelper
public static IOclQueryHelper getOclQueryHelper()
IOclQueryHelper
public static IUMLDiagramHelper getUMLDiagramHelper()
View
IUMLDiagramHelper
public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
EditingDomain
public static java.util.Collection<org.eclipse.uml2.uml.Model> getOpenedModels()
getOpenModelRoots()
method, instead.Model
spublic static java.util.Collection<org.eclipse.uml2.uml.Element> getOpenModelRoots()
Package
s of some kind, but this is not guaranteed@Deprecated public static org.eclipse.uml2.uml.Model createModel(java.lang.String file)
createModelResource(Class, String)
method, instead, with the Model.class
root metaclass
argumentfile
- The model file to createjava.lang.IllegalArgumentException
- file
is an empty stringjava.lang.NullPointerException
- file
is null
@Deprecated public static org.eclipse.uml2.uml.Model createModel(org.eclipse.emf.common.util.URI uri)
createModelResource(Class, URI)
method, instead, with the Model.class
root metaclass
argumenturi
- The URI of the model to createjava.lang.IllegalArgumentException
- uri
is an empty URIjava.lang.NullPointerException
- uri
is null
public static <E extends org.eclipse.uml2.uml.Element> E createModelResource(java.lang.Class<E> rootMetaclass, java.lang.String file)
E
- the metaclass to instantiate as the root elementrootMetaclass
- the metaclass to instantiate as the root element. Must be
either Model
or Package
file
- The model resource to createjava.lang.IllegalArgumentException
- if rootMetaclass
is not one of the permitted
values or file
is an empty stringjava.lang.NullPointerException
- file
is null
public static <E extends org.eclipse.uml2.uml.Element> E createModelResource(java.lang.Class<E> rootMetaclass, org.eclipse.emf.common.util.URI uri)
E
- the metaclass to instantiate as the root elementrootMetaclass
- the metaclass to instantiate as the root element. Must be
either Model
or Package
uri
- The URI of the model resource to createjava.lang.IllegalArgumentException
- if rootMetaclass
is not one of the permitted
values or uri
is an empty URIjava.lang.NullPointerException
- uri
is null
@Deprecated public static org.eclipse.uml2.uml.Model openModel(java.lang.String file) throws java.io.IOException
openModelResource(String)
method,
instead.file
.
Supported extensions are:
.emx
.uml
file
- The model file to openjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Modelpublic static org.eclipse.uml2.uml.Element openModelResource(java.lang.String file) throws java.io.IOException
file
.
Supported extensions are:
.emx
.uml
file
- The model file to openPackage
, but that is not guaranteedjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Model@Deprecated public static org.eclipse.uml2.uml.Model openModel(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
openModelResource(URI)
method,
instead.uri
.
Supported extensions are:
.emx
.uml
uri
- The URI of the model to openjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Modelpublic static org.eclipse.uml2.uml.Element openModelResource(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
uri
.
Supported extensions are:
.emx
.uml
uri
- The URI of the model to openPackage
, but that is not guaranteedjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Model@Deprecated public static void saveModel(org.eclipse.uml2.uml.Model model) throws java.io.IOException
saveModelResource(Element)
method,
instead.model
.model
- The UML model to savejava.io.IOException
- The location specified by the root path of model
cannot be used to save the modeljava.lang.IllegalArgumentException
- model
has no associated resourcepublic static void saveModelResource(org.eclipse.uml2.uml.Element model) throws java.io.IOException
model
. The specified
resource and any currently open, modified fragment resource are saved.model
- The root element of the UML model resource to savejava.io.IOException
- The location specified by the root path of model
cannot be used to save the modeljava.lang.IllegalArgumentException
- model
has no associated resource@Deprecated public static void saveModelAs(org.eclipse.uml2.uml.Model model, java.lang.String file) throws java.io.IOException
saveModelResourceAs(Element, String)
method, instead.model
to the location
specified by file
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "model.emx" is saved as "model.uml", it
is still really using the "emx" format, not the "uml" format.model
- The UML model to savefile
- The location to save the UML modeljava.io.IOException
- The location specified by file
cannot be used
to save the modeljava.lang.IllegalArgumentException
- model
has no associated resource or
model
is nullpublic static void saveModelResourceAs(org.eclipse.uml2.uml.Element model, java.lang.String file) throws java.io.IOException
model
element to the location
specified by file
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "model.emx" is saved as "model.uml", it
is still really using the "emx" format, not the "uml" format.model
- The root of the UML model resource to savefile
- The location to save the UML model resourcejava.io.IOException
- The location specified by file
cannot be used
to save the modeljava.lang.IllegalArgumentException
- model
has no associated resource or
model
is null@Deprecated public static void saveModelAs(org.eclipse.uml2.uml.Model model, org.eclipse.emf.common.util.URI uri) throws java.io.IOException
saveModelResourceAs(Element, URI)
method, instead.model
to the location
specified by uri
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "model.emx" is saved as "model.uml", it
is still really using the "emx" format, not the "uml" format.model
- The UML2 model to saveuri
- The URI location to save the UML2 modeljava.io.IOException
- The location specified by uri
cannot be used
to save the modeljava.lang.IllegalArgumentException
- model
has no associated resource or
model
is nullpublic static void saveModelResourceAs(org.eclipse.uml2.uml.Element model, org.eclipse.emf.common.util.URI uri) throws java.io.IOException
model
element to the location
specified by uri
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "model.emx" is saved as "model.uml", it
is still really using the "emx" format, not the "uml" format.model
- The root of the UML model resource to saveuri
- The URI location to save the UML model resourcejava.io.IOException
- The location specified by uri
cannot be used
to save the modeljava.lang.IllegalArgumentException
- model
has no associated resource or
model
is nullpublic static void closeModel(org.eclipse.uml2.uml.Model model)
closeModelResource(Element)
method,
insteadmodel
model
- The UML2 model to closejava.lang.IllegalArgumentException
- model
has no associated resourcepublic static void closeModelResource(org.eclipse.uml2.uml.Element element)
element
.element
- The root element of the UML model to closejava.lang.IllegalArgumentException
- if element
has no associated resource or if it
is not a root elementpublic static void closeModelFragment(org.eclipse.emf.ecore.EObject element)
element
.element
- The root element of the UML model fragment to closejava.lang.IllegalArgumentException
- if element
has no associated resource or if it
is not the root element of a fragment resourcepublic static org.eclipse.uml2.uml.Profile createProfile(java.lang.String file)
file
- The profile file to createjava.lang.IllegalArgumentException
- file
is an empty stringjava.lang.NullPointerException
- file
is null
public static org.eclipse.uml2.uml.Profile createProfile(org.eclipse.emf.common.util.URI uri)
uri
- The URI of the profile to createjava.lang.IllegalArgumentException
- file
is an empty stringjava.lang.NullPointerException
- file
is null
public static org.eclipse.uml2.uml.Profile openProfile(java.lang.String file) throws java.io.IOException
file
.
Supported extensions are:
.epx
.uml
file
- The profile file to openjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Profilepublic static org.eclipse.uml2.uml.Profile openProfile(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
uri
.
Supported extensions are:
.epx
.uml
uri
- The URI of the profile to openjava.lang.IllegalArgumentException
- file
is an empty stringjava.io.IOException
- The file specified by file
could not be found
or the file is corrupted or could not be openedjava.lang.NullPointerException
- file
is null
java.lang.ClassCastException
- file
does not point to a Profilepublic static void saveProfile(org.eclipse.uml2.uml.Profile profile) throws java.io.IOException
profile
.profile
- The UML profile to savejava.io.IOException
- The location specified by the root path of
profile
cannot be used to save the profilejava.lang.IllegalArgumentException
- profile
has no associated resourcepublic static void saveProfileAs(org.eclipse.uml2.uml.Profile profile, java.lang.String file) throws java.io.IOException
profile
to the location
specified by file
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "profile.emx" is saved as "profile.uml",
it is still really using the "epx" format, not the "uml" format.profile
- The UML2 profile to savefile
- The location to save the UML2 profilejava.io.IOException
- The location specified by file
cannot be used
to save the profilejava.lang.IllegalArgumentException
- profile
has no associated resource or
profile
is nullpublic static void saveProfileAs(org.eclipse.uml2.uml.Profile profile, org.eclipse.emf.common.util.URI uri) throws java.io.IOException
profile
to the location
specified by uri
. This method cannot be used to convert
from one format to another: the file will be saved in the same format in
which it was opened, even if the file extension is changed through this
method. For example, if the file "profile.emx" is saved as "profile.uml",
it is still really using the "epx" format, not the "uml" format.profile
- The UML2 profile to saveuri
- The location to save the UML2 profilejava.io.IOException
- The location specified by file
cannot be used
to save the profilejava.lang.IllegalArgumentException
- profile
has no associated resource or
profile
is nullpublic static void closeProfile(org.eclipse.uml2.uml.Profile profile)
profile
profile
- The UML2 profile to closejava.lang.IllegalArgumentException
- profile
has no associated resourcepublic static java.util.Collection<IProfileDescriptor> getDeployedProfiles()
IProfileDescriptor#isVisible()
.
In this case they should not be presented to the user in a UI.public static IProfileDescriptor getDeployedProfile(java.lang.String id)
id
- The unique ID of the deployed profile.public static void saveResource(org.eclipse.emf.ecore.resource.Resource resource, int options) throws java.io.IOException
resource
.resource
- The resource to saveoptions
- Options see MResourceOption
java.io.IOException
- The location specified by the root path of
resource
cannot be used to save the resourcepublic static ILogicalResource getLogicalResource(org.eclipse.emf.ecore.EObject eObj)
eObj
- The EObject whose logical resource is returnedpublic static ILogicalResource getLogicalResource(org.eclipse.emf.ecore.resource.Resource resource)
resource
- The resource whose logical resource is returned. If the
resource is not loaded the fragment list is not built and the
returned logical resource can be used only as the wrapper.
Subsequent invocations for the same resource will return in
that case different instance of the logical resource.public static org.eclipse.emf.ecore.resource.Resource createFragment(org.eclipse.emf.common.util.URI fragmentUri, org.eclipse.emf.ecore.EModelElement fragmentRoot)
fragmentUri
- URI for the new fragmentfragmentRoot
- The element to be moved into the fragmentpublic static org.eclipse.emf.ecore.resource.Resource createFragmentSilently(org.eclipse.emf.common.util.URI fragmentUri, org.eclipse.emf.ecore.EModelElement fragmentRoot, boolean refactorReferences)
fragmentUri
- URI for the new fragmentfragmentRoot
- The element to be moved into the fragmentrefactorReferences
- Indicator if the references should be refactoredpublic static java.util.List<org.eclipse.emf.ecore.resource.Resource> batchCreateFragments(java.util.List<org.eclipse.emf.common.util.URI> fragmentUris, java.util.List<? extends org.eclipse.emf.ecore.EModelElement> fragmentRoots, boolean refactorReferences)
fragmentUris
- List of fragment URIs to createfragmentRoots
- List of EModelElements to use as fragment rootsrefactorReferences
- Indicator if the references should be refactoredResource
sjava.lang.IllegalArgumentException
public static org.eclipse.emf.ecore.EObject absorbFragment(org.eclipse.emf.ecore.resource.Resource resource)
resource
- Fragment resource to be absorbedpublic static org.eclipse.emf.ecore.EObject absorbFragmentSilently(org.eclipse.emf.ecore.resource.Resource resource, boolean refactorReferences)
resource
- Fragment resource to be absorbedrefactorReferences
- Indicator if the references should be refactoredpublic static java.util.List<org.eclipse.emf.ecore.EModelElement> batchAbsorbFragments(java.util.List<? extends org.eclipse.emf.ecore.resource.Resource> resources, boolean refactorReferences)
resources
- Fragment resources to be absorbedrefactorReferences
- Indicator if the references should be refactoredpublic static boolean forceMigrate(java.lang.String file)
file
- File path of the root resource (model itself)public static void addRemoveAllListener(java.lang.Runnable runnable)
public static void triggerRemoveAllListeners()
public static void removeRemoveAllListener(java.lang.Runnable runnable)