]> source.dussan.org Git - vaadin-framework.git/commitdiff
Resource constructors for Button (#13446)
authorArtur Signell <artur@vaadin.com>
Tue, 11 Mar 2014 14:52:15 +0000 (16:52 +0200)
committerArtur Signell <artur@vaadin.com>
Tue, 11 Mar 2014 15:08:20 +0000 (17:08 +0200)
Change-Id: I9e8409660f38e35c01adde69158c34e85cff3c43

server/src/com/vaadin/ui/Button.java

index 1bcf802f126cf0263d04226f3f5dbfee112453e0..765c805d3771d20506b8e15d498ccad90794004e 100644 (file)
@@ -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.
      *