当前位置: 首页>>代码示例>>Java>>正文


Java WidgetUtil.getRequiredWidth方法代码示例

本文整理汇总了Java中com.vaadin.client.WidgetUtil.getRequiredWidth方法的典型用法代码示例。如果您正苦于以下问题:Java WidgetUtil.getRequiredWidth方法的具体用法?Java WidgetUtil.getRequiredWidth怎么用?Java WidgetUtil.getRequiredWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.client.WidgetUtil的用法示例。


在下文中一共展示了WidgetUtil.getRequiredWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUsedWidth

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
@Override
public int getUsedWidth() {
    if (!isCaptionInline()) {
        return super.getUsedWidth();
    }

    int widgetWidth = getWidgetWidth();
    if (getCaption() == null) {
        return widgetWidth;
    } else if (getCaption().shouldBePlacedAfterComponent() || isCaptionInline()) {
        widgetWidth += getCaptionWidth();
        if (rightCaption != null) {
            widgetWidth += WidgetUtil.getRequiredWidth(rightCaption);
        }
        return widgetWidth;
    } else {
        if (rightCaption != null) {
            widgetWidth += WidgetUtil.getRequiredWidth(rightCaption);
        }
        return Math.max(widgetWidth, getCaptionWidth());
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:CubaFieldGroupLayoutComponentSlot.java

示例2: getRenderedWidth

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
@Override
public int getRenderedWidth() {
    int width = 0;

    if (icon != null) {
        width += WidgetUtil.getRequiredWidth(icon.getElement());
    }

    if (captionText != null) {
        width += WidgetUtil.getRequiredWidth(captionText);
    }
    if (requiredFieldIndicator != null && requiredFieldIndicator.getParentElement() == getElement()) {
        width += WidgetUtil.getRequiredWidth(requiredFieldIndicator);
    }
    if (errorIndicatorElement != null && errorIndicatorElement.getParentElement() == getElement()) {
        width += WidgetUtil.getRequiredWidth(errorIndicatorElement);
    }
    if (contextHelpIndicatorElement != null && contextHelpIndicatorElement.getParentElement() == getElement()) {
        width += WidgetUtil.getRequiredWidth(contextHelpIndicatorElement);
    }
    return width;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:CubaCaptionWidget.java

示例3: setInternalWidths

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
/** For internal use only. May be removed or replaced in the future. */
public void setInternalWidths() {
	getElement().getStyle().setPosition(Position.RELATIVE);
	int bordersAndPaddings = WidgetUtil.measureHorizontalPaddingAndBorder(buttons.getElement(), 0);
	int upDownBordersAndPaddings = WidgetUtil.measureHorizontalPaddingAndBorder(upDownButtons.getElement(), 0);
	int buttonWidth = WidgetUtil.getRequiredWidth(buttons);
	int upDownButtonsWidth = WidgetUtil.getRequiredWidth(upDownButtons);
	int totalWidth = getOffsetWidth();

	int spaceForSelect = (totalWidth - buttonWidth - upDownButtonsWidth - bordersAndPaddings
			- upDownBordersAndPaddings) / 2;

	optionsListBox.setWidth(spaceForSelect + "px");
	if (optionsCaption != null) {
		optionsCaption.setWidth(spaceForSelect + "px");
	}

	selectionsListBox.setWidth(spaceForSelect + "px");
	if (selectionsCaption != null) {
		selectionsCaption.setWidth(spaceForSelect + "px");
	}
	captionWrapper.setWidth("100%");
}
 
开发者ID:tepi,项目名称:ListBuilder,代码行数:24,代码来源:VListBuilder.java

示例4: getIndicatorsWidth

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
public int getIndicatorsWidth() {
    if (rightCaption != null) {
        return WidgetUtil.getRequiredWidth(rightCaption);
    } else {
        return 0;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:CubaFieldGroupLayoutComponentSlot.java


注:本文中的com.vaadin.client.WidgetUtil.getRequiredWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。