Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] activating a tool without having it in the toolbar

I want to activate a tool (e.g. the PolygonTool) without having it in the toolbar. In my plugin.xml I declare the modal tool with all its attributes like categoryId, class,... and _onToolbar_="false". Which works: It is not on the toolbar.
 
In my code I activate this tool programatically this way:
IAction tool = ApplicationGIS.getToolManager().getTool("...","..."); // toolID and categroyID
tool.run();
 
the good fact: The tool is activated and I can draw the polygon on the map.
but: The tool appears in the toolbar in its category. It is the the activated tool (so one can see it) but not in the list which opens clicking the little arrow. Which means that using another tool of this category lets the tool disappear again. Using a tool of another category will deactivate the tool but it's still visible and selectable.
 
How can I prevent this behaviour?
Is there another way to activate a tool?
 
(background:
To many tools in the toolbar will confuse some of my users. Therefore the tools shall be activated out of some workflow components like special view parts, dialogs, ...
Only some general actions like zoom or pan have to be selectable via the toolbar.)
 
thanks again,
tony roth

Back to the top