public ToolButtonSample() {
HorizontalPanel buttons = new HorizontalPanel();
ToolButton button = new ToolButton(WidgetImages.Instance.get().icon_Printer().createImage());
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showMessage("Print...");
}
});
buttons.add(button);
addGap(buttons, "10px");
button = new ToolButton(WidgetImages.Instance.get().icon_Printer().createImage());
button.setTitle("Disabled");
button.setEnabled(false);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showMessage("Should not show this message");
}
});
buttons.add(button);