本文整理汇总了Java中com.vaadin.ui.CssLayout.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java CssLayout.setWidth方法的具体用法?Java CssLayout.setWidth怎么用?Java CssLayout.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.CssLayout
的用法示例。
在下文中一共展示了CssLayout.setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSparklines
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private Component buildSparklines() {
CssLayout sparks = new CssLayout();
sparks.addStyleName("sparks");
sparks.setWidth("100%");
Responsive.makeResponsive(sparks);
SparklineChart s = new SparklineChart("Traffic", "K", "",
DummyDataGenerator.chartColors[0], 22, 20, 80);
sparks.addComponent(s);
s = new SparklineChart("Revenue / Day", "M", "$",
DummyDataGenerator.chartColors[2], 8, 89, 150);
sparks.addComponent(s);
s = new SparklineChart("Checkout Time", "s", "",
DummyDataGenerator.chartColors[3], 10, 30, 120);
sparks.addComponent(s);
s = new SparklineChart("Theater Fill Rate", "%", "",
DummyDataGenerator.chartColors[5], 50, 34, 100);
sparks.addComponent(s);
return sparks;
}
示例2: buildContent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private Component buildContent() {
final CssLayout menuContent = new CssLayout();
menuContent.addStyleName("sidebar");
menuContent.addStyleName(ValoTheme.MENU_PART);
menuContent.addStyleName("no-vertical-drag-hints");
menuContent.addStyleName("no-horizontal-drag-hints");
menuContent.setWidth(null);
menuContent.setHeight("100%");
menuContent.addComponent(buildTitle());
menuContent.addComponent(buildUserMenu());
menuContent.addComponent(buildToggleButton());
menuContent.addComponent(buildMenuItems());
return menuContent;
}
示例3: postInit
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@PostConstruct
private void postInit() {
setSpacing(false);
setMargin(false);
setSizeFull();
content = new CssLayout();
content.setPrimaryStyleName("valo-content");
content.addStyleName("v-scrollable");
content.setWidth(100, Unit.PERCENTAGE);
addComponents(appHeader,content);
expand(content);
addAttachListener(new AttachListener() {
@Override
public void attach(AttachEvent event) {
Responsive.makeResponsive(getUI());
}
});
}
示例4: addMenuItemComponent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
protected void addMenuItemComponent(final ViewDefinition viewDefinition, String parameters) {
CssLayout dashboardWrapper = new CssLayout();
dashboardWrapper.addStyleName("badgewrapper");
dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM);
dashboardWrapper.setWidth(100.0f, Sizeable.Unit.PERCENTAGE);
Label notificationsBadge = new Label();
notificationsBadge.addStyleName(ValoTheme.MENU_BADGE);
notificationsBadge.setWidthUndefined();
notificationsBadge.setVisible(false);
if (viewDefinition != null) {
dashboardWrapper.addComponents(new ValoMenuItemButton(viewDefinition, parameters), notificationsBadge);
menuItemsLayout.addComponent(dashboardWrapper);
} else if (HybridbpmUI.getDeveloperMode()) {
dashboardWrapper.addComponents(new ValoMenuAddViewButton(), notificationsBadge);
menuItemsLayout.addComponent(dashboardWrapper);
}
}
示例5: createRating
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
public static CssLayout createRating(Customer customer) {
CssLayout layout = new CssLayout();
layout.setHeight(49, Sizeable.Unit.PIXELS);
layout.setWidth(100, Sizeable.Unit.PIXELS);
Label overallRating = new Label(FontAwesome.STAR.getHtml(), ContentMode.HTML);
overallRating.addStyleName("green");
overallRating.setDescription("Very good : " + testData.getNumberBetween(90, 100) + "% Chance");
overallRating.setWidthUndefined();
overallRating.setWidth(49, Sizeable.Unit.PIXELS);
overallRating.setHeight(49, Sizeable.Unit.PIXELS);
layout.addComponent(overallRating);
Label carRating = new Label(FontAwesome.CAR.getHtml(), ContentMode.HTML);
carRating.addStyleName("red");
carRating.setDescription("Unlikely : " + testData.getNumberBetween(1, 15) + "%");
carRating.setWidthUndefined();
carRating.setWidth(49, Sizeable.Unit.PIXELS);
carRating.setHeight(49, Sizeable.Unit.PIXELS);
layout.addComponent(carRating);
return layout;
}
示例6: initInputField
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
protected void initInputField() {
// Csslayout is used to style inputtext as rounded
CssLayout csslayout = new CssLayout();
csslayout.setHeight(24, UNITS_PIXELS);
csslayout.setWidth(100, UNITS_PERCENTAGE);
layout.addComponent(csslayout);
inputField = new TextField();
inputField.setWidth(100, UNITS_PERCENTAGE);
inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
inputField.focus();
csslayout.addComponent(inputField);
layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
layout.setExpandRatio(csslayout, 1.0f);
}
示例7: createContentWrapper
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private Component createContentWrapper(String slotStyle, Component toolBar, Component content) {
CssLayout slot = new CssLayout();
slot.setWidth("100%");
slot.addStyleName(slotStyle);
CssLayout card = new CssLayout();
card.setWidth("100%");
card.addStyleName(ValoTheme.LAYOUT_CARD);
if(toolBar instanceof SlotToolBar) {
((SlotToolBar)toolBar).setSlot(slot);
}
card.addComponents(toolBar, content);
slot.addComponent(card);
return slot;
}
示例8: createCompositionRoot
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
protected CssLayout createCompositionRoot() {
CssLayout layout = new CssLayout();
layout.addStyleName(ValoTheme.MENU_PART);
if (largeIcons) {
layout.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
}
layout.setWidth(null);
layout.setHeight("100%");
if (logo != null) {
layout.addComponent(logo);
}
if (headerLayout != null) {
layout.addComponent(headerLayout);
}
return layout;
}
示例9: createLegendBox
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
protected final ComponentContainer createLegendBox() {
final CssLayout mainLayout = new CssLayout();
mainLayout.setWidth("100%");
mainLayout.addStyleName("legendBoxContent");
final List series = dataSet.getSeries();
for (int i = 0; i < series.size(); i++) {
final MHorizontalLayout layout = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true));
layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
final TimeSeries key = (TimeSeries) series.get(i);
int colorIndex = i % CHART_COLOR_STR.size();
final String color = "<div style = \" width:13px;height:13px;background: #" + CHART_COLOR_STR.get(colorIndex) + "\" />";
final ELabel lblCircle = ELabel.html(color);
String captionBtn = UserUIContext.getMessage(StatusI18nEnum.class, (String) key.getKey());
final MButton btnLink = new MButton(StringUtils.trim(captionBtn, 30, true)).withDescription
(captionBtn).withStyleName(WebThemes.BUTTON_LINK);
layout.with(lblCircle, btnLink);
mainLayout.addComponent(layout);
}
return mainLayout;
}
示例10: CrmSettingContainer
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
public CrmSettingContainer() {
this.setWidth("100%");
final CssLayout contentWrapper = new CssLayout();
contentWrapper.setWidth("100%");
this.addComponent(contentWrapper);
settingTab = new VerticalTabsheet();
settingTab.setSizeFull();
settingTab.setNavigatorWidth("250px");
settingTab.setNavigatorStyleName("sidebar-menu");
settingTab.setHeight(null);
buildComponents();
contentWrapper.addComponent(settingTab);
}
示例11: displayChart
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
final protected void displayChart() {
removeAllComponents();
final JFreeChart chart = createChart();
final JFreeChartWrapper chartWrapper = new JFreeChartWrapper(chart);
final CssLayout borderWrap = new CssLayout();
borderWrap.addComponent(chartWrapper);
borderWrap.setStyleName("chart-wrapper");
borderWrap.setHeight(height + "px");
borderWrap.setWidth(width + "px");
chartWrapper.setHeight(height + "px");
chartWrapper.setWidth(width + "px");
chartWrapper.setGraphHeight(height);
chartWrapper.setGraphWidth(width);
this.addComponent(borderWrap);
final Component legendBox = createLegendBox();
if (legendBox != null) {
this.addComponent(legendBox);
}
}
示例12: postConstruct
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
public void postConstruct() {
super.postConstruct();
content = new CssLayout();
content.setWidth("100%");
setCompositionRoot(content);
final CssLayout wrap = new CssLayout();
wrap.setWidth("100%");
content.addComponent(wrap);
final Label caption = new Label("This is Home View");
caption.addStyleName(ValoTheme.LABEL_H1);
wrap.addComponent(caption);
button = new Button("Click me");
wrap.addComponent(button);
}
示例13: createMessage
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
/**
* Create a new item into the queue. It is not visible until added with
*/
protected Message createMessage(final Component component, String style) {
final Message m = new Message();
// Wrap to a CssLayout (this is needed for styling and sizing correctly)
CssLayout css = new CssLayout();
css.setWidth("100%");
css.setStyleName(Notifique.STYLE_ITEM);
css.addStyleName(style != null ? style : Styles.MESSAGE);
css.addComponent(component);
// Wrap component into an animator
m.component = component;
m.animatedContent = css;
return m;
}
示例14: buildContent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
public Component buildContent() {
final CssLayout menuContent = new CssLayout();
menuContent.addStyleName("sidebar");
menuContent.addStyleName(ValoTheme.MENU_PART);
menuContent.addStyleName("no-vertical-drag-hints");
menuContent.addStyleName("no-horizontal-drag-hints");
menuContent.setWidth(null);
menuContent.setHeight("100%");
// menuContent.addComponent(buildTitle());
menuContent.addComponent(buildUserMenu());
menuContent.addComponent(buildToggleButton());
menuContent.addComponent(buildMenuItems());
content = menuContent;
return menuContent;
}
示例15: initDummyContent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private void initDummyContent() {
CssLayout card = new CssLayout();
card.setWidth(100, Unit.PERCENTAGE);
card.setHeight(320, Unit.PIXELS);
card.addStyleName("card");
card.addStyleName(Margins.All.LARGE);
content.addComponent(card);
}