if (toolbarAction != null) {
ButtonAction action = null;
if (toolbarAction instanceof ToolbarAction) {
action = new ToolbarButtonAction((ToolbarAction) toolbarAction);
} else if (toolbarAction instanceof ToolbarModalAction) {
action = new ToolbarRadioAction((ToolbarModalAction) toolbarAction, "map-controller-group");
}
if (action != null) {
for (Parameter parameter : tool.getParameters()) {
action.configure(parameter.getName(), parameter.getValue());
}