|
UML Modeler | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.xtools.modeler.ui.UMLModeler
public final class UMLModeler
A utility class that exposes model and profile lifecycle operations and provides access to the modeling platform.
API clients should not instantiate this class.
| Method Summary | ||
|---|---|---|
static EObject |
absorbFragment(Resource resource)
Absorbs the specified fragment. |
|
static EObject |
absorbFragmentSilently(Resource resource,
boolean refactorReferences)
Absorbs the specified fragment. |
|
static List<EModelElement> |
batchAbsorbFragments(List<? extends Resource> resources,
boolean refactorReferences)
Absorbs the specified fragments. |
|
static List<Resource> |
batchCreateFragments(List<URI> fragmentUris,
List<? extends EModelElement> fragmentRoots,
boolean refactorReferences)
Creates fragment resources. |
|
static void |
closeModel(Model model)
Deprecated. Since 7.5, use the UMLModeler.closeModelResource(Element) method,
instead |
|
static void |
closeModelFragment(EObject element)
Closes the model fragment resource specified by the given root element. |
|
static void |
closeModelResource(Element element)
Closes the model specified by the given root element. |
|
static void |
closeProfile(Profile profile)
Closes the profile specified by profile |
|
static Resource |
createFragment(URI fragmentUri,
EModelElement fragmentRoot)
Creates the fragment resource. |
|
static Resource |
createFragmentSilently(URI fragmentUri,
EModelElement fragmentRoot,
boolean refactorReferences)
Creates the fragment resource. |
|
static Model |
createModel(String file)
Deprecated. Since 7.5, use the UMLModeler.createModelResource(Class, String)
method, instead, with the Model.class root metaclass
argument |
|
static Model |
createModel(URI uri)
Deprecated. Since 7.5, use the UMLModeler.createModelResource(Class, URI)
method, instead, with the Model.class root metaclass
argument |
|
static
|
createModelResource(Class<E> rootMetaclass,
String file)
Creates a UML model resource (as distinguished from a profile resource) given a file path and a root element metaclass. |
|
static
|
createModelResource(Class<E> rootMetaclass,
URI uri)
Creates a UML model resource (as distinguished from a profile resource) given a file path and a root element metaclass. |
|
static Profile |
createProfile(String file)
Creates a UML profile given a file path |
|
static Profile |
createProfile(URI uri)
Creates a UML profile given a URI |
|
static TransactionalEditingDomain |
getEditingDomain()
Returns the UMLModeler's EditingDomain. |
|
static ILogicalResource |
getLogicalResource(EObject eObj)
Returns the logical UML resource of the specified EObject. |
|
static ILogicalResource |
getLogicalResource(Resource resource)
Returns the logical UML resource of the specified resource. |
|
static IOclQueryHelper |
getOclQueryHelper()
Returns a helper to perform OCL queries |
|
static Collection<Model> |
getOpenedModels()
Deprecated. Since 7.5, use the UMLModeler.getOpenModelRoots() method, instead. |
|
static Collection<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 Model |
openModel(String file)
Deprecated. Since 7.5, use the UMLModeler.openModelResource(String) method,
instead. |
|
static Model |
openModel(URI uri)
Deprecated. Since 7.5, use the UMLModeler.openModelResource(URI) method,
instead. |
|
static Element |
openModelResource(String file)
Opens the UML model resource whose filename is described by file. |
|
static Element |
openModelResource(URI uri)
Opens the UML model whose filename is described by uri. |
|
static Profile |
openProfile(String file)
Opens the UML profile whose filename is described by file. |
|
static Profile |
openProfile(URI uri)
Opens the UML profile whose URI is described by uri. |
|
static void |
saveModel(Model model)
Deprecated. Since 7.5, use the UMLModeler.saveModelResource(Element) method,
instead. |
|
static void |
saveModelAs(Model model,
String file)
Deprecated. Since 7.5, use the UMLModeler.saveModelResourceAs(Element, String)
method, instead. |
|
static void |
saveModelAs(Model model,
URI uri)
Deprecated. Since 7.5, use the UMLModeler.saveModelResourceAs(Element, URI)
method, instead. |
|
static void |
saveModelResource(Element model)
Saves the UML model resource specified by model. |
|
static void |
saveModelResourceAs(Element model,
String file)
Saves the model specified by a root model element to the location
specified by file. |
|
static void |
saveModelResourceAs(Element model,
URI uri)
Saves the model specified by a root model element to the location
specified by uri. |
|
static void |
saveProfile(Profile profile)
Saves the UML profile specified by profile. |
|
static void |
saveProfileAs(Profile profile,
String file)
Saves the profile specified by profile to the location
specified by file. |
|
static void |
saveProfileAs(Profile profile,
URI uri)
Saves the profile specified by profile to the location
specified by uri. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static IUMLHelper getUMLHelper()
Element
IUMLHelperpublic static IUMLUIHelper getUMLUIHelper()
Element
IUMLUIHelperpublic static IQueryHelper getQueryHelper()
IQueryHelperpublic static IOclQueryHelper getOclQueryHelper()
IOclQueryHelperpublic static IUMLDiagramHelper getUMLDiagramHelper()
View
IUMLDiagramHelperpublic static TransactionalEditingDomain getEditingDomain()
EditingDomainpublic static Collection<Model> getOpenedModels()
UMLModeler.getOpenModelRoots() method, instead.
Modelspublic static Collection<Element> getOpenModelRoots()
Packages of some kind, but this is not guaranteed@Deprecated public static Model createModel(String file)
UMLModeler.createModelResource(Class, String)
method, instead, with the Model.class root metaclass
argument
file - The model file to create
IllegalArgumentException - file is an empty string
NullPointerException - file is null@Deprecated public static Model createModel(URI uri)
UMLModeler.createModelResource(Class, URI)
method, instead, with the Model.class root metaclass
argument
uri - The URI of the model to create
IllegalArgumentException - uri is an empty URI
NullPointerException - uri is null
public static <E extends Element> E createModelResource(Class<E> rootMetaclass,
String file)
E - the metaclass to instantiate as the root elementrootMetaclass - the metaclass to instantiate as the root element. Must be
either Model or Packagefile - The model resource to create
IllegalArgumentException - if rootMetaclass is not one of the permitted
values or file is an empty string
NullPointerException - file is null
public static <E extends Element> E createModelResource(Class<E> rootMetaclass,
URI uri)
E - the metaclass to instantiate as the root elementrootMetaclass - the metaclass to instantiate as the root element. Must be
either Model or Packageuri - The URI of the model resource to create
IllegalArgumentException - if rootMetaclass is not one of the permitted
values or uri is an empty URI
NullPointerException - uri is null
@Deprecated
public static Model openModel(String file)
throws IOException
UMLModeler.openModelResource(String) method,
instead.
file.
Supported extensions are:
.emx
.uml
file - The model file to open
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model
public static Element openModelResource(String file)
throws IOException
file.
Supported extensions are:
.emx
.uml
file - The model file to open
Package, but that is not guaranteed
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model
@Deprecated
public static Model openModel(URI uri)
throws IOException
UMLModeler.openModelResource(URI) method,
instead.
uri.
Supported extensions are:
.emx
.uml
uri - The URI of the model to open
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model
public static Element openModelResource(URI uri)
throws IOException
uri.
Supported extensions are:
.emx
.uml
uri - The URI of the model to open
Package, but that is not guaranteed
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model
@Deprecated
public static void saveModel(Model model)
throws IOException
UMLModeler.saveModelResource(Element) method,
instead.
model.
model - The UML model to save
IOException - The location specified by the root path of model
cannot be used to save the model
IllegalArgumentException - model has no associated resource
public static void saveModelResource(Element model)
throws IOException
model. The specified
resource and any currently open, modified fragment resource are saved.
model - The root element of the UML model resource to save
IOException - The location specified by the root path of model
cannot be used to save the model
IllegalArgumentException - model has no associated resource
@Deprecated
public static void saveModelAs(Model model,
String file)
throws IOException
UMLModeler.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 model
IOException - The location specified by file cannot be used
to save the model
IllegalArgumentException - model has no associated resource or
model is null
public static void saveModelResourceAs(Element model,
String file)
throws 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 resource
IOException - The location specified by file cannot be used
to save the model
IllegalArgumentException - model has no associated resource or
model is null
@Deprecated
public static void saveModelAs(Model model,
URI uri)
throws IOException
UMLModeler.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 model
IOException - The location specified by uri cannot be used
to save the model
IllegalArgumentException - model has no associated resource or
model is null
public static void saveModelResourceAs(Element model,
URI uri)
throws 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 resource
IOException - The location specified by uri cannot be used
to save the model
IllegalArgumentException - model has no associated resource or
model is nullpublic static void closeModel(Model model)
UMLModeler.closeModelResource(Element) method,
instead
model
model - The UML2 model to close
IllegalArgumentException - model has no associated resourcepublic static void closeModelResource(Element element)
element.
element - The root element of the UML model to close
IllegalArgumentException - if element has no associated resource or if it
is not a root elementpublic static void closeModelFragment(EObject element)
element.
element - The root element of the UML model fragment to close
IllegalArgumentException - if element has no associated resource or if it
is not the root element of a fragment resourcepublic static Profile createProfile(String file)
file - The profile file to create
IllegalArgumentException - file is an empty string
NullPointerException - file is nullpublic static Profile createProfile(URI uri)
uri - The URI of the profile to create
IllegalArgumentException - file is an empty string
NullPointerException - file is null
public static Profile openProfile(String file)
throws IOException
file.
Supported extensions are:
.epx
.uml
file - The profile file to open
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Profile
public static Profile openProfile(URI uri)
throws IOException
uri.
Supported extensions are:
.epx
.uml
uri - The URI of the profile to open
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found
or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Profile
public static void saveProfile(Profile profile)
throws IOException
profile.
profile - The UML profile to save
IOException - The location specified by the root path of
profile cannot be used to save the profile
IllegalArgumentException - profile has no associated resource
public static void saveProfileAs(Profile profile,
String file)
throws 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 profile
IOException - The location specified by file cannot be used
to save the profile
IllegalArgumentException - profile has no associated resource or
profile is null
public static void saveProfileAs(Profile profile,
URI uri)
throws 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 profile
IOException - The location specified by file cannot be used
to save the profile
IllegalArgumentException - profile has no associated resource or
profile is nullpublic static void closeProfile(Profile profile)
profile
profile - The UML2 profile to close
IllegalArgumentException - profile has no associated resourcepublic static ILogicalResource getLogicalResource(EObject eObj)
eObj - The EObject whose logical resource is returned
public static ILogicalResource getLogicalResource(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 Resource createFragment(URI fragmentUri,
EModelElement fragmentRoot)
fragmentUri - URI for the new fragmentfragmentRoot - The element to be moved into the fragment
public static Resource createFragmentSilently(URI fragmentUri,
EModelElement fragmentRoot,
boolean refactorReferences)
fragmentUri - URI for the new fragmentfragmentRoot - The element to be moved into the fragmentrefactorReferences - Indicator if the references should be refactored
public static List<Resource> batchCreateFragments(List<URI> fragmentUris,
List<? extends 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 refactored
Resources
IllegalArgumentExceptionpublic static EObject absorbFragment(Resource resource)
resource - Fragment resource to be absorbed
public static EObject absorbFragmentSilently(Resource resource,
boolean refactorReferences)
resource - Fragment resource to be absorbedrefactorReferences - Indicator if the references should be refactored
public static List<EModelElement> batchAbsorbFragments(List<? extends Resource> resources,
boolean refactorReferences)
resources - Fragment resources to be absorbedrefactorReferences - Indicator if the references should be refactored
|
UML Modeler | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||