From: Artur Signell Date: Tue, 11 Mar 2014 14:52:15 +0000 (+0200) Subject: Resource constructors for Button (#13446) X-Git-Tag: 7.2.0.beta1~119 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=35c270eb5de2c1a30efd7790371bbae30e9f1acb;p=vaadin-framework.git Resource constructors for Button (#13446) Change-Id: I9e8409660f38e35c01adde69158c34e85cff3c43 --- 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. *