Example usage for com.vaadin.client ApplicationConnection translateVaadinUri

List of usage examples for com.vaadin.client ApplicationConnection translateVaadinUri

Introduction

In this page you can find the example usage for com.vaadin.client ApplicationConnection translateVaadinUri.

Prototype

public String translateVaadinUri(String uidlUri) 

Source Link

Document

Translates custom protocols in UIDL URI's to be recognizable by browser.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadConnector.java

License:Apache License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    if (!isRealUpdate(uidl)) {
        return;// w  w w. ja  v a2 s. c o  m
    }

    final String uploadUrl = client.translateVaadinUri(uidl.getStringVariable("uploadUrl"));

    getWidget().setUploadUrl(uploadUrl);
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.multiupload.CubaMultiUploadConnector.java

License:Apache License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    if (!isRealUpdate(uidl)) {
        return;//from w w  w.  j  a  va2s.c om
    }

    if (!initialized) {
        initialized = true;

        String appVersion = getConnection().getConfiguration().getApplicationVersion();

        CubaMultiUploadWidget widget = getWidget();

        widget.themeName = getConnection().getUIConnector().getActiveTheme();

        widget.resourcesVersion = appVersion;
        widget.buttonImageUri = getResourceUrl(CubaMultiUploadState.BUTTON_IMAGE_KEY);
        widget.bootstrapJsUrl = getResourceUrl(CubaMultiUploadState.SWFUPLOAD_BOOTSTRAP_JS_KEY);
        widget.flashUrl = getResourceUrl(CubaMultiUploadState.SWFUPLOAD_FLASH_KEY);

        widget.targetUrl = client.translateVaadinUri(uidl.getStringVariable("action"));

        CubaMultiUploadState state = getState();

        widget.buttonCaption = state.buttonCaption;
        widget.buttonHeight = state.buttonHeight;
        widget.buttonWidth = state.buttonWidth;
        widget.buttonStyles = state.buttonStyles;
        widget.buttonDisabledStyles = state.buttonDisabledStyles;

        widget.buttonTextLeft = state.buttonTextLeft;
        widget.buttonTextTop = state.buttonTextTop;

        widget.queueSizeLimit = state.queueSizeLimit;
        widget.fileSizeLimit = state.fileSizeLimit;
        widget.queueUploadLimit = state.queueUploadLimit;

        widget.fileTypes = state.fileTypes;
        widget.fileTypesDescription = state.fileTypesDescription;
        widget.jsessionId = state.jsessionId;
        widget.buttonEnabled = state.buttonEnabled;

        widget.initComponent(getConnectorId());
    }
}

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 w w w. j  a va  2  s . com
    }
    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();
    }
}

From source file:org.opennms.features.topology.app.internal.gwt.client.VTopologyComponent.java

License:Open Source License

public void injectSVGDefs(ApplicationConnection appConnection, List<String> svgDefFiles) {
    for (String file : svgDefFiles) {
        D3.d3().injectSVGDef(appConnection.translateVaadinUri(file));
    }//  w  w w .ja  v  a2s  .  co m
}