本文整理汇总了Java中com.vaadin.ui.Component.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setWidth方法的具体用法?Java Component.setWidth怎么用?Java Component.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Component
的用法示例。
在下文中一共展示了Component.setWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HttpSourceStatsWindow
import com.vaadin.ui.Component; //导入方法依赖的package包/类
public HttpSourceStatsWindow(String sourceUrl) {
setModal(true);
center();
setCaption(String.format("%s crawling statistics", sourceUrl));
setWidth(50, Unit.PERCENTAGE);
setHeight(50, Unit.PERCENTAGE);
List<DateHistogramValue> urls = ElasticSearch.getUrlOperations().calculateStats(sourceUrl);
List<DateHistogramValue> documents = ElasticSearch.getDocumentOperations().calculateStats(sourceUrl);
Component layout = getChart(sourceUrl, urls, documents);
layout.setWidth(100, Unit.PERCENTAGE);
setContent(layout);
}
示例2: setupPropertyComponent
import com.vaadin.ui.Component; //导入方法依赖的package包/类
/**
* Setup the {@link Component} associated with given {@link Property}.
* @param property Property
* @param component Component
* @param fullWidth whether to set the Component to 100% width according to {@link #getComponentsWidthMode()}
*/
protected void setupPropertyComponent(Property<?> property, Component component, boolean fullWidth) {
if (fullWidth) {
component.setWidth(100, Unit.PERCENTAGE);
}
// check configurator
getPropertyComponentConfigurator(property).ifPresent(consumer -> {
if (!(component instanceof AbstractComponent)) {
throw new TypeMismatchException("Cannot configure Component of type [" + component.getClass().getName()
+ "] using the ComponentConfigurator associated with property [" + property
+ "]: the Component must extend AbstractComponent");
}
consumer.accept(BaseComponentConfigurator.create((AbstractComponent) component));
});
}
示例3: initContent
import com.vaadin.ui.Component; //导入方法依赖的package包/类
@Override
protected Component initContent() {
final Component content = getInternalField();
if (getWidth() > -1) {
content.setWidth(100, Unit.PERCENTAGE);
}
if (getHeight() > -1) {
content.setHeight(100, Unit.PERCENTAGE);
}
return content;
}