List of usage examples for com.vaadin.client.ui VGridLayout setCaption
public void setCaption(Widget widget, VCaption caption)
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(); 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); }/* w w w .j a v a2 s . co m*/ 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(); 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); }//w ww.j a va 2s . com caption.updateCaption(); } else { layout.setCaption(childConnector.getWidget(), null); getLayoutManager().setNeedsLayout(this); } }