addClickListener(listener);
}
+ /**
+ * Creates a new push button with a click listener.
+ *
+ * @param icon
+ * the Button icon.
+ * @param listener
+ * the Button click listener.
+ * @since 8.2
+ */
+ public Button(Resource icon, ClickListener listener) {
+ setIcon(icon);
+ addClickListener(listener);
+ }
+
/**
* Click event. This event is thrown, when the button is clicked.
*
delay.setValue("1000");
group.addComponent(delay);
- Button clear = new Button(null, new ClickListener() {
+ Button clear = new Button("", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
delay.setValue("");
pos.addStyleName(ValoTheme.BUTTON_SMALL);
grid.addComponent(pos);
- pos = new Button("", new ClickListener() {
+ pos = new Button(ValoTheme.BUTTON_SMALL, new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
notification.setPosition(Position.MIDDLE_RIGHT);
notification.show(Page.getCurrent());
}
});
- pos.addStyleName(ValoTheme.BUTTON_SMALL);
grid.addComponent(pos);
pos = new Button("", new ClickListener() {