[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: How do I add/remove tools on the palette dynamically?

Viktor Kazakov wrote:
after you delete the creation tools from your tooling file, try recreating your gmfmap (you can delete the old gmfmap) file then create your gmfgen (you can also delete the old gmfgen) file then create ur diagrams code all over again , and also make sure to remove the "Not" from any "@generated Not" annotations, if you added any in the old diagram
I don't feel like loosing my work in .gmfmap file. Maybe there is another way?

Samer alameer ÐÐÑÐÑ:
Viktor Kazakov wrote:
Yep, that's cool, but how to remove the icons from the palette? I've tried removing all the creation tools from the Tooling Model and regenerated the project, but still I have the entries in the palette.

I think it's about the Tooling Model, but maybe some additional actions are required...

Sorry to interfere...

Viktor Kazakov

Samer alameer ÐÐÑÐÑ:
Petcharat Viriyakattiyaporn wrote:
Hi,

I would like to add/remove tools on the tool palette dynamically, depending on the element selected on the diagram. Which part of my GMF editor should I modify? Is there a tutorial about this? If so, could you tell me where can I find it?

Thanks a lot.
Petcharat


hello there

i had a similar problem to yours were i wanted to disable creating a shape from the palette. to do this go to ur diagram plugins code then go to yourPluginName.diagram.edit.commands -> then go to yourShapesNameCreateCommand.java class -> canExecute() methodand make it return false when ever you don't want it to work, this also applies to all other commands, i know u can still click on it's icon in the palette but you can prevent it from doin anything.

hope this will help.

Samer Alameer



hey Viktor

after you delete the creation tools from your tooling file, try recreating your gmfmap (you can delete the old gmfmap) file then create your gmfgen (you can also delete the old gmfgen) file then create ur diagrams code all over again , and also make sure to remove the "Not" from any "@generated Not" annotations, if you added any in the old diagram

Samer AlAmeer

hi again

you dont have to lose your work victor, the .gmfmap is an xml file, so what you can do is to keep a copy of your old file, recreate it then open both the new and the old file and copy and paste what ever you need but you have to be careful with where you place the text or else the file will be corrupted and you might not be able to open it in the editor.

hope this will help


Samer AlAmeer