Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to link a contentType to an existing editor?
How to link a contentType to an existing editor? [message #439875] Fri, 31 July 2009 06:50 Go to next message
Eclipse User
Originally posted by: loic.fejoz.realtimeatwork.com

Hello,

I got a simple problem about content type. Just imagine I would like to
add a new serialization type for Ecore, let's say HUTN [1]. I know how
to declare a new type content in a plugin. I know how to create a
content parser.

But, HUTN is a textual file format which is not xml. Thus the declared
HUTN content type inherit from org.eclipse.core.runtime.text and not
org.eclipse.emf.ecore (or emof).

The problem is that, now, none of the ecore editor are available even if
the content parser return an EPackage object.

I have try to declare an editor with same ID as the ecore editor with a
contentTypeBinding, but it does not appear properly as such in the gui.
Indeed the menu entry loss the icon and the translated label. This is
because the attribute name is mandatory for an editor in the plugin.xml.
Thus so far it is the best option. But still you need to do that for
every known editor.

Is there an extension to add contentTypeBinding to editor declared in
other plugins?
Is that the correct way to go?

More globally, it appears that there should be 2 hierarchies, one for
content types, one for models...

PS : I have post the same question on eclipse.tools.emf, but maybe you
will have other ideas...

--
Loïc Fejoz

[1] Human-Usable Textual Notation
<http://www.omg.org/technology/documents/formal/hutn.htm>
Re: How to link a contentType to an existing editor? [message #468117 is a reply to message #439875] Tue, 04 August 2009 08:51 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Loïc Fejoz wrote:
> Hello,
>
> I got a simple problem about content type. Just imagine I would like
> to add a new serialization type for Ecore, let's say HUTN [1]. I know
> how to declare a new type content in a plugin. I know how to create a
> content parser.
>
> But, HUTN is a textual file format which is not xml. Thus the declared
> HUTN content type inherit from org.eclipse.core.runtime.text and not
> org.eclipse.emf.ecore (or emof).
>
> The problem is that, now, none of the ecore editor are available even
> if the content parser return an EPackage object.
>
> I have try to declare an editor with same ID as the ecore editor with
> a contentTypeBinding, but it does not appear properly as such in the gui.
> Indeed the menu entry loss the icon and the translated label. This is
> because the attribute name is mandatory for an editor in the plugin.xml.
> Thus so far it is the best option. But still you need to do that for
> every known editor.

> Is there an extension to add contentTypeBinding to editor declared in
> other plugins?
No.
> Is that the correct way to go?
Yes, but unfortunately this means to copy the strings and icons and
sometimes referring to an internal class.

Dani
>
> More globally, it appears that there should be 2 hierarchies, one for
> content types, one for models...
>
> PS : I have post the same question on eclipse.tools.emf, but maybe you
> will have other ideas...
>
Re: How to link a contentType to an existing editor? [message #479710 is a reply to message #468117] Wed, 12 August 2009 07:09 Go to previous messageGo to next message
Eclipse User
Originally posted by: loic.fejoz.realtimeatwork.com

Thank you.

--
Loïc Fejoz

Daniel Megert a écrit :
> Loïc Fejoz wrote:
>> Hello,
>>
>> I got a simple problem about content type. Just imagine I would like
>> to add a new serialization type for Ecore, let's say HUTN [1]. I know
>> how to declare a new type content in a plugin. I know how to create a
>> content parser.
>>
>> But, HUTN is a textual file format which is not xml. Thus the declared
>> HUTN content type inherit from org.eclipse.core.runtime.text and not
>> org.eclipse.emf.ecore (or emof).
>>
>> The problem is that, now, none of the ecore editor are available even
>> if the content parser return an EPackage object.
>>
>> I have try to declare an editor with same ID as the ecore editor with
>> a contentTypeBinding, but it does not appear properly as such in the gui.
>> Indeed the menu entry loss the icon and the translated label. This is
>> because the attribute name is mandatory for an editor in the plugin.xml.
>> Thus so far it is the best option. But still you need to do that for
>> every known editor.
>
>> Is there an extension to add contentTypeBinding to editor declared in
>> other plugins?
> No.
>> Is that the correct way to go?
> Yes, but unfortunately this means to copy the strings and icons and
> sometimes referring to an internal class.
>
> Dani
>>
>> More globally, it appears that there should be 2 hierarchies, one for
>> content types, one for models...
>>
>> PS : I have post the same question on eclipse.tools.emf, but maybe you
>> will have other ideas...
>>
Re: How to link a contentType to an existing editor? [message #480269 is a reply to message #479710] Fri, 14 August 2009 15:33 Go to previous message
Alessandro Carraro is currently offline Alessandro Carraro
Messages: 27
Registered: July 2009
Junior Member
Loïc Fejoz ha scritto:
> Thank you.
>

I know it is OT (it has nothing to do with your question), but have you
ever considered doing your project with XText? It looks like the best fit...
Previous Topic:switching perspective doesn't seem to restore selection variable in Eclipse 3.5
Next Topic:own update site: "software install" not showing features / website does ... ?
Goto Forum:
  


Current Time: Mon Oct 20 22:44:19 GMT 2014

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

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