Hi
I am trying to write a plugin on top of the BPMN Project Feature plugin, and I have a requirement to remove the unwanted palette entries from the Palette.
I tried to find information on the below link,
wiki.eclipse.org/STP/BPMN_Component/Developing_with_the_STP_BPMN_modeler#Hiding_elements_of_the_palette
But couldn't find enough information.
I tried the following - Extending the BpmnPaletteProvider class so that I can override the method contributeToPalette.
public class PWDesignerEditor extends BpmnPaletteProvider {
public void contributeToPalette(IEditorPart editor, Object content,
PaletteRoot root, Map predefinedEntries) {
//this is the short way
super.contributeToPalette(editor, content, root, predefinedEntries);
((PaletteContainer) root.getChildren().get(1)).getChildren().remove(0);
//the long way consists in populating the palette with your own factory.
}
}
and I was able to add code in the other class which tries to hide the palette entries,
PWDesignerEditor pwde = new PWDesignerEditor();
IWorkbenchPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
PaletteRoot root = null;
Object content = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getClass();
Map predefinedEntries;
pwde.contributeToPalette((IEditorPart) editor, content, root, predefinedEntries);
I am uncertain which is the values I should pass. Where I can get the palette root, object, predefindedEntries etc.
Kindly let me know how I can achieve the above result.
Thanks in advance