當前位置: 首頁>>代碼示例>>Java>>正文


Java CssLayout.addComponent方法代碼示例

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

}
 
開發者ID:MikeQin,項目名稱:spring-boot-vaadin-rabbitmq-pipeline-demo,代碼行數:22,代碼來源:NavigatorUI.java

示例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);
    }
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:23,代碼來源:MainUI.java

示例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;
}
 
開發者ID:knoobie,項目名稱:bootstrap-formgroup,代碼行數:19,代碼來源:FormUI.java

示例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;
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:25,代碼來源:DashboardView.java

示例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;
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:18,代碼來源:LoginView.java

示例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;
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:17,代碼來源:DashboardMenu.java

示例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);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:20,代碼來源:CubaCurrencyField.java

示例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();
                }
            }
        }
    });
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:22,代碼來源:WebAbstractTree.java

示例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);
    
}
 
開發者ID:felixhusse,項目名稱:bookery,代碼行數:21,代碼來源:LoginView.java

示例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;
}
 
開發者ID:KrishnaPhani,項目名稱:KrishnasSpace,代碼行數:18,代碼來源:LoginUI.java

示例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;
}
 
開發者ID:datenhahn,項目名稱:componentrenderer,代碼行數:26,代碼來源:ViewComponents.java

示例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);
}
 
開發者ID:Hack23,項目名稱:cia,代碼行數:21,代碼來源:AbstractPageModContentFactoryImpl.java

示例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);
}
 
開發者ID:Hack23,項目名稱:cia,代碼行數:21,代碼來源:AbstractPageModContentFactoryImpl.java

示例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);
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:22,代碼來源:DetailPanel.java

示例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);
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:18,代碼來源:TaskListHeader.java


注:本文中的com.vaadin.ui.CssLayout.addComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。