Example usage for com.vaadin.ui Upload Upload

List of usage examples for com.vaadin.ui Upload Upload

Introduction

In this page you can find the example usage for com.vaadin.ui Upload Upload.

Prototype

public Upload() 

Source Link

Document

Creates a new instance of Upload.

Usage

From source file:ru.codeinside.gses.webui.manager.ServiceWidget.java

License:Mozilla Public License

public ServiceWidget(ApServiceTable c) {
    this.c = c;/*w  w  w  .  jav  a 2 s.c  o  m*/
    Panel panel = new Panel();
    Upload upload = new Upload();
    upload.setImmediate(false);
    upload.setButtonCaption("");
    upload.setReceiver(this);
    upload.addListener(this);
    panel.addComponent(upload);
    Panel panel1 = new Panel();
    Button button = new Button("??? ", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            URL url;
            try {
                url = new URL(
                        "http://" + getApplication().getURL().getHost() + "/registry-1.0-SNAPSHOT/services");
                loadServiceData(url.openStream());
            } catch (MalformedURLException e) {
                System.out.println(e);
            } catch (IOException e) {
                System.out.println(e);
            }
        }
    });
    panel1.addComponent(button);
    this.setSpacing(true);
    this.addComponent(panel);
}