Auto-generating tool commands. [message #212331] |
Thu, 27 November 2008 14:28 |
Christophe Bouhier 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 #218990 is a reply to message #212397] |
Mon, 16 February 2009 16:34 |
Christophe Bouhier 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 |
Christophe Bouhier 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
>>>
>>>
|
|
|
Powered by
FUDForum. Page generated in 0.02198 seconds