本文整理匯總了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;
}