ru.codeinside.gses.webui.components.DeploymentAddUi.java Source code

Java tutorial

Introduction

Here is the source code for ru.codeinside.gses.webui.components.DeploymentAddUi.java

Source

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * Copyright (c) 2013, MPL CodeInside http://codeinside.ru
 */

package ru.codeinside.gses.webui.components;

import com.vaadin.annotations.AutoGenerated;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.StartedListener;

public class DeploymentAddUi extends HorizontalLayout {

    private static final long serialVersionUID = -894346915703075379L;

    private Upload upload;

    private final StartedListener uploadStartListener;
    private final Upload.Receiver receiver;
    private final Upload.SucceededListener succeededListener;

    public DeploymentAddUi(StartedListener uploadStartListener, Upload.Receiver receiver,
            Upload.SucceededListener succeededListener) {
        this.uploadStartListener = uploadStartListener;
        this.receiver = receiver;
        this.succeededListener = succeededListener;
        buildMainLayout();
    }

    @AutoGenerated
    private void buildMainLayout() {
        upload = new Upload();
        upload.setImmediate(false);
        addComponent(upload);

        upload.setButtonCaption("?? ??");
        upload.addListener(uploadStartListener);

        upload.setReceiver(receiver);
        upload.addListener(succeededListener);
    }

}