Package com.vaadin.ui

Examples of com.vaadin.ui.Upload$NoInputStreamEvent


        PasswordField password = new PasswordField("Password");
        password.setInputPrompt("Password");
        form.addComponent(password);

        Upload upload = new Upload("File input", null);
        form.addComponent(upload);

        Label help = new Label("Example block-level help text here.");
        help.addStyleName("help-block");
        form.addComponent(help);
View Full Code Here


    public TestForStyledUpload() {
        main.addComponent(new Label(
                "Clicking on button b updates information about upload components status or same with garbage collector."));

        up = new Upload(null, buffer);
        up.setButtonCaption("Select file");
        up.setImmediate(true);
        up.addListener((FinishedListener) this);
        up.addListener((FailedListener) this);
        up.addListener((SucceededListener) this);
View Full Code Here

        textField = new TextField("Test field");
        textFieldValue = new Label();
        main.addComponent(textField);
        main.addComponent(textFieldValue);

        up = new Upload("Upload", buffer);
        up.setImmediate(true);
        up.addListener(new Listener() {
            private static final long serialVersionUID = -8319074730512324303L;

            @Override
View Full Code Here

            @Override
            public VaadinSession getSession() {
                return application;
            }
        };
        owner = new Upload() {
            @Override
            public UI getUI() {
                return uI;
            }
        };
View Full Code Here

        final TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect "
                + count++);
        test(layout, twinColSelect);

        final Upload upload = new Upload("Upload (non-functional)", null);
        test(layout, upload);

        // Custom components
        layout.addComponent(new Label("<B>Below are few custom components</B>",
                ContentMode.HTML));
View Full Code Here

    protected void setup() {

        final TextField textField = new TextField("Test field");
        addComponent(textField);

        final Upload u;

        u = new Upload("Upload", this);

        u.setButtonCaption(null);

        addComponent(u);

        u.addListener(new Upload.FinishedListener() {
            @Override
            public void uploadFinished(FinishedEvent event) {
                String filename = event.getFilename();
                long length = event.getLength();
                getMainWindow().showNotification(
                        "Done. Filename : " + filename + " Lenght: " + length);
            }
        });

        u.addListener(new Upload.FailedListener() {
            @Override
            public void uploadFailed(FailedEvent event) {
                getMainWindow().showNotification("Failed. No file selected?");
            }
        });

        u.addListener(new Upload.StartedListener() {
            @Override
            public void uploadStarted(StartedEvent event) {
                getMainWindow().showNotification(
                        "Started upload. TF value :" + textField.getValue());
            }
        });

        Button button = new Button(
                "I'm an external button (not the uploads builtin), hit me to start upload.");
        button.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                u.submitUpload();
            }
        });

        addComponent(button);
View Full Code Here

        return "Uploading an empty selection (no file) will trigger FinishedEvent with 0-length file size and empty filename.";
    }

    @Override
    protected void setup(VaadinRequest request) {
        Upload u = new Upload("Upload", this);
        u.setId(UPLOAD_ID);
        u.setSizeUndefined();

        addComponent(u);

        u.addFinishedListener(new Upload.FinishedListener() {
            @Override
            public void uploadFinished(FinishedEvent event) {
                log(UPLOAD_FINISHED);
                log(FILE_LENGTH_PREFIX + " " + event.getLength());
                log(FILE_NAME_PREFIX + " " + event.getFilename());
            }
        });
        u.addFailedListener(new Upload.FailedListener() {

            @Override
            public void uploadFailed(FailedEvent event) {
                log("Upload Failed");
                log(FILE_LENGTH_PREFIX + " " + event.getLength());
View Full Code Here

    private UploadReceiver receiver = new UploadReceiver();

    @Override
    protected void setup() {

        Upload upload = new Upload("Upload a file", receiver);

        addComponent(upload);
        addComponent(result);

        upload.addListener(new Upload.FinishedListener() {
            @Override
            public void uploadFinished(FinishedEvent event) {
                result.setValue("Got file (should not contain path): "
                        + receiver.getFilename());
            }
View Full Code Here

    @Override
    protected void initializeComponents() {

        FormLayout formLayout = new FormLayout();
        formLayout.setWidth("100%");
        Upload u = new Upload("Upload in FormLayout", this);
        u.setImmediate(true);
        formLayout.addComponent(u);
        addTestComponent(formLayout);

    }
View Full Code Here

        return Upload.class;
    }

    @Override
    protected void initializeComponents() {
        Upload u;

        u = new Upload("Undefined wide upload", this);
        u.setSizeUndefined();
        addTestComponent(u);

        u.addListener(new Upload.FinishedListener() {
            @Override
            public void uploadFinished(FinishedEvent event) {
                getMainWindow().showNotification("Done");
            }
        });

        u = new Upload("300px wide upload", this);
        u.setWidth("300px");
        addTestComponent(u);

    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Upload$NoInputStreamEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.