當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractFieldConnector類代碼示例

本文整理匯總了Java中com.vaadin.client.ui.AbstractFieldConnector的典型用法代碼示例。如果您正苦於以下問題:Java AbstractFieldConnector類的具體用法?Java AbstractFieldConnector怎麽用?Java AbstractFieldConnector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AbstractFieldConnector類屬於com.vaadin.client.ui包,在下文中一共展示了AbstractFieldConnector類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateCaptionInternal

import com.vaadin.client.ui.AbstractFieldConnector; //導入依賴的package包/類
@Override
protected void updateCaptionInternal(ComponentConnector child) {
    // CAUTION copied from superclass
    CubaOrderedLayoutSlot slot = (CubaOrderedLayoutSlot) getWidget().getSlot(child.getWidget());

    String caption = child.getState().caption;
    URLReference iconUrl = child.getState().resources
            .get(ComponentConstants.ICON_RESOURCE);
    String iconUrlString = iconUrl != null ? iconUrl.getURL() : null;
    Icon icon = child.getConnection().getIcon(iconUrlString);

    List<String> styles = child.getState().styles;
    String error = child.getState().errorMessage;
    boolean showError = error != null;
    if (child.getState() instanceof AbstractFieldState) {
        AbstractFieldState abstractFieldState = (AbstractFieldState) child
                .getState();
        showError = showError && !abstractFieldState.hideErrors;
    }
    boolean required = false;
    if (child instanceof AbstractFieldConnector) {
        required = ((AbstractFieldConnector) child).isRequired();
    }
    boolean enabled = child.isEnabled();

    if (slot.hasCaption() && null == caption) {
        slot.setCaptionResizeListener(null);
    }

    // Haulmont API
    boolean contextHelpIconEnabled = isContextHelpIconEnabled(child.getState());

    // Haulmont API
    slot.setCaption(caption, contextHelpIconEnabled, icon, styles, error, showError, required,
            enabled, child.getState().captionAsHtml);

    AriaHelper.handleInputRequired(child.getWidget(), required);
    AriaHelper.handleInputInvalid(child.getWidget(), showError);
    AriaHelper.bindCaption(child.getWidget(), slot.getCaptionElement());

    if (slot.hasCaption()) {
        CaptionPosition pos = slot.getCaptionPosition();
        slot.setCaptionResizeListener(slotCaptionResizeListener);
        if (child.isRelativeHeight()
                && (pos == CaptionPosition.TOP || pos == CaptionPosition.BOTTOM)) {
            getWidget().updateCaptionOffset(slot.getCaptionElement());
        } else if (child.isRelativeWidth()
                && (pos == CaptionPosition.LEFT || pos == CaptionPosition.RIGHT)) {
            getWidget().updateCaptionOffset(slot.getCaptionElement());
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:53,代碼來源:CubaOrderedActionsLayoutConnector.java


注:本文中的com.vaadin.client.ui.AbstractFieldConnector類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。