Hi,
I would like to extend the palette. By Example I have a node named "composite". Then I will add a node named "custom_composite". The "custom_composite" is a "composite" with defined attributes (dynamic loaded).
I have two plugins. The first plugin is the generated code and the other is a custom plugin with "org.eclipse.gmf.runtime.diagram.ui.paletteProviders" extension point.
In my "public class CustomPaletteProvider implements IPaletteProvider" I added "custom_composite" entry like the generated code with:
types.add(ElementTypeRegistry.getInstance().getType("id"));
types.add(XsradElementTypes.Composite_2001);
In the constructor of my "CustomPaletteProvider" class I register:
IElementType elementType = XsradElementTypes.Composite_2001;
IElementType[] toSpecialize = new IElementType[1];
toSpecialize[0] = elementType;
CustomElementMatcher matcher = new CustomElementMatcher();
CustomContainerDescriptor descriptor = new CustomContainerDescriptor();
ISpecializationType specializedType = new SpecializationType("id", null, "name", toSpecialize, matcher, descriptor, new CustomFileHelperAdvice());
ElementTypeRegistry.getInstance().register(specializedType);
ClientContextManager.getInstance().getBinding(XsradElementTypes.Composite_2001).bindId("id");
My hope is that the "CustomFileHelperAdvice()" e.g. "protected ICommand getBeforeConfigureCommand(ConfigureRequest request)" execute when I drop my "custom_composite" entry on the diagram. But it doesn`t work!
What must I implement in "CustomElementMatcher implements IElementMatcher" and
"CustomContainerDescriptor implements IContainerDescriptor" ?
Make I wrong assumptions about the "AbstractEditHelperAdvice"?
Questions over questions (;
Is there a easy way to gain this functionality?
Thanks a lot!