Example usage for com.vaadin.client UIDL getLongAttribute

List of usage examples for com.vaadin.client UIDL getLongAttribute

Introduction

In this page you can find the example usage for com.vaadin.client UIDL getLongAttribute.

Prototype

public long getLongAttribute(String name) 

Source Link

Document

Gets the named attribute as a long.

Usage

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.client.CustomUploadConnector.java

License:Apache License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    super.updateFromUIDL(uidl, client);
    if (uidl.hasAttribute("maxFileSize")) {
        getWidget().setMaxFileSize(uidl.getLongAttribute("maxFileSize"));
    }/* www .  jav  a2s .c o  m*/
    if (uidl.hasAttribute("sizeErrorMsg")) {
        getWidget().setSizeErrorMsg(uidl.getStringAttribute("sizeErrorMsg"));
    }
    if (uidl.hasAttribute("acceptFilter")) {
        getWidget().setAcceptFilter(uidl.getStringAttribute("acceptFilter"));
    }
    if (uidl.hasAttribute("mimeTypeErrorMsg")) {
        getWidget().setMimeTypeErrorMsg(uidl.getStringAttribute("mimeTypeErrorMsg"));
    }
    if (uidl.hasAttribute("acceptedMimeTypes")) {
        getWidget().setAcceptedMimeTypes(Arrays.asList(uidl.getStringArrayAttribute("acceptedMimeTypes")));
    }
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.client.VMultiUpload.java

License:Apache License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    if (client.updateComponent(this, uidl, true)) {
        return;/*from  ww w .  ja v  a 2s.  co m*/
    }
    addStyleName(CLASSNAME + "-immediate");

    this.client = client;
    paintableId = uidl.getId();
    receiverUri = client.translateVaadinUri(uidl.getStringVariable("target"));
    submitButton.setText(uidl.getStringAttribute("buttoncaption"));
    fu.setName(paintableId + "_file");

    if (uidl.hasAttribute("enabled")) {
        if (uidl.getBooleanAttribute("enabled")) {
            enableUpload();
        } else {
            disableUpload();
        }
    }

    if (uidl.hasAttribute("maxFileSize")) {
        maxFileSize = uidl.getLongAttribute("maxFileSize");
    }
    if (uidl.hasAttribute("sizeErrorMsg")) {
        sizeErrorMsg = uidl.getStringAttribute("sizeErrorMsg");
    }
    if (uidl.hasAttribute("mimeTypeErrorMsg")) {
        mimeTypeErrorMsg = uidl.getStringAttribute("mimeTypeErrorMsg");
    }
    if (uidl.hasAttribute("acceptFilter")) {
        getInput().setAccept(uidl.getStringAttribute("acceptFilter"));
    }
    if (uidl.hasAttribute("acceptedMimeTypes")) {
        acceptedMimeTypes = Arrays.asList(uidl.getStringArrayAttribute("acceptedMimeTypes"));
    }
    if (uidl.hasAttribute("interruptedFileIds")) {
        removeFromFileQueue(uidl.getIntArrayAttribute("interruptedFileIds"));
    }
    if (uidl.hasAttribute("ready")) {
        postNextFileFromQueue();
    }
}