Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to link a contentType to an existing editor?
How to link a contentType to an existing editor? [message #431910] Wed, 29 July 2009 09:04 Go to next message
Eclipse UserFriend
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.

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...

--
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 #431923 is a reply to message #431910] Wed, 29 July 2009 16:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Loïc,

Comments below.

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 think the user can still associate the content type with the editor in
the preferences though...
>
> 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.
I think that should work too...
>
> Is there an extension to add contentTypeBinding to editor declared in
> other plugins?
I don't think so.
> Is that the correct way to go?
This issue has come up with Emfatic as well. Even if the editor
supports it, the import wizards don't let you choose files with
unexpected extensions...
>
> More globally, it appears that there should be 2 hierarchies, one for
> content types, one for models...
Have you tried configuring it just using preferences?
Re: How to link a contentType to an existing editor? [message #431936 is a reply to message #431923] Thu, 30 July 2009 06:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: loic.fejoz.realtimeatwork.com

Hi,

Thanks for your comments

Ed Merks a écrit :
> Loïc,
>
> Comments below.
>
> Loïc Fejoz wrote:
>> [...]
>> 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 think the user can still associate the content type with the editor in
> the preferences though...

Probably, but I would like to distribute it as a plugin. thus it should
work out-of-the-box...

>> 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.
> I think that should work too...

Yes but the menu entry loss the icon and the translated label. Indeed
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?
> I don't think so.

:-(

>> Is that the correct way to go?
> This issue has come up with Emfatic as well. Even if the editor
> supports it, the import wizards don't let you choose files with
> unexpected extensions...
>>
>> More globally, it appears that there should be 2 hierarchies, one for
>> content types, one for models...
>
> Have you tried configuring it just using preferences?

Nop. As I said previously, I was imagining a plugin thus the user should
not have anything special to do, or am I missing something in the
preferences?

--
Regards,
Loïc Fejoz
Re: How to link a contentType to an existing editor? [message #431951 is a reply to message #431936] Thu, 30 July 2009 14:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30687
Registered: July 2009
Senior Member
Loïc,

Comments below.

Loïc Fejoz wrote:
> Hi,
>
> Thanks for your comments
>
> Ed Merks a écrit :
>> Loïc,
>>
>> Comments below.
>>
>> Loïc Fejoz wrote:
>>> [...]
>>> 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 think the user can still associate the content type with the editor
>> in the preferences though...
>
> Probably, but I would like to distribute it as a plugin. thus it
> should work out-of-the-box...
I'm not sure if there is a plugin registration way to do it. But that's
not really an EMF question...
>
>>> 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.
>> I think that should work too...
>
> Yes but the menu entry loss the icon and the translated label. Indeed
> 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.
Yes, I think you have to have those locally...
>
>>> Is there an extension to add contentTypeBinding to editor declared
>>> in other plugins?
>> I don't think so.
>
> :-(
>
>>> Is that the correct way to go?
>> This issue has come up with Emfatic as well. Even if the editor
>> supports it, the import wizards don't let you choose files with
>> unexpected extensions...
>>>
>>> More globally, it appears that there should be 2 hierarchies, one
>>> for content types, one for models...
> >
>> Have you tried configuring it just using preferences?
>
> Nop. As I said previously, I was imagining a plugin thus the user
> should not have anything special to do, or am I missing something in
> the preferences?
No, but maybe what's possible with preferences is possible in some other
way. You might try asking about that on the platform newsgroup...
Re: How to link a contentType to an existing editor? [message #439666 is a reply to message #431951] Fri, 31 July 2009 06:46 Go to previous message
Eclipse UserFriend
Originally posted by: loic.fejoz.realtimeatwork.com

Hi,

thanks for your help. I will try on eclipse.platform.

--
regards,
Loïc Fejoz

Ed Merks a écrit :
> Loïc,
>
> Comments below.
>
> Loïc Fejoz wrote:
>> Hi,
>>
>> Thanks for your comments
>>
>> Ed Merks a écrit :
>>> Loïc,
>>>
>>> Comments below.
>>>
>>> Loïc Fejoz wrote:
>>>> [...]
>>> Have you tried configuring it just using preferences?
>>
>> Nop. As I said previously, I was imagining a plugin thus the user
>> should not have anything special to do, or am I missing something in
>> the preferences?
> No, but maybe what's possible with preferences is possible in some other
> way. You might try asking about that on the platform newsgroup...
Previous Topic:[transaction] multi-threaded access to emf presentation model
Next Topic:A proposal for improving the WorkspaceSynchronizer.
Goto Forum:
  


Current Time: Tue Dec 10 08:01:02 GMT 2019

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

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

Back to the top