Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » ParserProvider - any examples ?
ParserProvider - any examples ? [message #134948] Tue, 12 June 2007 06:48 Go to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hello all,

We are working on a product with multiple GMF diagrams.
I noticed that all the providers (icon, editPart, parser) were getting
called for each diagram type
when opening all diagrams.


I was able to fix this for icon and editPart using object and context
properties.
However the parser is not as clear.
Also I can't find any examples of its use except in the simple cases.
I have tried geoshapes, logic etc

Has anybody done this or possibly be able to point me to a good example ?

Thanks.
Re: ParserProvider - any examples ? [message #135269 is a reply to message #134948] Tue, 12 June 2007 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Alan wrote:
> Hello all,
>
> We are working on a product with multiple GMF diagrams.
> I noticed that all the providers (icon, editPart, parser) were getting
> called for each diagram type
> when opening all diagrams.
>
>
> I was able to fix this for icon and editPart using object and context
> properties.
> However the parser is not as clear.
> Also I can't find any examples of its use except in the simple cases.
> I have tried geoshapes, logic etc
>
> Has anybody done this or possibly be able to point me to a good example ?
>
> Thanks.
>
>

Hello Alan
In my current project I override the generated ParserProvider to be able to parse several labels. I had to do this
because the features associated with the labels are not trivial, so I have to call some external parser service to cope
with user input and then set the resulting complex object in the model.

From your post it is not clear what exactly you wanna know or what your problem with ParserProvider is, so I'll just
explain what I understand of the mechanics and hope it helps...

For every label in your mapping, code is generated to be able to format/parse the labels text. What kind of parser this
is, depends on the label properties you set in the mapping. The default is a MessageFormatParser, where you may specify
some pattern to build the displayed string using the features. These properties show up for feature labels, but not for
simple labels, but the ParserProvider generates these parser mappings none the less.

htah
Norbert Schöpke
Re: ParserProvider - any examples ? [message #135748 is a reply to message #134948] Wed, 13 June 2007 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Alan,

My understanding is that you are trying to avoid the other GMF diagram
parser providers from being called thus causing their plugins to load.

The parser provider extension point is somewhat different than the other
provider extension points you mentioned. You need to specify an
IProviderPolicy class in your extension point in your plugin.xml file.
The policy class determines if your plugin should be loaded or not.

There is a JUnit that tests this in GMF which you could use as an
example (it doesn't look like we have any other examples of this).

The extension point in the plugin.xml file of plugin
org.eclipse.gmf.tests.runtime.common.ui.services.provider contains:

<extension
id="parserProviders"
name="%ext.parserProviders"

point="org.eclipse.gmf.runtime.common.ui.services.parserProviders ">

<ParserProvider

class=" org.eclipse.gmf.tests.runtime.common.ui.services.provider.in ternal.providers.TestParserProvider ">
<Priority name="Highest"/>
<Policy
class=" org.eclipse.gmf.tests.runtime.common.ui.services.provider.in ternal.policies.TestParserPolicy "/>
</ParserProvider>

</extension>

Take a look at the documentation of IParserProvider class as it has a
bit of an explanation there.

Also, you need to make sure that your policy provider class doesn't
trigger the plugin to load.

By the way, there is a bugzilla currently open so that generated GMF
diagram editor plugins will not always load. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=191488

I hope this helps.

- Cherie

Alan wrote:
> Hello all,
>
> We are working on a product with multiple GMF diagrams.
> I noticed that all the providers (icon, editPart, parser) were getting
> called for each diagram type
> when opening all diagrams.
>
>
> I was able to fix this for icon and editPart using object and context
> properties.
> However the parser is not as clear.
> Also I can't find any examples of its use except in the simple cases.
> I have tried geoshapes, logic etc
>
> Has anybody done this or possibly be able to point me to a good example ?
>
> Thanks.
>
>
Re: ParserProvider - any examples ? [message #136081 is a reply to message #134948] Thu, 14 June 2007 10:32 Go to previous message
Eclipse UserFriend
Hi Alan,

Check out https://bugs.eclipse.org/bugs/show_bug.cgi?id=191488

Cheers...
Anthony

"Alan" <awm_abu@yahoo.com> wrote in message
news:f4ltmd$sba$1@build.eclipse.org...
> Hello all,
>
> We are working on a product with multiple GMF diagrams.
> I noticed that all the providers (icon, editPart, parser) were getting
> called for each diagram type
> when opening all diagrams.
>
>
> I was able to fix this for icon and editPart using object and context
> properties.
> However the parser is not as clear.
> Also I can't find any examples of its use except in the simple cases.
> I have tried geoshapes, logic etc
>
> Has anybody done this or possibly be able to point me to a good example ?
>
> Thanks.
>
Previous Topic:Graphical Editing Framework (GEF) Directed Graph Example (Digraph1)
Next Topic:Labels for connections are missing with RC2
Goto Forum:
  


Current Time: Wed Jul 23 08:09:57 EDT 2025

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

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

Back to the top