Example usage for com.vaadin.client UIDL getMapAttribute

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

Introduction

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

Prototype

public ValueMap getMapAttribute(String name) 

Source Link

Document

Gets the named attribute as a Map of named values (key/value pairs).

Usage

From source file:annis.gui.widgets.gwt.client.ui.VJITWrapper.java

License:Apache License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {

    // This call should be made first.
    // It handles sizes, captions, tooltips, etc. automatically.
    if (client.updateComponent(this, uidl, true)) {
        // If client.updateComponent returns true there has been no changes and we
        // do not need to update anything.
        return;//w  ww .  ja  va  2s  .c  om
    }

    if (uidl.hasAttribute("visData")) {

        jsonData = parseStringToJSON(uidl.getStringAttribute("visData"));

        // setup config for visualization
        if (uidl.hasAttribute("mappings")) {
            setupConfig(uidl.getMapAttribute("mappings"));
        } else {
            setupConfig();
        }

        if (visualization == null) {
            visualization = visualizationInit(config.getJavaScriptObject());
        }

        if (jsonData != null) {
            visualization.render();
        } else {
            GWT.log("jsonData are null");
        }
    }
}

From source file:info.magnolia.ui.vaadin.gwt.client.richtext.VMagnoliaRichTextField.java

License:Open Source License

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {

    // Make sure external plugins are assigned before the loading command.
    if (uidl.hasAttribute(VAR_SERVERPLUGINS)) {
        customPlugins = uidl.getMapAttribute(VAR_SERVERPLUGINS);
    }/*from   ww w  .  j  ava  2  s.  co m*/

    // list of plugin events that server is interested of handling.
    if (uidl.hasAttribute(VAR_EVENTNAMES)) {
        pluginEvents = Arrays.asList(uidl.getStringArrayAttribute(VAR_EVENTNAMES));
    }

    if (uidl.hasAttribute(ATTR_IMMEDIATE)) {
        immediate = uidl.getBooleanAttribute(ATTR_IMMEDIATE);
    }

    super.updateFromUIDL(uidl, client);

    // Server wants to send an event to a plugin, we must do this after super value update.
    if (uidl.hasAttribute(VAR_FIRE_PLUGIN_EVENT) && this.editor != null) {
        this.editor.fire(uidl.getStringAttribute(VAR_FIRE_PLUGIN_EVENT),
                uidl.getStringAttribute(VAR_FIRE_PLUGIN_EVENT_VALUE));
    }
}

From source file:org.semanticsoft.vaaclipse.widgets.client.ui.extlayout.ExtendedVerticalLayoutConnector.java

License:Open Source License

/**
 * Called whenever an update is received from the server
 */// w w  w .  j  a v  a  2 s . co  m
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    VExtendedVerticalLayout layout = getWidget();

    layout.paintableId = uidl.getId();

    if (uidl.hasAttribute(VExtendedVerticalLayout.VARIABLES)) {
        ValueMap vmap = uidl.getMapAttribute(VExtendedVerticalLayout.VARIABLES);
        Set<String> indexes = vmap.getKeySet();
        for (String index : indexes) {
            layout.variables.put(index, vmap.getString(index));
        }
    }
}

From source file:org.semanticsoft.vaadinaddons.boundsinfo.client.ui.VBoundsinfoVerticalLayout.java

License:Open Source License

/**
 * Called whenever an update is received from the server
 *//* www. j a  v a  2 s. c o  m*/
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    super.updateFromUIDL(uidl, client);

    // This call should be made first.
    // It handles sizes, captions, tooltips, etc. automatically.
    if (client.updateComponent(this, uidl, true)) {
        // If client.updateComponent returns true there has been no changes
        // and we
        // do not need to update anything.
        return;
    }

    // Save reference to server connection object to be able to send
    // user interaction later
    this.client = client;

    // Save the client side identifier (paintable id) for the widget
    paintableId = uidl.getId();

    if (uidl.hasAttribute(VARIABLES)) {
        ValueMap vmap = uidl.getMapAttribute(VARIABLES);
        Set<String> indexes = vmap.getKeySet();
        for (String index : indexes) {
            variables.put(index, vmap.getString(index));
        }
    }

    this.enableBoundsUpdate = uidl.getBooleanAttribute(ENABLE_BOUNDS_UPDATE);
    if (this.enableBoundsUpdate)
        updateManager = new BoundsUpdateManager(this, paintableId, client);
}