Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BPMN Modeler » Removing a palette entry from Palette?(how to remove a palette entry from Palette)
icon4.gif  Removing a palette entry from Palette? [message #755913] Thu, 10 November 2011 07:49
Sathish Kumar Subramanian is currently offline Sathish Kumar SubramanianFriend
Messages: 3
Registered: January 2011
Junior Member
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
Previous Topic:Listening to changes in the BPMN Diagram
Next Topic:[ANN] New BPMN Visual design tool is available
Goto Forum:
  


Current Time: Tue Mar 19 11:35:21 GMT 2024

Powered by FUDForum. Page generated in 0.01215 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top