本文整理汇总了Java中com.vaadin.ui.CssLayout.addComponent方法的典型用法代码示例。如果您正苦于以下问题:Java CssLayout.addComponent方法的具体用法?Java CssLayout.addComponent怎么用?Java CssLayout.addComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.CssLayout
的用法示例。
在下文中一共展示了CssLayout.addComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {
final VerticalLayout rootLayout = new VerticalLayout();
rootLayout.setSizeFull();
setContent(rootLayout);
final CssLayout navigationBar = new CssLayout();
navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
navigationBar.addComponent(createNavigationButton("Demo View (Default)",
Constants.VIEW_DEFAULT));
navigationBar.addComponent(createNavigationButton("Stream View",
Constants.VIEW_STREAM));
rootLayout.addComponent(navigationBar);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
rootLayout.addComponent(springViewDisplay);
rootLayout.setExpandRatio(springViewDisplay, 1.0f);
}
示例2: buildSubmenu
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private void buildSubmenu(CssLayout submenu, Set<OSCViewProvider<?>> views) {
for (final OSCViewProvider<?> view : views) {
String viewName = view.getName();
NativeButton b = new NativeButton(viewName);
// selecting default menu button
if (view.getName().equals(VIEW_FRAGMENT_ALERTS)) {
b.addStyleName("selected");
}
b.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
clearMenuSelection();
event.getButton().addStyleName("selected");
if (!MainUI.this.nav.getState().equals(viewName)) {
MainUI.this.nav.navigateTo(viewName);
}
}
});
submenu.setSizeFull();
submenu.addComponent(b);
}
}
示例3: getTestComponent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
@Override
public Component getTestComponent() {
CssLayout cssLayout = new CssLayout();
Form form = new Form()
.row(new TextFieldGroup().withCaption("Row 1, Col 1"),
new TextFieldGroup().withCaption("Row 1, Col 2")).add()
.row(new TextFieldGroup("Row 2, Col 1"),
new TextFieldGroup("Row 2, Col 2"),
new TextFieldGroup("Row 2, Col 3").withDescription("Description here")).add()
.row(new TextFieldGroup("Row 3, Col 1").withFeedbackAndMode("Error", BootstrapMode.DANGER)).add();
try {
cssLayout.addComponent(form.create());
} catch (IOException e) {
e.printStackTrace();
}
return cssLayout;
}
示例4: 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;
}
示例5: buildLabels
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private Component buildLabels() {
CssLayout labels = new CssLayout();
labels.addStyleName("labels");
Label welcome = new Label("Welcome");
welcome.setSizeUndefined();
welcome.addStyleName(ValoTheme.LABEL_H4);
welcome.addStyleName(ValoTheme.LABEL_COLORED);
labels.addComponent(welcome);
Label title = new Label("QuickTickets Dashboard");
title.setSizeUndefined();
title.addStyleName(ValoTheme.LABEL_H3);
title.addStyleName(ValoTheme.LABEL_LIGHT);
labels.addComponent(title);
return labels;
}
示例6: 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;
}
示例7: initLayout
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
protected void initLayout() {
container = new CssLayout();
container.setSizeFull();
container.setPrimaryStyleName(CURRENCYFIELD_LAYOUT_STYLENAME);
container.addComponent(currencyLabel);
if (useWrapper()) {
ie9InputWrapper = new CssLayout(textField);
ie9InputWrapper.setSizeFull();
ie9InputWrapper.setPrimaryStyleName(IE9_INPUT_WRAP_STYLENAME);
container.addComponent(ie9InputWrapper);
} else {
container.addComponent(textField);
}
setFocusDelegate(textField);
}
示例8: initComponent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
public void initComponent(CubaTree component) {
componentComposition = new CssLayout();
componentComposition.setPrimaryStyleName("c-tree-composition");
componentComposition.setWidthUndefined();
componentComposition.addComponent(component);
component.setSizeFull();
component.addShortcutListener(new ShortcutListener("tableEnter", com.vaadin.event.ShortcutAction.KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
if (target == WebAbstractTree.this.component) {
if (enterPressAction != null) {
enterPressAction.actionPerform(WebAbstractTree.this);
} else {
handleClickAction();
}
}
}
});
}
示例9: LoginView
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
public LoginView() {
setSizeFull();
CssLayout rootLayout = new CssLayout();
rootLayout.addStyleName("login-screen");
Component loginForm = buildLoginForm();
VerticalLayout centeringLayout = new VerticalLayout();
centeringLayout.setStyleName("centering-layout");
centeringLayout.addComponent(loginForm);
centeringLayout.setComponentAlignment(loginForm,Alignment.MIDDLE_CENTER);
CssLayout loginInformation = buildLoginInformation();
rootLayout.addComponent(centeringLayout);
rootLayout.addComponent(loginInformation);
setCompositionRoot(rootLayout);
}
示例10: buildLabels
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
private Component buildLabels() {
CssLayout labels = new CssLayout();
labels.addStyleName("labels");
Label welcome = new Label("Log in");
welcome.setSizeUndefined();
welcome.addStyleName(ValoTheme.LABEL_H4);
welcome.addStyleName(ValoTheme.LABEL_COLORED);
labels.addComponent(welcome);
Label title = new Label("JAAS Demo");
title.setSizeUndefined();
title.addStyleName(ValoTheme.LABEL_H3);
title.addStyleName(ValoTheme.LABEL_LIGHT);
labels.addComponent(title);
return labels;
}
示例11: 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;
}
示例12: createRowItem
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
protected final void createRowItem(final ResponsiveRow row, final Button button, final String description) {
final CssLayout layout = new CssLayout();
layout.addStyleName("v-layout-content-overview-panel-level2");
Responsive.makeResponsive(layout);
layout.setSizeUndefined();
button.addStyleName("itembox");
button.addStyleName("title");
Responsive.makeResponsive(button);
button.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(button);
final Label descriptionLabel = new Label(description);
descriptionLabel.addStyleName("itembox");
Responsive.makeResponsive(descriptionLabel);
descriptionLabel.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(descriptionLabel);
row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE,DISPLAYS_SIZE_XM_DEVICE,DISPLAY_SIZE_MD_DEVICE,DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
示例13: createRowComponent
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
protected final void createRowComponent(final ResponsiveRow row, final Component component, final String description) {
final CssLayout layout = new CssLayout();
layout.addStyleName(".v-layout-content-pagemode-panel-level2");
Responsive.makeResponsive(layout);
layout.setSizeUndefined();
final Label descriptionLabel = new Label(description);
descriptionLabel.addStyleName("itembox");
Responsive.makeResponsive(descriptionLabel);
descriptionLabel.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(descriptionLabel);
component.addStyleName("itembox");
component.addStyleName("title");
Responsive.makeResponsive(component);
component.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(component);
row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE,DISPLAYS_SIZE_XM_DEVICE,DISPLAY_SIZE_MD_DEVICE,DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
示例14: DetailPanel
import com.vaadin.ui.CssLayout; //导入方法依赖的package包/类
public DetailPanel() {
setSizeFull();
addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
setMargin(true);
CssLayout cssLayout = new CssLayout(); // Needed for rounded corners
cssLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
cssLayout.setSizeFull();
super.addComponent(cssLayout);
mainPanel = new Panel();
mainPanel.addStyleName(Reindeer.PANEL_LIGHT);
mainPanel.setSizeFull();
cssLayout.addComponent(mainPanel);
// Use default layout
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setWidth(100, UNITS_PERCENTAGE);
verticalLayout.setMargin(true);
mainPanel.setContent(verticalLayout);
}
示例15: 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);
}