Home » Modeling » UML2 » UML Model Editor/ Importing
UML Model Editor/ Importing [message #476989] |
Wed, 27 February 2008 00:49 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
When my plugin is running as an Eclipse Application, I have problems with
the UML Editor. If I create the uml model inside the running eclipse
environment, then the editor loads fine, but when I try to bring in a .uml
or .xmi file and open it with the UML editor, then eclipse gives errors and
can't open the UML editor because it says an "assertion failed". Is the UML
editor not able to import when being run from an Eclipse Application
instance that is being run from the main Eclipse Application?
My ultimate goal here is to find a way to use the UML Model Editor's process
of parsing an XMI file into whatever form it stores the data it in memory so
that I don't have to write my own XMI parser. I think it stores it as a
GenModel, but I'm not sure yet. If so, then my hope is that getting the UML
information from the GenModel (or whatever its stored as) would be much
easier than writing an XMI parser from scratch. Do you have any idea of how
I could use UML2 to do the XMI parsing and then get a reference to the
object its stored as? Or if you could let me know the class that does the
parsing of the XMI file and storage into an Object that would also be
helpful. Thank you.
Here is the stacktrace I get when I try to import when running my plugin as
an Eclipse Application:
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
at
org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
|
|
|
Re: UML Model Editor/ Importing [message #476992 is a reply to message #476989] |
Wed, 27 February 2008 04:57 |
Rafael Chaves Messages: 362 Registered: July 2009 |
Senior Member |
|
|
You load a UML2 model the same way you load any EMF model.
For example:
String uri = "file://c:/temp/mymodel.uml2";
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(URI.createURI(uri), true);
You can then traverse the resource's contents and find all model
elements (normally starting with the package/model). Here is the javadoc
for the metamodel API:
http://download.eclipse.org/tools/uml2/2.1.0/javadoc/org/ecl ipse/uml2/uml/package-summary.html
If you want to do this from an ordinary Java application instead of from
an Eclipse-based application, some extra code is required before you can
load a model:
http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F
The GenModel is a simple model that drives code generation from
EMF-based models, plus a bunch of references to elements from the model
that will be the input to the code generation. But it is not the model
itself.
HTH,
Rafael
PFuriani wrote:
> When my plugin is running as an Eclipse Application, I have problems with
> the UML Editor. If I create the uml model inside the running eclipse
> environment, then the editor loads fine, but when I try to bring in a .uml
> or .xmi file and open it with the UML editor, then eclipse gives errors and
> can't open the UML editor because it says an "assertion failed". Is the UML
> editor not able to import when being run from an Eclipse Application
> instance that is being run from the main Eclipse Application?
>
> My ultimate goal here is to find a way to use the UML Model Editor's process
> of parsing an XMI file into whatever form it stores the data it in memory so
> that I don't have to write my own XMI parser. I think it stores it as a
> GenModel, but I'm not sure yet. If so, then my hope is that getting the UML
> information from the GenModel (or whatever its stored as) would be much
> easier than writing an XMI parser from scratch. Do you have any idea of how
> I could use UML2 to do the XMI parsing and then get a reference to the
> object its stored as? Or if you could let me know the class that does the
> parsing of the XMI file and storage into an Object that would also be
> helpful. Thank you.
>
> Here is the stacktrace I get when I try to import when running my plugin as
> an Eclipse Application:
>
> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
> at
> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
> at
> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
> at
> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
> at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
> at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>
>
|
|
| |
Re: UML Model Editor/ Importing [message #477007 is a reply to message #476998] |
Fri, 29 February 2008 00:44 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
The part on there that says how to load a package using Java code from a URI
looks promising. When it says, "Next, we use an EMF utility method to
obtain the first object of type Package from the resource's contents.", what
does it mean by "first" package? Does it mean the top-most-level package?
Also, what if there are no packages at all in the UML Model I want to
import?
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fq3sdd$8d4$1@build.eclipse.org...
> You might also want to check out the introductory articles on the
> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
> overview of how to work with UML models and profiles both via the editor
> and
> programmatically with Java code...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq2bsu$9ls$1@build.eclipse.org...
>> When my plugin is running as an Eclipse Application, I have problems
>> with
>> the UML Editor. If I create the uml model inside the running eclipse
>> environment, then the editor loads fine, but when I try to bring in a
>> .uml
>> or .xmi file and open it with the UML editor, then eclipse gives errors
>> and can't open the UML editor because it says an "assertion failed". Is
>> the UML editor not able to import when being run from an Eclipse
>> Application instance that is being run from the main Eclipse Application?
>>
>> My ultimate goal here is to find a way to use the UML Model Editor's
>> process of parsing an XMI file into whatever form it stores the data it
>> in
>> memory so that I don't have to write my own XMI parser. I think it
>> stores
>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>> getting the UML information from the GenModel (or whatever its stored as)
>> would be much easier than writing an XMI parser from scratch. Do you
>> have
>> any idea of how I could use UML2 to do the XMI parsing and then get a
>> reference to the object its stored as? Or if you could let me know the
>> class that does the parsing of the XMI file and storage into an Object
>> that would also be helpful. Thank you.
>>
>> Here is the stacktrace I get when I try to import when running my plugin
>> as an Eclipse Application:
>>
>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>> at
>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>> at
>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>> at
>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>> at
>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>
>
>
-
Attachment: tag_2.gif
(Size: 0.16KB, Downloaded 182 times)
|
|
|
Re: UML Model Editor/ Importing [message #477014 is a reply to message #477007] |
Mon, 03 March 2008 13:37 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
The "first" package is the first (top-level) package in the resource's list
of contents. Generally speaking, every UML model must have a package (or
model or profile) at its root since only packages are allow to not have an
owner (parent element) in UML...
Kenn
"PFuriani" <pfuriani@uci.edu> wrote in message
news:fq7kc1$ptq$1@build.eclipse.org...
> The part on there that says how to load a package using Java code from a
> URI looks promising. When it says, "Next, we use an EMF utility method
> to obtain the first object of type Package from the resource's contents.",
> what does it mean by "first" package? Does it mean the top-most-level
> package? Also, what if there are no packages at all in the UML Model I
> want to import?
>
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:fq3sdd$8d4$1@build.eclipse.org...
>> You might also want to check out the introductory articles on the
>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>> overview of how to work with UML models and profiles both via the editor
>> and
>> programmatically with Java code...
>>
>> Kenn
>>
>> "PFuriani" <pfuriani@uci.edu> wrote in message
>> news:fq2bsu$9ls$1@build.eclipse.org...
>>> When my plugin is running as an Eclipse Application, I have problems
>>> with
>>> the UML Editor. If I create the uml model inside the running eclipse
>>> environment, then the editor loads fine, but when I try to bring in a
>>> .uml
>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>> and can't open the UML editor because it says an "assertion failed". Is
>>> the UML editor not able to import when being run from an Eclipse
>>> Application instance that is being run from the main Eclipse
>>> Application?
>>>
>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>> process of parsing an XMI file into whatever form it stores the data it
>>> in
>>> memory so that I don't have to write my own XMI parser. I think it
>>> stores
>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>> getting the UML information from the GenModel (or whatever its stored
>>> as)
>>> would be much easier than writing an XMI parser from scratch. Do you
>>> have
>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>> reference to the object its stored as? Or if you could let me know the
>>> class that does the parsing of the XMI file and storage into an Object
>>> that would also be helpful. Thank you.
>>>
>>> Here is the stacktrace I get when I try to import when running my plugin
>>> as an Eclipse Application:
>>>
>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>> at
>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>> at
>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>
>>
>>
>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #477025 is a reply to message #477014] |
Wed, 05 March 2008 00:52 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
This was really helpful. How do I specify a constructor for a class with
the UML2 editor? Do I have to specify it as an owned operation? If so, how
can I tell the difference between an operation and constructor if I had this
"Model" data structure?
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fqguvb$v3l$1@build.eclipse.org...
> The "first" package is the first (top-level) package in the resource's
> list of contents. Generally speaking, every UML model must have a package
> (or model or profile) at its root since only packages are allow to not
> have an owner (parent element) in UML...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq7kc1$ptq$1@build.eclipse.org...
>> The part on there that says how to load a package using Java code from a
>> URI looks promising. When it says, "Next, we use an EMF utility method
>> to obtain the first object of type Package from the resource's
>> contents.", what does it mean by "first" package? Does it mean the
>> top-most-level package? Also, what if there are no packages at all in the
>> UML Model I want to import?
>>
>>
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>> news:fq3sdd$8d4$1@build.eclipse.org...
>>> You might also want to check out the introductory articles on the
>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>> overview of how to work with UML models and profiles both via the editor
>>> and
>>> programmatically with Java code...
>>>
>>> Kenn
>>>
>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>> When my plugin is running as an Eclipse Application, I have problems
>>>> with
>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>> environment, then the editor loads fine, but when I try to bring in a
>>>> .uml
>>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>>> and can't open the UML editor because it says an "assertion failed". Is
>>>> the UML editor not able to import when being run from an Eclipse
>>>> Application instance that is being run from the main Eclipse
>>>> Application?
>>>>
>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>> process of parsing an XMI file into whatever form it stores the data it
>>>> in
>>>> memory so that I don't have to write my own XMI parser. I think it
>>>> stores
>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>> getting the UML information from the GenModel (or whatever its stored
>>>> as)
>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>> have
>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>> reference to the object its stored as? Or if you could let me know the
>>>> class that does the parsing of the XMI file and storage into an Object
>>>> that would also be helpful. Thank you.
>>>>
>>>> Here is the stacktrace I get when I try to import when running my
>>>> plugin
>>>> as an Eclipse Application:
>>>>
>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>
>>>
>>>
>>
>>
>>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #477026 is a reply to message #477025] |
Wed, 05 March 2008 01:26 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
A constructor is typically an operation stereotyped as <<create>>...
Kenn
"PFuriani" <pfuriani@uci.edu> wrote in message
news:fqkqn2$bq2$1@build.eclipse.org...
> This was really helpful. How do I specify a constructor for a class with
> the UML2 editor? Do I have to specify it as an owned operation? If so,
> how can I tell the difference between an operation and constructor if I
> had this "Model" data structure?
>
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:fqguvb$v3l$1@build.eclipse.org...
>> The "first" package is the first (top-level) package in the resource's
>> list of contents. Generally speaking, every UML model must have a package
>> (or model or profile) at its root since only packages are allow to not
>> have an owner (parent element) in UML...
>>
>> Kenn
>>
>> "PFuriani" <pfuriani@uci.edu> wrote in message
>> news:fq7kc1$ptq$1@build.eclipse.org...
>>> The part on there that says how to load a package using Java code from a
>>> URI looks promising. When it says, "Next, we use an EMF utility method
>>> to obtain the first object of type Package from the resource's
>>> contents.", what does it mean by "first" package? Does it mean the
>>> top-most-level package? Also, what if there are no packages at all in
>>> the UML Model I want to import?
>>>
>>>
>>>
>>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>>> news:fq3sdd$8d4$1@build.eclipse.org...
>>>> You might also want to check out the introductory articles on the
>>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>>> overview of how to work with UML models and profiles both via the
>>>> editor and
>>>> programmatically with Java code...
>>>>
>>>> Kenn
>>>>
>>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>>> When my plugin is running as an Eclipse Application, I have problems
>>>>> with
>>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>>> environment, then the editor loads fine, but when I try to bring in a
>>>>> .uml
>>>>> or .xmi file and open it with the UML editor, then eclipse gives
>>>>> errors
>>>>> and can't open the UML editor because it says an "assertion failed".
>>>>> Is
>>>>> the UML editor not able to import when being run from an Eclipse
>>>>> Application instance that is being run from the main Eclipse
>>>>> Application?
>>>>>
>>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>>> process of parsing an XMI file into whatever form it stores the data
>>>>> it in
>>>>> memory so that I don't have to write my own XMI parser. I think it
>>>>> stores
>>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>>> getting the UML information from the GenModel (or whatever its stored
>>>>> as)
>>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>>> have
>>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>>> reference to the object its stored as? Or if you could let me know
>>>>> the
>>>>> class that does the parsing of the XMI file and storage into an Object
>>>>> that would also be helpful. Thank you.
>>>>>
>>>>> Here is the stacktrace I get when I try to import when running my
>>>>> plugin
>>>>> as an Eclipse Application:
>>>>>
>>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>>> at
>>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>>> at
>>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>>> at
>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>>> at
>>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>>> at
>>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>>> at
>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>>> at
>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>>> at
>>>>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>>> at
>>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #477161 is a reply to message #477014] |
Sat, 29 March 2008 16:06 |
Eclipse User |
|
|
|
Originally posted by: comouraf-lixo.yahoo.fr
Hi,
This is also a doubt of mine. This need of having a root element is really a
constraint defined in the UML spec or is it an imposition of by the mdt.uml2
implementation (inherited from the EMF)? In the former case, where is it
stated in the UML specification?
Thanks,
César
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> a écrit dans le message de
news:fqguvb$v3l$1@build.eclipse.org...
> The "first" package is the first (top-level) package in the resource's
> list of contents. Generally speaking, every UML model must have a package
> (or model or profile) at its root since only packages are allow to not
> have an owner (parent element) in UML...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq7kc1$ptq$1@build.eclipse.org...
>> The part on there that says how to load a package using Java code from a
>> URI looks promising. When it says, "Next, we use an EMF utility method
>> to obtain the first object of type Package from the resource's
>> contents.", what does it mean by "first" package? Does it mean the
>> top-most-level package? Also, what if there are no packages at all in the
>> UML Model I want to import?
>>
>>
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>> news:fq3sdd$8d4$1@build.eclipse.org...
>>> You might also want to check out the introductory articles on the
>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>> overview of how to work with UML models and profiles both via the editor
>>> and
>>> programmatically with Java code...
>>>
>>> Kenn
>>>
>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>> When my plugin is running as an Eclipse Application, I have problems
>>>> with
>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>> environment, then the editor loads fine, but when I try to bring in a
>>>> .uml
>>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>>> and can't open the UML editor because it says an "assertion failed". Is
>>>> the UML editor not able to import when being run from an Eclipse
>>>> Application instance that is being run from the main Eclipse
>>>> Application?
>>>>
>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>> process of parsing an XMI file into whatever form it stores the data it
>>>> in
>>>> memory so that I don't have to write my own XMI parser. I think it
>>>> stores
>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>> getting the UML information from the GenModel (or whatever its stored
>>>> as)
>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>> have
>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>> reference to the object its stored as? Or if you could let me know the
>>>> class that does the parsing of the XMI file and storage into an Object
>>>> that would also be helpful. Thank you.
>>>>
>>>> Here is the stacktrace I get when I try to import when running my
>>>> plugin
>>>> as an Eclipse Application:
>>>>
>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>
>>>
>>>
>>
>>
>>
>
>
|
|
| |
Re: UML Model Editor/ Importing [message #626095 is a reply to message #476989] |
Wed, 27 February 2008 04:57 |
Rafael Chaves Messages: 362 Registered: July 2009 |
Senior Member |
|
|
You load a UML2 model the same way you load any EMF model.
For example:
String uri = "file://c:/temp/mymodel.uml2";
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(URI.createURI(uri), true);
You can then traverse the resource's contents and find all model
elements (normally starting with the package/model). Here is the javadoc
for the metamodel API:
http://download.eclipse.org/tools/uml2/2.1.0/javadoc/org/ecl ipse/uml2/uml/package-summary.html
If you want to do this from an ordinary Java application instead of from
an Eclipse-based application, some extra code is required before you can
load a model:
http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_requ ired_to_load_a_UML_.28.uml.29_resource_from_a_standalone_app lication.3F
The GenModel is a simple model that drives code generation from
EMF-based models, plus a bunch of references to elements from the model
that will be the input to the code generation. But it is not the model
itself.
HTH,
Rafael
PFuriani wrote:
> When my plugin is running as an Eclipse Application, I have problems with
> the UML Editor. If I create the uml model inside the running eclipse
> environment, then the editor loads fine, but when I try to bring in a .uml
> or .xmi file and open it with the UML editor, then eclipse gives errors and
> can't open the UML editor because it says an "assertion failed". Is the UML
> editor not able to import when being run from an Eclipse Application
> instance that is being run from the main Eclipse Application?
>
> My ultimate goal here is to find a way to use the UML Model Editor's process
> of parsing an XMI file into whatever form it stores the data it in memory so
> that I don't have to write my own XMI parser. I think it stores it as a
> GenModel, but I'm not sure yet. If so, then my hope is that getting the UML
> information from the GenModel (or whatever its stored as) would be much
> easier than writing an XMI parser from scratch. Do you have any idea of how
> I could use UML2 to do the XMI parsing and then get a reference to the
> object its stored as? Or if you could let me know the class that does the
> parsing of the XMI file and storage into an Object that would also be
> helpful. Thank you.
>
> Here is the stacktrace I get when I try to import when running my plugin as
> an Eclipse Application:
>
> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
> at
> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
> at
> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
> at
> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
> at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
> at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>
>
|
|
| |
Re: UML Model Editor/ Importing [message #626111 is a reply to message #476998] |
Fri, 29 February 2008 00:44 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
The part on there that says how to load a package using Java code from a URI
looks promising. When it says, "Next, we use an EMF utility method to
obtain the first object of type Package from the resource's contents.", what
does it mean by "first" package? Does it mean the top-most-level package?
Also, what if there are no packages at all in the UML Model I want to
import?
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fq3sdd$8d4$1@build.eclipse.org...
> You might also want to check out the introductory articles on the
> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
> overview of how to work with UML models and profiles both via the editor
> and
> programmatically with Java code...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq2bsu$9ls$1@build.eclipse.org...
>> When my plugin is running as an Eclipse Application, I have problems
>> with
>> the UML Editor. If I create the uml model inside the running eclipse
>> environment, then the editor loads fine, but when I try to bring in a
>> .uml
>> or .xmi file and open it with the UML editor, then eclipse gives errors
>> and can't open the UML editor because it says an "assertion failed". Is
>> the UML editor not able to import when being run from an Eclipse
>> Application instance that is being run from the main Eclipse Application?
>>
>> My ultimate goal here is to find a way to use the UML Model Editor's
>> process of parsing an XMI file into whatever form it stores the data it
>> in
>> memory so that I don't have to write my own XMI parser. I think it
>> stores
>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>> getting the UML information from the GenModel (or whatever its stored as)
>> would be much easier than writing an XMI parser from scratch. Do you
>> have
>> any idea of how I could use UML2 to do the XMI parsing and then get a
>> reference to the object its stored as? Or if you could let me know the
>> class that does the parsing of the XMI file and storage into an Object
>> that would also be helpful. Thank you.
>>
>> Here is the stacktrace I get when I try to import when running my plugin
>> as an Eclipse Application:
>>
>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>> at
>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>> at
>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>> at
>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>> at
>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>
>
>
-
Attachment: tag_2.gif
(Size: 0.16KB, Downloaded 170 times)
|
|
|
Re: UML Model Editor/ Importing [message #626118 is a reply to message #477007] |
Mon, 03 March 2008 13:37 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
The "first" package is the first (top-level) package in the resource's list
of contents. Generally speaking, every UML model must have a package (or
model or profile) at its root since only packages are allow to not have an
owner (parent element) in UML...
Kenn
"PFuriani" <pfuriani@uci.edu> wrote in message
news:fq7kc1$ptq$1@build.eclipse.org...
> The part on there that says how to load a package using Java code from a
> URI looks promising. When it says, "Next, we use an EMF utility method
> to obtain the first object of type Package from the resource's contents.",
> what does it mean by "first" package? Does it mean the top-most-level
> package? Also, what if there are no packages at all in the UML Model I
> want to import?
>
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:fq3sdd$8d4$1@build.eclipse.org...
>> You might also want to check out the introductory articles on the
>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>> overview of how to work with UML models and profiles both via the editor
>> and
>> programmatically with Java code...
>>
>> Kenn
>>
>> "PFuriani" <pfuriani@uci.edu> wrote in message
>> news:fq2bsu$9ls$1@build.eclipse.org...
>>> When my plugin is running as an Eclipse Application, I have problems
>>> with
>>> the UML Editor. If I create the uml model inside the running eclipse
>>> environment, then the editor loads fine, but when I try to bring in a
>>> .uml
>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>> and can't open the UML editor because it says an "assertion failed". Is
>>> the UML editor not able to import when being run from an Eclipse
>>> Application instance that is being run from the main Eclipse
>>> Application?
>>>
>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>> process of parsing an XMI file into whatever form it stores the data it
>>> in
>>> memory so that I don't have to write my own XMI parser. I think it
>>> stores
>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>> getting the UML information from the GenModel (or whatever its stored
>>> as)
>>> would be much easier than writing an XMI parser from scratch. Do you
>>> have
>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>> reference to the object its stored as? Or if you could let me know the
>>> class that does the parsing of the XMI file and storage into an Object
>>> that would also be helpful. Thank you.
>>>
>>> Here is the stacktrace I get when I try to import when running my plugin
>>> as an Eclipse Application:
>>>
>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>> at
>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>> at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>> at
>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>
>>
>>
>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #626129 is a reply to message #477014] |
Wed, 05 March 2008 00:52 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
This was really helpful. How do I specify a constructor for a class with
the UML2 editor? Do I have to specify it as an owned operation? If so, how
can I tell the difference between an operation and constructor if I had this
"Model" data structure?
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fqguvb$v3l$1@build.eclipse.org...
> The "first" package is the first (top-level) package in the resource's
> list of contents. Generally speaking, every UML model must have a package
> (or model or profile) at its root since only packages are allow to not
> have an owner (parent element) in UML...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq7kc1$ptq$1@build.eclipse.org...
>> The part on there that says how to load a package using Java code from a
>> URI looks promising. When it says, "Next, we use an EMF utility method
>> to obtain the first object of type Package from the resource's
>> contents.", what does it mean by "first" package? Does it mean the
>> top-most-level package? Also, what if there are no packages at all in the
>> UML Model I want to import?
>>
>>
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>> news:fq3sdd$8d4$1@build.eclipse.org...
>>> You might also want to check out the introductory articles on the
>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>> overview of how to work with UML models and profiles both via the editor
>>> and
>>> programmatically with Java code...
>>>
>>> Kenn
>>>
>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>> When my plugin is running as an Eclipse Application, I have problems
>>>> with
>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>> environment, then the editor loads fine, but when I try to bring in a
>>>> .uml
>>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>>> and can't open the UML editor because it says an "assertion failed". Is
>>>> the UML editor not able to import when being run from an Eclipse
>>>> Application instance that is being run from the main Eclipse
>>>> Application?
>>>>
>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>> process of parsing an XMI file into whatever form it stores the data it
>>>> in
>>>> memory so that I don't have to write my own XMI parser. I think it
>>>> stores
>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>> getting the UML information from the GenModel (or whatever its stored
>>>> as)
>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>> have
>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>> reference to the object its stored as? Or if you could let me know the
>>>> class that does the parsing of the XMI file and storage into an Object
>>>> that would also be helpful. Thank you.
>>>>
>>>> Here is the stacktrace I get when I try to import when running my
>>>> plugin
>>>> as an Eclipse Application:
>>>>
>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>
>>>
>>>
>>
>>
>>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #626142 is a reply to message #477025] |
Wed, 05 March 2008 01:26 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
A constructor is typically an operation stereotyped as <<create>>...
Kenn
"PFuriani" <pfuriani@uci.edu> wrote in message
news:fqkqn2$bq2$1@build.eclipse.org...
> This was really helpful. How do I specify a constructor for a class with
> the UML2 editor? Do I have to specify it as an owned operation? If so,
> how can I tell the difference between an operation and constructor if I
> had this "Model" data structure?
>
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:fqguvb$v3l$1@build.eclipse.org...
>> The "first" package is the first (top-level) package in the resource's
>> list of contents. Generally speaking, every UML model must have a package
>> (or model or profile) at its root since only packages are allow to not
>> have an owner (parent element) in UML...
>>
>> Kenn
>>
>> "PFuriani" <pfuriani@uci.edu> wrote in message
>> news:fq7kc1$ptq$1@build.eclipse.org...
>>> The part on there that says how to load a package using Java code from a
>>> URI looks promising. When it says, "Next, we use an EMF utility method
>>> to obtain the first object of type Package from the resource's
>>> contents.", what does it mean by "first" package? Does it mean the
>>> top-most-level package? Also, what if there are no packages at all in
>>> the UML Model I want to import?
>>>
>>>
>>>
>>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>>> news:fq3sdd$8d4$1@build.eclipse.org...
>>>> You might also want to check out the introductory articles on the
>>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>>> overview of how to work with UML models and profiles both via the
>>>> editor and
>>>> programmatically with Java code...
>>>>
>>>> Kenn
>>>>
>>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>>> When my plugin is running as an Eclipse Application, I have problems
>>>>> with
>>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>>> environment, then the editor loads fine, but when I try to bring in a
>>>>> .uml
>>>>> or .xmi file and open it with the UML editor, then eclipse gives
>>>>> errors
>>>>> and can't open the UML editor because it says an "assertion failed".
>>>>> Is
>>>>> the UML editor not able to import when being run from an Eclipse
>>>>> Application instance that is being run from the main Eclipse
>>>>> Application?
>>>>>
>>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>>> process of parsing an XMI file into whatever form it stores the data
>>>>> it in
>>>>> memory so that I don't have to write my own XMI parser. I think it
>>>>> stores
>>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>>> getting the UML information from the GenModel (or whatever its stored
>>>>> as)
>>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>>> have
>>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>>> reference to the object its stored as? Or if you could let me know
>>>>> the
>>>>> class that does the parsing of the XMI file and storage into an Object
>>>>> that would also be helpful. Thank you.
>>>>>
>>>>> Here is the stacktrace I get when I try to import when running my
>>>>> plugin
>>>>> as an Eclipse Application:
>>>>>
>>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>>> at
>>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>>> at
>>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>>> at
>>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>>> at
>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>>> at
>>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>>> at
>>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>>> at
>>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>>> at
>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>>> at
>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>>> at
>>>>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>>> at
>>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>>> at
>>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>>> at
>>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>>> at
>>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
|
|
|
Re: UML Model Editor/ Importing [message #626303 is a reply to message #477014] |
Sat, 29 March 2008 16:06 |
Eclipse User |
|
|
|
Originally posted by: comouraf-lixo.yahoo.fr
Hi,
This is also a doubt of mine. This need of having a root element is really a
constraint defined in the UML spec or is it an imposition of by the mdt.uml2
implementation (inherited from the EMF)? In the former case, where is it
stated in the UML specification?
Thanks,
César
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> a écrit dans le message de
news:fqguvb$v3l$1@build.eclipse.org...
> The "first" package is the first (top-level) package in the resource's
> list of contents. Generally speaking, every UML model must have a package
> (or model or profile) at its root since only packages are allow to not
> have an owner (parent element) in UML...
>
> Kenn
>
> "PFuriani" <pfuriani@uci.edu> wrote in message
> news:fq7kc1$ptq$1@build.eclipse.org...
>> The part on there that says how to load a package using Java code from a
>> URI looks promising. When it says, "Next, we use an EMF utility method
>> to obtain the first object of type Package from the resource's
>> contents.", what does it mean by "first" package? Does it mean the
>> top-most-level package? Also, what if there are no packages at all in the
>> UML Model I want to import?
>>
>>
>>
>> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
>> news:fq3sdd$8d4$1@build.eclipse.org...
>>> You might also want to check out the introductory articles on the
>>> documentation page (http://wiki.eclipse.org/MDT-UML2#Articles) for an
>>> overview of how to work with UML models and profiles both via the editor
>>> and
>>> programmatically with Java code...
>>>
>>> Kenn
>>>
>>> "PFuriani" <pfuriani@uci.edu> wrote in message
>>> news:fq2bsu$9ls$1@build.eclipse.org...
>>>> When my plugin is running as an Eclipse Application, I have problems
>>>> with
>>>> the UML Editor. If I create the uml model inside the running eclipse
>>>> environment, then the editor loads fine, but when I try to bring in a
>>>> .uml
>>>> or .xmi file and open it with the UML editor, then eclipse gives errors
>>>> and can't open the UML editor because it says an "assertion failed". Is
>>>> the UML editor not able to import when being run from an Eclipse
>>>> Application instance that is being run from the main Eclipse
>>>> Application?
>>>>
>>>> My ultimate goal here is to find a way to use the UML Model Editor's
>>>> process of parsing an XMI file into whatever form it stores the data it
>>>> in
>>>> memory so that I don't have to write my own XMI parser. I think it
>>>> stores
>>>> it as a GenModel, but I'm not sure yet. If so, then my hope is that
>>>> getting the UML information from the GenModel (or whatever its stored
>>>> as)
>>>> would be much easier than writing an XMI parser from scratch. Do you
>>>> have
>>>> any idea of how I could use UML2 to do the XMI parsing and then get a
>>>> reference to the object its stored as? Or if you could let me know the
>>>> class that does the parsing of the XMI file and storage into an Object
>>>> that would also be helpful. Thank you.
>>>>
>>>> Here is the stacktrace I get when I try to import when running my
>>>> plugin
>>>> as an Eclipse Application:
>>>>
>>>> org.eclipse.core.runtime.AssertionFailedException: assertion failed:
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
>>>> at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:695)
>>>> at
>>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:287)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
>>>> at
>>>> org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:340)
>>>> at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.ja va:328)
>>>> at
>>>> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:190)
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
>>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
>>>>
>>>
>>>
>>
>>
>>
>
>
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 12:26:25 GMT 2024
Powered by FUDForum. Page generated in 0.04715 seconds
|