* @param command the command type for the toolbar button
* @return a toolbar button
*/
private Widget buildButton(AbstractImagePrototype icon, String title, boolean isToggle, final Command command){
if(isToggle){
final ToggleButton btn = new ToggleButton(icon.createImage());
btn.setTitle(title);
btn.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
btn.setFocus(false);
btn.removeStyleName("gwt-ToggleButton-up-hovering");
CommandEvent.fire(command);
}
});
buttons.add(btn);
return btn;
}else{
final PushButton btn = new PushButton(icon.createImage());
btn.setTitle(title);
btn.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
btn.setFocus(false);
btn.removeStyleName("gwt-PushButton-up-hovering");
CommandEvent.fire(command);
}
});
buttons.add(btn);
return btn;