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


Java CssLayout類代碼示例

本文整理匯總了Java中com.vaadin.ui.CssLayout的典型用法代碼示例。如果您正苦於以下問題:Java CssLayout類的具體用法?Java CssLayout怎麽用?Java CssLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CssLayout類屬於com.vaadin.ui包,在下文中一共展示了CssLayout類的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: createTabSheet

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
private TabSheet createTabSheet(boolean lightTheme, boolean captions, boolean icons) {
    TabSheet tabs = new TabSheet();
    tabs.setPrimaryStyleName(lightTheme ? "md-tabsheet-light" : "md-tabsheet-dark");
    tabs.addStyleName("card" + " " + Paddings.Horizontal.LARGE);
    if (!lightTheme) {
        tabs.addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle());
    }

    if (captions && icons) {
        tabs.addTab(new CssLayout(), "Item One", MaterialIcons.PHONE);
        tabs.addTab(new CssLayout(), "Item Two", MaterialIcons.FAVORITE);
        tabs.addTab(new CssLayout(), "Item Three", MaterialIcons.NEAR_ME);
    } else if (captions) {
        tabs.addTab(new CssLayout(), "Item One");
        tabs.addTab(new CssLayout(), "Item Two");
        tabs.addTab(new CssLayout(), "Item Three");
    } else if (icons) {
        tabs.addTab(new CssLayout(), null, MaterialIcons.PHONE);
        tabs.addTab(new CssLayout(), null, MaterialIcons.FAVORITE);
        tabs.addTab(new CssLayout(), null, MaterialIcons.NEAR_ME);
    }

    return tabs;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:25,代碼來源:TabsView.java

示例4: createDateTimeFields

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
private CssLayout createDateTimeFields(boolean light) {
    MDDateTimeField tf1 = createDateTimeField("Floating label", null, null, null, true, light);
    MDDateTimeField tf2 = createDateTimeField("Hint text", null, null, null, false, light);
    MDDateTimeField tf3 = createDateTimeField("Floating label with icon and helper", "Helper information goes here!", "Empty value not allowed", MaterialIcons.INPUT, true, light);
    MDDateTimeField tf4 = createDateTimeField("Hint text with icon and helper", "Helper information goes here!", "Empty value not allowed", MaterialIcons.INPUT, false, light);
    MDDateTimeField tf5 = createDateTimeField("Floating label", "Helper information goes here!", "Empty value not allowed", null, true, light);
    tf5.setEnabled(false);

    FlexLayout card = new FlexLayout(tf1, tf2, tf3, tf4, tf5);
    card.setFlexDirection(FlexLayout.FlexDirection.COLUMN);
    card.addStyleName("card");
    card.addStyleName(Paddings.All.LARGE);
    card.addStyleName(Spacings.Bottom.LARGE);
    if (!light) card.addStyleName(MaterialColor.GREY_900.getBackgroundColorStyle());
    card.setWidth(100, Unit.PERCENTAGE);

    return card;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:19,代碼來源:MenusView.java

示例5: createDateFields

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
private CssLayout createDateFields(boolean light) {
    MDDateField tf1 = createDateField("Floating label", null, null, null, true, light);
    MDDateField tf2 = createDateField("Hint text", null, null, null, false, light);
    MDDateField tf3 = createDateField("Floating label with icon and helper", "Helper information goes here!", "Empty value not allowed", MaterialIcons.INPUT, true, light);
    MDDateField tf4 = createDateField("Hint text with icon and helper", "Helper information goes here!", "Empty value not allowed", MaterialIcons.INPUT, false, light);
    MDDateField tf5 = createDateField("Floating label", "Helper information goes here!", "Empty value not allowed", null, true, light);
    tf5.setEnabled(false);

    FlexLayout card = new FlexLayout(tf1, tf2, tf3, tf4, tf5);
    card.setFlexDirection(FlexLayout.FlexDirection.COLUMN);
    card.addStyleName("card");
    card.addStyleName(Paddings.All.LARGE);
    card.addStyleName(Spacings.Bottom.LARGE);
    if (!light) card.addStyleName(MaterialColor.GREY_900.getBackgroundColorStyle());
    card.setWidth(100, Unit.PERCENTAGE);

    return card;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:19,代碼來源:MenusView.java

示例6: DataTablesView

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
public DataTablesView() {
    setFlexDirection(FlexDirection.COLUMN);
    setAlignSelf(AlignSelf.BASELINE);
    addStyleName(Margins.All.LARGE);
    addStyleName(Spacings.Bottom.LARGE);
    setWidth(100, Unit.PERCENTAGE);

    Grid g1 = createGrid();
    CssLayout c1 = createCard(g1);

    Grid g2 = createGrid();
    DataTableHeader h2 = new DataTableHeader("Nutrition", g2);
    CssLayout c2 = createCard(h2, g2);

    addComponents(c1, c2);
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:17,代碼來源:DataTablesView.java

示例7: init

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
@Override
protected void init(VaadinRequest vaadinRequest) {
    root = new CssLayout(appBar, navigationDrawer, content);
    root.setPrimaryStyleName("root");
    root.setSizeFull();
    Responsive.makeResponsive(root);
    setContent(root);

    appBar.getNaviIcon().addClickListener(event -> navigationDrawer.toggle());

    content.setPrimaryStyleName("content");
    content.setSizeFull();

    initNavigationItems();
    initDummyContent();
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:17,代碼來源:DemoUI.java

示例8: 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

示例9: init

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
@PostConstruct
void init() {
  Label header = new Label("Control Panel");
  header.setStyleName(ValoTheme.LABEL_H1);
  addComponent(header);

  dashboard = new CssLayout();
  dashboard.setSizeFull();

  widgetMap = new HashMap<>();

  panelMap = new HashMap<>();

  generateDashboard();

  addComponent(dashboard);

  ui.setPollInterval(2000);
  ui.addPollListener(event -> {
    generateDashboard();
  });
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:23,代碼來源:ControlPanelView.java

示例10: 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

示例11: 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

示例12: 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

示例13: buildUI

import com.vaadin.ui.CssLayout; //導入依賴的package包/類
private void buildUI() {
    addStyleName(DSTheme.LOGIN_SCREEN);

    // login form, centered in the available part of the screen
    loginForm = buildLoginForm();

    newUserForm = buildNewUserForm();

    // layout to center login form when there is sufficient screen space
    // - see the theme for how this is made responsive for various screen sizes
    centeringLayout = new VerticalLayout();
    centeringLayout.setStyleName(DSTheme.LOGIN_CENTERING_LAYOUT);
    centeringLayout.addComponent(loginForm);
    centeringLayout.setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER);
    centeringLayout.addComponentAttachListener(event -> {
        if (event.getAttachedComponent() instanceof Translatable) {
            ((Translatable) event.getAttachedComponent()).updateMessageStrings();
        }
    });

    // information text about logging in
    CssLayout loginInformation = buildLoginInformation();

    addComponent(centeringLayout);
    addComponent(loginInformation);
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:27,代碼來源:LoginScreen.java

示例14: 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

示例15: 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


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