Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Auto-generating tool commands.
Auto-generating tool commands. [message #212331] Thu, 27 November 2008 14:28 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,
Here is a question from a newby on GMF. First, thanks to the
contributors, for an amazing tool.

I followed the tutorial with good success, and it seems my applications
is creating itself in front of me. Now of course there are always
special requirements, and here is mine:

What I would like to do is generate tool commands, based on what is
already in my model. So for example if I have a domain model "cars", I
would like to auto-generate tools for "Create mazda" and "Create BMW",
if instances of these cars exist.

One way to do this (thinking out loud) , is to generate the tools
commands, when opening the model. Is there something in the framework to
avoid custom code?

Thank you, Christophe Bouhier
Re: Auto-generating tool commands. [message #212391 is a reply to message #212331] Fri, 28 November 2008 10:58 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Christophe,

This use case is not covered with current code generators. So, you have to
create a custom code for it. I think you can start with contributing your
own creation tools via PaletteService.

-----------------
Alex Shatalin
Re: Auto-generating tool commands. [message #212397 is a reply to message #212391] Fri, 28 November 2008 12:55 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Thank you for confirming.

I haven't used any of the GMF services, but from what I understand this
is a plugin extension. If this is the case, how do I generate this from
runtime (As I need access to the model first). Sorry might be a stupid
question as I am not to familiar with the GMF services.. (Or actually
this is more an RCP/plugin question perhaps).

rgds, Christophe

Alex Shatalin wrote:
> Hello Christophe,
>
> This use case is not covered with current code generators. So, you have
> to create a custom code for it. I think you can start with contributing
> your own creation tools via PaletteService.
>
> -----------------
> Alex Shatalin
>
>
Re: Auto-generating tool commands. [message #212401 is a reply to message #212397] Fri, 28 November 2008 15:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Christophe,

> this is a plugin extension. If this is the case, how do I generate
Yes, you are right - this is an extension.

> this from runtime (As I need access to the model first). Sorry might
I think you should generate diagram editor for your model first and then
create one more plugin having dependency on diagram editor plugin, model
one and some other plugins from GMF runtime. Then you'll be able to create
IPaletteProvider implementation covering your use cases (use AbstractProvider
as a superclass for it).

-----------------
Alex Shatalin
Re: Auto-generating tool commands. [message #218990 is a reply to message #212397] Mon, 16 February 2009 16:34 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Alex,

On the topic below discussed earlier.

I want to add some data in a Tool, which can be passed along when the
semantic model element is created. (In a EditorHelper).

As a tool, is initially defined as a UnspecifiedTypeCreationTool(),
I wonder if somehow, I can set and pickup this data set in a ToolEntry,
in a Edit Helper.

So:

MyCustomPaletteFactory -> ToolEntry -> ? -> xEditHelper -> myData?
(myData)

Thank You, Christophe





Christophe Bouhier wrote:
> Thank you for confirming.
>
> I haven't used any of the GMF services, but from what I understand this
> is a plugin extension. If this is the case, how do I generate this from
> runtime (As I need access to the model first). Sorry might be a stupid
> question as I am not to familiar with the GMF services.. (Or actually
> this is more an RCP/plugin question perhaps).
>
> rgds, Christophe
>
> Alex Shatalin wrote:
>> Hello Christophe,
>>
>> This use case is not covered with current code generators. So, you
>> have to create a custom code for it. I think you can start with
>> contributing your own creation tools via PaletteService.
>>
>> -----------------
>> Alex Shatalin
>>
>>
Re: Auto-generating tool commands (solved) [message #219052 is a reply to message #218990] Tue, 17 February 2009 08:37 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

I solved my problem, by extending the UnspecifiedTypeCreationTool class
and storing a parameter in the ExtendedData of the Request.
I can then pickup my parameter, using req.getParameters().

rgds Christophe


Christophe Bouhier wrote:
> Hi Alex,
>
> On the topic below discussed earlier.
>
> I want to add some data in a Tool, which can be passed along when the
> semantic model element is created. (In a EditorHelper).
>
> As a tool, is initially defined as a UnspecifiedTypeCreationTool(),
> I wonder if somehow, I can set and pickup this data set in a ToolEntry,
> in a Edit Helper.
>
> So:
>
> MyCustomPaletteFactory -> ToolEntry -> ? -> xEditHelper -> myData?
> (myData)
>
> Thank You, Christophe
>
>
>
>
>
> Christophe Bouhier wrote:
>> Thank you for confirming.
>>
>> I haven't used any of the GMF services, but from what I understand
>> this is a plugin extension. If this is the case, how do I generate
>> this from runtime (As I need access to the model first). Sorry might
>> be a stupid question as I am not to familiar with the GMF services..
>> (Or actually this is more an RCP/plugin question perhaps).
>>
>> rgds, Christophe
>>
>> Alex Shatalin wrote:
>>> Hello Christophe,
>>>
>>> This use case is not covered with current code generators. So, you
>>> have to create a custom code for it. I think you can start with
>>> contributing your own creation tools via PaletteService.
>>>
>>> -----------------
>>> Alex Shatalin
>>>
>>>
Previous Topic:default font
Next Topic:Can 2.2.0M5a be installed with eclipse 3.5M5?
Goto Forum:
  


Current Time: Thu Apr 18 17:23:21 GMT 2024

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

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

Back to the top