Example usage for com.vaadin.ui Upload setReceiver

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

Introduction

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

Prototype

public void setReceiver(Receiver receiver) 

Source Link

Document

Sets the receiver.

Usage

From source file:ru.codeinside.adm.ui.BusinessCalendar.java

License:Mozilla Public License

public BusinessCalendar() {
    Upload upload = new Upload();
    upload.setImmediate(false);/*from www.ja  v a2 s  .  c om*/
    upload.setButtonCaption("  ");
    upload.setReceiver(this);
    upload.addListener(this);

    datesTable = new BusinessDatesTable();
    removeButton = createButton("");

    VerticalLayout vr = new VerticalLayout();
    vr.setSizeFull();
    vr.setSpacing(true);
    vr.setMargin(true);

    HorizontalLayout horLayout = new HorizontalLayout();
    horLayout.setSizeFull();
    horLayout.setSpacing(true);
    horLayout.setMargin(true);
    horLayout.addComponent(upload);
    horLayout.addComponent(removeButton);
    vr.addComponent(horLayout);
    vr.addComponent(datesTable);

    addComponent(vr);
    vr.setExpandRatio(horLayout, .1f);
    vr.setExpandRatio(datesTable, .9f);
    datesTable.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            removeButton.setVisible(event.getProperty().getValue() != null);
        }
    });
    setSizeFull();
}

From source file:ru.codeinside.adm.ui.employee.EmployeeWidget.java

License:Mozilla Public License

public EmployeeWidget(boolean lockedFilterValue, TreeTable table) {
    this.table = table;
    Upload upload = new Upload();
    upload.setImmediate(false);//w w w.j  ava  2 s. co  m
    upload.setButtonCaption("  ");
    upload.setReceiver(this);
    upload.addListener(this);
    /*    Panel panel1 = new Panel();
        Button button = new Button("??? ", new Button.ClickListener() {
          @Override
          public void buttonClick(Button.ClickEvent event) {
            try {
              URL url = new URL(getApplication().getURL(), "/registry/structures");
              loadEmployeeData(url.openStream());
            } catch (MalformedURLException e) {
              getWindow().showNotification(" " + e.getMessage());
            } catch (IOException e) {
              getWindow().showNotification(" " + e.getMessage());
            }
          }
        });
        panel1.addComponent(button);*/
    tableEmployee = new TableAllEmployee(lockedFilterValue);
    tableEmployee.setSizeFull();
    HorizontalLayout hr = new HorizontalLayout();
    hr.setSizeFull();
    hr.setHeight("70px");
    hr.setSpacing(true);
    hr.setMargin(true);
    hr.addComponent(upload);
    addComponent(hr);
    addComponent(tableEmployee);
    tableEmployee.addButtonToLayout(hr);
    setExpandRatio(hr, 0.01f);
    setExpandRatio(tableEmployee, 0.99f);
    setSizeFull();
}

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

License:Mozilla Public License

public ServiceWidget(ApServiceTable c) {
    this.c = c;/*from  w w w. j av a2 s  . com*/
    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);
}