Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Is it possible to edit an EMF model with two different editors?
Is it possible to edit an EMF model with two different editors? [message #384137] Mon, 26 April 2004 13:31 Go to next message
Charles Fulnecky is currently offline Charles FulneckyFriend
Messages: 81
Registered: July 2009
Member
I have a need to present two different looks when using an EMF based editor.
Initially I wanted to move a child that had children of it's own into the
properties view. I wanted this because the typical user would never drill
further than 6 levels of an 8 level tree. To reduce confusion I followed
the advice in Chapter 14 to supress display of elements below level
6(OperationalElement). However this forum had several posts that suggested
this may not be possible, or at least non-trivial.

I then thought that I could have two editors, the default and an admin
editor. This proved problematic since I can only get one editor to work
with a given file extension.

Any suggestions would be appreciated:

Thanks,

Charlie

P.S.
The editor is generated from W3C Schema and looks like:

<?xml version="1.0" encoding="UTF-8"?>

<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Fulnecky
(OSD/JMACA) -->

<!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

<xs:element name="AreaOfOperationsCommand">

<xs:complexType>

<xs:sequence>

<xs:element ref="OperationalCommand" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="Datasource">

<xs:complexType>

<xs:sequence>

<xs:element ref="Parameter" minOccurs="0" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="ForceOrganization">

<xs:complexType>

<xs:sequence>

<xs:element ref="Service" maxOccurs="unbounded"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="OperationalCommand">

<xs:complexType>

<xs:sequence>

<xs:element ref="OperationalUnit" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="OperationalElement">

<xs:complexType>

<xs:sequence>

<xs:element ref="Datasource" minOccurs="0" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

<xs:attribute name="uic" type="xs:string" use="required"/>

<xs:attribute name="selected" type="xs:string" use="required"/>

<xs:attribute name="default_datasource" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="OperationalUnit">

<xs:complexType>

<xs:sequence>

<xs:element ref="OperationalElement" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="Parameter">

<xs:complexType>

<xs:attribute name="name" type="xs:string" use="required"/>

<xs:attribute name="value" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="Service">

<xs:complexType>

<xs:sequence>

<xs:element ref="ServiceCommand" maxOccurs="unbounded"/>

</xs:sequence>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

<xs:element name="ServiceCommand">

<xs:complexType>

<xs:choice>

<xs:element ref="AreaOfOperationsCommand" maxOccurs="unbounded"/>

<xs:element ref="OperationalElement" maxOccurs="unbounded"/>

</xs:choice>

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:complexType>

</xs:element>

</xs:schema>
Re: Is it possible to edit an EMF model with two different editors? [message #384142 is a reply to message #384137] Mon, 26 April 2004 14:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Charles,

Not showing children past a certain level should be easy. What's the problem
with doing that? It's also possible to have multiple editors for the same
extension; you just need to do "Open With" to choose....


Charles Fulnecky wrote:

> I have a need to present two different looks when using an EMF based editor.
> Initially I wanted to move a child that had children of it's own into the
> properties view. I wanted this because the typical user would never drill
> further than 6 levels of an 8 level tree. To reduce confusion I followed
> the advice in Chapter 14 to supress display of elements below level
> 6(OperationalElement). However this forum had several posts that suggested
> this may not be possible, or at least non-trivial.
>
> I then thought that I could have two editors, the default and an admin
> editor. This proved problematic since I can only get one editor to work
> with a given file extension.
>
> Any suggestions would be appreciated:
>
> Thanks,
>
> Charlie
>
> P.S.
> The editor is generated from W3C Schema and looks like:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Fulnecky
> (OSD/JMACA) -->
>
> <!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)-->
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
>
> <xs:element name="AreaOfOperationsCommand">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="OperationalCommand" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="Datasource">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="Parameter" minOccurs="0" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="ForceOrganization">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="Service" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="OperationalCommand">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="OperationalUnit" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="OperationalElement">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="Datasource" minOccurs="0" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> <xs:attribute name="uic" type="xs:string" use="required"/>
>
> <xs:attribute name="selected" type="xs:string" use="required"/>
>
> <xs:attribute name="default_datasource" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="OperationalUnit">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="OperationalElement" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="Parameter">
>
> <xs:complexType>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> <xs:attribute name="value" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="Service">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element ref="ServiceCommand" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="ServiceCommand">
>
> <xs:complexType>
>
> <xs:choice>
>
> <xs:element ref="AreaOfOperationsCommand" maxOccurs="unbounded"/>
>
> <xs:element ref="OperationalElement" maxOccurs="unbounded"/>
>
> </xs:choice>
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:schema>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Is it possible to edit an EMF model with two different editors? [message #384149 is a reply to message #384142] Mon, 26 April 2004 19:10 Go to previous messageGo to next message
Charles Fulnecky is currently offline Charles FulneckyFriend
Messages: 81
Registered: July 2009
Member
Thanks for the quick reply Ed!

Not showing children was indeed easy, the difficulty for me was still being
able to edit the children as nested elements in the properties window.
Since I could have two datasources beneath an operational element, only the
first one would show, and since each datasource can have it's own parameter
children(a name/value pair) I was unsure how to get the nested children to
appear and after reading
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg0 3243.html I
decided to try using multiple editors.

As you stated "Open With" allows me to open with the editor of choice,
however there seems to be some conflict between the editors, since they both
work individually (loaded into plugin registry in runtime workspace) however
when both plugins are loaded into the runtime workspace I get the display
shown in the attached gif.

I wonder if the conflict is due to the manifest files?

Editor 1:
<extension point="org.eclipse.emf.ecore.extension_parser">

<parser

type="forceorganization" <!-- was forceorganizationadmin based on name of
xsd used to generate editor -->

class="forceOrganization.util.ForceOrganizationResourceFactoryImpl " />

</extension>



Editor 2:

<extension point="org.eclipse.emf.ecore.extension_parser">

<parser

type="forceorganization"

class=" forceOrganizationAdmin.util.ForceOrganizationAdminResourceFa ctoryImpl
" />

</extension>

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:408D1BBB.C23F9F4C@ca.ibm.com...
> Charles,
>
> Not showing children past a certain level should be easy. What's the
problem
> with doing that? It's also possible to have multiple editors for the same
> extension; you just need to do "Open With" to choose....
>
>


Re: Is it possible to edit an EMF model with two different editors? [message #384150 is a reply to message #384149] Mon, 26 April 2004 19:22 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Charles,

You cannot globally register two different parsers for the same extension. Have
a look at the Ecore editor plugin.xml and the classes in that plugin to see how
a single editor can be reused to behave like multiple different editors.


Charles Fulnecky wrote:

> Thanks for the quick reply Ed!
>
> Not showing children was indeed easy, the difficulty for me was still being
> able to edit the children as nested elements in the properties window.
> Since I could have two datasources beneath an operational element, only the
> first one would show, and since each datasource can have it's own parameter
> children(a name/value pair) I was unsure how to get the nested children to
> appear and after reading
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg0 3243.html I
> decided to try using multiple editors.
>
> As you stated "Open With" allows me to open with the editor of choice,
> however there seems to be some conflict between the editors, since they both
> work individually (loaded into plugin registry in runtime workspace) however
> when both plugins are loaded into the runtime workspace I get the display
> shown in the attached gif.
>
> I wonder if the conflict is due to the manifest files?
>
> Editor 1:
> <extension point="org.eclipse.emf.ecore.extension_parser">
>
> <parser
>
> type="forceorganization" <!-- was forceorganizationadmin based on name of
> xsd used to generate editor -->
>
> class="forceOrganization.util.ForceOrganizationResourceFactoryImpl " />
>
> </extension>
>
> Editor 2:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
>
> <parser
>
> type="forceorganization"
>
> class=" forceOrganizationAdmin.util.ForceOrganizationAdminResourceFa ctoryImpl
> " />
>
> </extension>
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:408D1BBB.C23F9F4C@ca.ibm.com...
> > Charles,
> >
> > Not showing children past a certain level should be easy. What's the
> problem
> > with doing that? It's also possible to have multiple editors for the same
> > extension; you just need to do "Open With" to choose....
> >
> >
>
> [Image]


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:a reference is being deleted?
Next Topic:substitution groups in generated editors
Goto Forum:
  


Current Time: Thu Apr 25 21:27:25 GMT 2024

Powered by FUDForum. Page generated in 0.02872 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top