summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/TestForStyledUpload.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/TestForStyledUpload.java')
-rw-r--r--uitest/src/com/vaadin/tests/TestForStyledUpload.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/uitest/src/com/vaadin/tests/TestForStyledUpload.java b/uitest/src/com/vaadin/tests/TestForStyledUpload.java
index 6532d3acc8..cff3ca2420 100644
--- a/uitest/src/com/vaadin/tests/TestForStyledUpload.java
+++ b/uitest/src/com/vaadin/tests/TestForStyledUpload.java
@@ -56,7 +56,8 @@ public class TestForStyledUpload extends LegacyApplication implements
TmpFileBuffer buffer = new TmpFileBuffer();
- Panel status = new Panel("Uploaded file:");
+ VerticalLayout statusLayout = new VerticalLayout();
+ Panel status = new Panel("Uploaded file:", statusLayout);
private final Upload up;
@@ -122,6 +123,7 @@ public class TestForStyledUpload extends LegacyApplication implements
memoryStatus = new Label();
main.addComponent(memoryStatus);
+ statusLayout.setMargin(true);
status.setVisible(false);
main.addComponent(status);
@@ -175,21 +177,22 @@ public class TestForStyledUpload extends LegacyApplication implements
@Override
public void uploadFinished(FinishedEvent event) {
- status.removeAllComponents();
+ statusLayout.removeAllComponents();
final InputStream stream = buffer.getStream();
if (stream == null) {
- status.addComponent(new Label(
+ statusLayout.addComponent(new Label(
"Upload finished, but output buffer is null!!"));
} else {
- status.addComponent(new Label(
- "<b>Name:</b> " + event.getFilename(), ContentMode.HTML));
- status.addComponent(new Label("<b>Mimetype:</b> "
+ statusLayout.addComponent(new Label("<b>Name:</b> "
+ + event.getFilename(), ContentMode.HTML));
+ statusLayout.addComponent(new Label("<b>Mimetype:</b> "
+ event.getMIMEType(), ContentMode.HTML));
- status.addComponent(new Label("<b>Size:</b> " + event.getLength()
- + " bytes.", ContentMode.HTML));
+ statusLayout.addComponent(new Label("<b>Size:</b> "
+ + event.getLength() + " bytes.", ContentMode.HTML));
- status.addComponent(new Link("Download " + buffer.getFileName(),
- new StreamResource(buffer, buffer.getFileName())));
+ statusLayout.addComponent(new Link("Download "
+ + buffer.getFileName(), new StreamResource(buffer, buffer
+ .getFileName())));
status.setVisible(true);
}