本文整理汇总了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());
}
}
示例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;
}
示例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%");
}
示例4: getIndicatorsWidth
import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
public int getIndicatorsWidth() {
if (rightCaption != null) {
return WidgetUtil.getRequiredWidth(rightCaption);
} else {
return 0;
}
}