Example usage for com.vaadin.client UIDL getTag

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

Introduction

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

Prototype

public native String getTag()
;

Source Link

Document

Gets the name of this UIDL section, as created with PaintTarget#startTag(String) PaintTarget.startTag() in the server-side Component#paint(PaintTarget) Component.paint() or (usually) com.vaadin.ui.AbstractComponent#paintContent(PaintTarget) AbstractComponent.paintContent() .

Usage

From source file:org.tepi.filtertable.gwt.client.ui.VFilterTreeTable.java

License:Apache License

/**
 * Icons rendered into first actual column in TreeTable, not to row header
 * cell//from   ww  w . j  a  va2s. co  m
 */
@Override
protected String buildCaptionHtmlSnippet(UIDL uidl) {
    if (uidl.getTag().equals("column")) {
        return super.buildCaptionHtmlSnippet(uidl);
    } else {
        String s = uidl.getStringAttribute("caption");
        return s;
    }
}

From source file:org.vaadin.tltv.multiscrolltable.client.ui.HeaderPanel.java

License:Apache License

public void updateContent(UIDL uidl) {
    if (uidl == null) {
        return;// w w  w  .j  a  v  a 2 s. c  o  m
    }

    if (uidl.getTag().equals(VCustomScrollTable.TAG_SCROLLCONTENT)) {
        int childcount = uidl.getChildCount();
        if (childcount > 0) {
            ColumnPanel prev = null;
            for (int i = 0; i < childcount; i++) {
                prev = updateContentByGroupUidl(uidl.getChildUIDL(i), 0, i, prev, null);
            }
        }

    }

    if (reConstruct) {
        columnCount = 0;
        if (content.getRowCount() > 0) {
            columnCount = content.getCellCount(content.getRowCount() - 1);
        }
    }
    reConstruct = false;
}

From source file:org.vaadin.tltv.multiscrolltable.client.ui.HeaderPanel.java

License:Apache License

private ColumnPanel updateContentByGroupUidl(UIDL uidl, int level, int index, ColumnPanel prevColumn,
        ColumnPanel group) {/*from w w  w .  j  a va  2  s .  c o m*/
    if (uidl == null) {
        return null;
    }

    String caption = uidl.getStringAttribute(VCustomScrollTable.ATTR_CAPTION);
    ColumnPanel p = getColumnPanel(level, index, prevColumn, group);
    updateGroupElement(p);
    p.getLabel().setText(caption);

    boolean updateColSpan = false;
    int childs = uidl.getChildCount();
    if (childs <= 0) {
        return p;
    }
    int cellCount = p.getFirstChildIndex();
    if (reConstruct) {
        // When reconstructing, p.getFirstChildIndex() value is not updated
        // yet.
        try {
            cellCount = content.getCellCount(level + 1);
        } catch (IndexOutOfBoundsException e) {
            cellCount = 0;
        }
    }
    ColumnPanel prev = null;
    for (int i = 0; i < childs; i++) {
        UIDL subUidl = uidl.getChildUIDL(i);
        if (subUidl.getTag().equals(VCustomScrollTable.TAG_COLUMN)) {
            prev = updateContentByColumnUidl(subUidl, level + 1, cellCount + i, prev, p);
            updateColSpan = reConstruct;
        } else if (subUidl.getTag().equals(VCustomScrollTable.TAG_COLUMNGROUP)) {
            prev = updateContentByGroupUidl(subUidl, level + 1, i, prev, p);
        }
    }
    if (updateColSpan) {
        // This needs to be called only for the "leaf" panels.
        p.setColSpan(childs);
    }
    return p;
}