当前位置: 首页>>代码示例>>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;未经允许,请勿转载。