aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/Upload.java
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-11-26 09:36:13 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-11-26 09:36:13 +0000
commitd7281512788e31efe252b937ef96167ade59a829 (patch)
treed471e56cc24fd6159c497403c9a66decfcb401a4 /src/com/itmill/toolkit/ui/Upload.java
parentc23b5b9264b2b1933bc30307e0f9400eedebb9eb (diff)
downloadvaadin-framework-d7281512788e31efe252b937ef96167ade59a829.tar.gz
vaadin-framework-d7281512788e31efe252b937ef96167ade59a829.zip
fixes #1186
svn changeset:2942/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/Upload.java')
-rw-r--r--src/com/itmill/toolkit/ui/Upload.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/Upload.java b/src/com/itmill/toolkit/ui/Upload.java
index a755b14137..998178d0d2 100644
--- a/src/com/itmill/toolkit/ui/Upload.java
+++ b/src/com/itmill/toolkit/ui/Upload.java
@@ -76,6 +76,8 @@ public class Upload extends AbstractComponent implements Component.Focusable {
private int totalBytes;
+ private String buttonCaption = "Upload";
+
/**
* ProgressListener to which information about progress is sent during
* upload
@@ -193,6 +195,8 @@ public class Upload extends AbstractComponent implements Component.Focusable {
target.addAttribute("state", isUploading);
+ target.addAttribute("buttoncaption", buttonCaption);
+
target.addVariable(this, "fake", true);
target.addUploadStreamVariable(this, "stream");
@@ -801,4 +805,22 @@ public class Upload extends AbstractComponent implements Component.Focusable {
*/
public void updateProgress(long readBytes, long contentLength);
}
+
+ /**
+ * @return String to be rendered into button that fires uploading
+ */
+ public String getButtonCaption() {
+ return buttonCaption;
+ }
+
+ /**
+ * File uploads usually have button that starts actual upload progress. This
+ * method is used to set text in that button.
+ *
+ * @param buttonCaption
+ * text for uploads button.
+ */
+ public void setButtonCaption(String buttonCaption) {
+ this.buttonCaption = buttonCaption;
+ }
}