Example usage for com.vaadin.client.ui.layout VLayoutSlot getCaption

List of usage examples for com.vaadin.client.ui.layout VLayoutSlot getCaption

Introduction

In this page you can find the example usage for com.vaadin.client.ui.layout VLayoutSlot getCaption.

Prototype

public VCaption getCaption() 

Source Link

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.gridlayout.CubaGridLayoutConnector.java

License:Apache License

@Override
public void updateCaption(ComponentConnector childConnector) {
    // CAUTION copied from GridLayoutConnector.updateCaption(ComponentConnector childConnector)
    VGridLayout layout = getWidget();/*  ww w .  j a  va2 s .  c o  m*/
    VGridLayout.Cell cell = layout.widgetToCell.get(childConnector.getWidget());
    AbstractComponentState state = childConnector.getState();
    if (VCaption.isNeeded(state) || isContextHelpIconEnabled(state)) {
        VLayoutSlot layoutSlot = cell.slot;
        VCaption caption = layoutSlot.getCaption();
        if (caption == null) {
            // use our own caption widget
            caption = new CubaCaptionWidget(childConnector, getConnection());

            setDefaultCaptionParameters((CubaCaptionWidget) caption);

            Widget widget = childConnector.getWidget();

            layout.setCaption(widget, caption);
        }
        caption.updateCaption();
    } else {
        layout.setCaption(childConnector.getWidget(), null);
        getLayoutManager().setNeedsLayout(this);
    }
}

From source file:com.haulmont.cuba.web.widgets.client.gridlayout.CubaGridLayoutConnector.java

License:Apache License

@Override
public void updateCaption(ComponentConnector childConnector) {
    // CAUTION copied from GridLayoutConnector.updateCaption(ComponentConnector childConnector)
    VGridLayout layout = getWidget();//from  w  ww .  j  a  v  a 2s.  c  o m
    VGridLayout.Cell cell = layout.widgetToCell.get(childConnector.getWidget());
    AbstractComponentState state = childConnector.getState();
    if (VCaption.isNeeded(childConnector) || isContextHelpIconEnabled(state)) {
        VLayoutSlot layoutSlot = cell.slot;
        VCaption caption = layoutSlot.getCaption();
        if (caption == null) {
            // use our own caption widget
            caption = new CubaCaptionWidget(childConnector, getConnection());

            setDefaultCaptionParameters((CubaCaptionWidget) caption);

            Widget widget = childConnector.getWidget();

            layout.setCaption(widget, caption);
        }
        caption.updateCaption();
    } else {
        layout.setCaption(childConnector.getWidget(), null);
        getLayoutManager().setNeedsLayout(this);
    }
}