From 35c270eb5de2c1a30efd7790371bbae30e9f1acb Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 11 Mar 2014 16:52:15 +0200 Subject: [PATCH] Resource constructors for Button (#13446) Change-Id: I9e8409660f38e35c01adde69158c34e85cff3c43 --- server/src/com/vaadin/ui/Button.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 1bcf802f12..765c805d37 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -99,6 +99,31 @@ public class Button extends AbstractComponent implements setCaption(caption); } + /** + * Creates a new push button with the given icon. + * + * @param icon + * the icon + */ + public Button(Resource icon) { + this(); + setIcon(icon); + } + + /** + * Creates a new push button with the given caption and icon. + * + * @param caption + * the caption + * @param icon + * the icon + */ + public Button(String caption, Resource icon) { + this(); + setCaption(caption); + setIcon(icon); + } + /** * Creates a new push button with a click listener. * -- 2.39.5