Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/894555/#msg_894555
I have just started to play with GMF framework and I have few questions:

I have created a dummy plugin that has several elements in tools palette and they can be added into graphical diagram and linked together with connection element from tools palette. All this was generated by using eclipse GMF plugin.

As I see, all elements types and element types binding are listed in generated plugin.xml under:
org.eclipse.gmf.runtime.emf.type.core.elementTypes
and
org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings
Additionally, modelling assistant provider is registered in org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders extension point
and view provider is registered under:
org.eclipse.gmf.runtime.diagram.core.viewProviders

My question would be:
Is it possible to add new elements directly from Java code without using data information from plugin.xml?
To be more clear:
How can I add new element type to org.eclipse.gmf.runtime.emf.type.core.elementTypes from Java?
How can I add new element type binding to org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings from Java?
How can I add EditPart implementation for that new element to registered modelling assistant from Java?
How can I add semantic hint for newly created element into registered view provider from Java?

Ralph]]>Ralph Gerbig2012-07-10T08:15:13-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/894810/#msg_894810
What I'm trying to do is that I have added a new element into Tools palette by modifying generated TestPaletteFactory class. Now, when I run plugin, I can see that newly created element in Tools palette but I can't add it to diagram. The question is how can I make it work without touching plugin.xml file.

I will take a look at your suggested CreateUnspecifiedTypeRequest but in case you have additional information to the problem I have then I would be grateful to know that.]]>Tomas T2012-07-10T15:35:22-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/894946/#msg_894946
what is your use case for manually editing generated code? Maybe there is a more efficient way to solve your problem.

Ralph]]>Ralph Gerbig2012-07-11T08:23:40-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/895073/#msg_895073
Allow users create custom elements in the diagram using wizard. So in the beginning user has a basic set of available elements but I would like to allow them creating their own custom elements. From the GUI point of view, user will be asked to specify name of the new element, icons and maybe some additional information and after that plugin will generate some jar file (still not decided) that will be added into plugin directory. After eclipse restart, user will be able to use that new element in the diagram. The place I'm analyzing now is where I should change the code in order to read that information from generated jar files and how should I add new elements into diagram on plugin startup. Of course, after that it should be possible to link predefined elements with new ones.
]]>Tomas T2012-07-11T15:30:49-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/895300/#msg_895300
if I am right you are interested in such a thing? http://code.google.com/a/eclipselabs.org/p/melanie/wiki/FirstSteps#Create_Domain-specific_Language

Ralph]]>Ralph Gerbig2012-07-12T12:06:34-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/896091/#msg_896091
I was away for one week and only today found time to check your provided link. After checking that video I can tell that it's not what I'm looking for. I want to create a much more simple plugin.
As shown in the picture:
http:// www.javaexpress.pl /static/images/JeP_04_2009_06_GMF_6.png
There are 3 elements in the tools palette:
1) manager
2) Developer
3) Manager managed developers (connection)

So I would like to add for example "Tester" element into tools palette in runtime using some wizard. After that I will have 4 elements in the palette:
1) manager
2) Developer
3) Manager managed developers (connection)
4) Tester

The question is how to achieve this?]]>Tomas T2012-07-17T08:52:54-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/896180/#msg_896180
I think the first thing to ask is how you would like to have tester represented in your meta-model? It sounds to me that you are speaking of extending the meta-model at runtime and create an editor for this. Is this right?

Ralph]]>Ralph Gerbig2012-07-17T13:59:11-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/896902/#msg_896902
So from my point of view it's possible to work around without extending meta-model in the runtime and reuse existing. ]]>Tomas T2012-07-20T11:12:42-00:00Re: Tools Palette elements directly from Javahttps://www.eclipse.org/forums/index.php/mv/msg/367192/896904/#msg_896904
ok that is very close to what I do in my modeling environment. However I distinct between a ontological and linguistic type. From the linguistic point of view which is implemented in EMF everything is of instance of meta-class clabject everything else is done by code.

What I could remcoment you is to create a model for configuration. Out of this model you dynamically manipulate the palete.

Take a look at the manage palate method in this template which shows how to manipulate the palette by code: