This is on the list of features for 1.1 but for 1.0.x you will have to do some hacking.
(This is pseudocode so it will take some tweaking)
1. Define your tool as not on Toolbar. This will allow you tool get the ToolProxy from the ToolManager but it won't be on the toolbar. 2. When you want to add the tool you have to get the ToolManager: ProjectUIPlugin.getDefault().getToolManager.getTool(). This returns an action you can add to the Toolbar. 3. Add the tool to the toolbar by getting the MapEditor's EditorSite.getActionBars().getCoolbar().add(tool). 4. The MapEditor editor site can be obtained by: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite() (Assuming the editor is the active editor).

Hope this helps. Jesse


Vincent Nouguier wrote:

Hello all,

I would like to add new tool buttons in the toolbar at runtime. The addition of the button is started by an external event. This event contains information for the GUI (an icon and a label) and information about what has to be done when the button is pressed. I don't know at startup how many buttons (and when) have to be integrated.

Is there a way to integrate tools during execution ?

Thanks in advance,

Vincent
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to