aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main
diff options
context:
space:
mode:
authorKnoobie <Knoobie@gmx.de>2017-09-21 10:52:41 +0200
committerHenri Sara <henri.sara@gmail.com>2017-09-21 11:52:41 +0300
commita166d6f52bf99d7616959f8e16b3972ed6b074d0 (patch)
tree7433ab3b971fec5316761077d5542fcf0c6cad54 /server/src/main
parent867006d2f81aa813c36f614fc6f1b98a5937c5f3 (diff)
downloadvaadin-framework-a166d6f52bf99d7616959f8e16b3972ed6b074d0.tar.gz
vaadin-framework-a166d6f52bf99d7616959f8e16b3972ed6b074d0.zip
Add Upload#setButtonStyleName (#10044)
Diffstat (limited to 'server/src/main')
-rw-r--r--server/src/main/java/com/vaadin/ui/Upload.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java
index cdc78bae35..4812c8ffd5 100644
--- a/server/src/main/java/com/vaadin/ui/Upload.java
+++ b/server/src/main/java/com/vaadin/ui/Upload.java
@@ -101,6 +101,8 @@ public class Upload extends AbstractComponent
private String buttonCaption = "Upload";
+ private String buttonStyleName;
+
/**
* ProgressListeners to which information about progress is sent during
* upload
@@ -185,6 +187,9 @@ public class Upload extends AbstractComponent
if (buttonCaption != null) {
target.addAttribute("buttoncaption", buttonCaption);
+ if (buttonStyleName != null) {
+ target.addAttribute("buttonstylename", buttonStyleName);
+ }
}
target.addAttribute("nextid", nextid);
@@ -975,6 +980,8 @@ public class Upload extends AbstractComponent
}
/**
+ * Returns the string rendered into button that fires uploading.
+ *
* @return String to be rendered into button that fires uploading
*/
public String getButtonCaption() {
@@ -982,6 +989,16 @@ public class Upload extends AbstractComponent
}
/**
+ * Returns the stylename rendered into button that fires uploading.
+ *
+ * @return Stylename to be rendered into button that fires uploading
+ * @since 8.2
+ */
+ public String getButtonStyleName() {
+ return buttonStyleName;
+ }
+
+ /**
* In addition to the actual file chooser, upload components have button
* that starts actual upload progress. This method is used to set text in
* that button.
@@ -1009,6 +1026,20 @@ public class Upload extends AbstractComponent
}
/**
+ * In addition to the actual file chooser, upload components have button
+ * that starts actual upload progress. This method is used to set a stylename
+ * to that button.
+ *
+ * @param buttonStyleName styleName for upload components button.
+ * @see #setButtonCaption(String) about when the button is shown / hidden.
+ * @since 8.2
+ */
+ public void setButtonStyleName(String buttonStyleName) {
+ this.buttonStyleName = buttonStyleName;
+ markAsDirty();
+ }
+
+ /**
* Forces the upload the send selected file to the server.
* <p>
* In case developer wants to use this feature, he/she will most probably