});
buttons.add(button);
addGap(buttons, "10px");
final ToggleToolButton tb1 = new ToggleToolButton(WidgetImages.Instance.get().icon_CubeGreen().createImage());
tb1.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
showMessage("Green Cube " + (tb1.isDown() ? "DOWN" : "UP"));
}
});
buttons.add(tb1);
addGap(buttons, "30px");
buttons.add(new Label("Grouping:"));
addGap(buttons, "5px");
final ToggleToolButton tb2 = new ToggleToolButton(WidgetImages.Instance.get().icon_CubeGreen().createImage());
tb2.setGroup("group");
tb2.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
showMessage("Green Cube " + (tb2.isDown() ? "DOWN" : "UP"));
}
});
buttons.add(tb2);
addGap(buttons, "10px");
final ToggleToolButton tb3 = new ToggleToolButton(WidgetImages.Instance.get().icon_CubeBlue().createImage());
tb3.setGroup("group");
tb3.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
showMessage("Blue Cube " + (tb3.isDown() ? "DOWN" : "UP"));
}
});
buttons.add(tb3);
VerticalPanel main = new VerticalPanel();