Package com.vaadin.ui

Examples of com.vaadin.ui.CssLayout


    /**
     * Create new CssLayout with given caption and add it to current component
     * container.
     */
    public CssLayout csslayout(String caption) {
        CssLayout c = csslayout();
        c.setCaption(caption);
        return c;
    }
View Full Code Here


        panel.setIcon(testIcon.get());
        panel.addStyleName("well");
        panel.setContent(panelContent());
        row.addComponent(panel);

        CssLayout layout = new CssLayout();
        layout.setIcon(testIcon.get());
        layout.setCaption("Panel style layout");
        layout.addStyleName("card");
        layout.addComponent(panelContent());
        row.addComponent(layout);

        layout = new CssLayout();
        layout.addStyleName("card");
        row.addComponent(layout);
        HorizontalLayout panelCaption = new HorizontalLayout();
        panelCaption.addStyleName("v-panel-caption");
        panelCaption.setWidth("100%");
        // panelCaption.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
        Label label = new Label("Panel style layout");
        panelCaption.addComponent(label);
        panelCaption.setExpandRatio(label, 1);

        Button action = new Button();
        action.setIcon(FontAwesome.PENCIL);
        action.addStyleName("borderless-colored");
        action.addStyleName("small");
        action.addStyleName("icon-only");
        panelCaption.addComponent(action);
        MenuBar dropdown = new MenuBar();
        dropdown.addStyleName("borderless");
        dropdown.addStyleName("small");
        MenuItem addItem = dropdown.addItem("", FontAwesome.CHEVRON_DOWN, null);
        addItem.setStyleName("icon-only");
        addItem.addItem("Settings", null);
        addItem.addItem("Preferences", null);
        addItem.addSeparator();
        addItem.addItem("Sign Out", null);
        panelCaption.addComponent(dropdown);

        layout.addComponent(panelCaption);
        layout.addComponent(panelContent());
        layout.setWidth("14em");

        layout = new CssLayout();
        layout.setIcon(testIcon.get());
        layout.setCaption("Well style layout");
        layout.addStyleName("well");
        layout.addComponent(panelContent());
        row.addComponent(layout);
    }
View Full Code Here

        combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
        combo.setItemIcon(combo.getItemIds().iterator().next(),
                new ThemeResource("../runo/icons/16/document.png"));
        row.addComponent(combo);

        CssLayout group = new CssLayout();
        group.setCaption("Grouped with a Button");
        group.addStyleName("v-component-group");
        row.addComponent(group);

        combo = new ComboBox();
        combo.setInputPrompt("You can type here");
        combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false));
        combo.setNullSelectionAllowed(false);
        combo.select(combo.getItemIds().iterator().next());
        combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
        combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
        combo.setWidth("240px");
        group.addComponent(combo);
        Button today = new Button("Do It");
        group.addComponent(today);

        combo = new ComboBox("Explicit size");
        combo.setInputPrompt("You can type here");
        combo.addItem("Option One");
        combo.addItem("Option Two");
View Full Code Here

        content.setSpacing(true);
        content.setMargin(true);
        content.addComponent(new Label(
                "You can test the loading indicator by pressing the buttons."));

        CssLayout group = new CssLayout();
        group.setCaption("Show the loading indicator for…");
        group.addStyleName("v-component-group");
        content.addComponent(group);
        Button loading = new Button("0.8");
        loading.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    Thread.sleep(800);
                } catch (InterruptedException e) {
                }
            }
        });
        group.addComponent(loading);

        Button delay = new Button("3");
        delay.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                }
            }
        });
        group.addComponent(delay);

        Button wait = new Button("15");
        wait.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    Thread.sleep(15000);
                } catch (InterruptedException e) {
                }
            }
        });
        wait.addStyleName("last");
        group.addComponent(wait);
        Label label = new Label("   seconds", ContentMode.HTML);
        label.setSizeUndefined();
        group.addComponent(label);

        Label spinnerDesc = new Label(
                "The theme also provides a mixin that you can use to include a spinner anywhere in your application. Below is a Label with a custom style name, for which the spinner mixin is added.");
        spinnerDesc.addStyleName("small");
        spinnerDesc.setCaption("Spinner");
View Full Code Here

                style.addItem("Small", styleCommand).setCheckable(true);
                style.addItem("Closable", styleCommand).setCheckable(true);
                addComponent(style);
                style.addStyleName("small");

                CssLayout group = new CssLayout();
                group.setCaption("Fade delay");
                group.addStyleName("v-component-group");
                addComponent(group);

                delay.setInputPrompt("Infinite");
                delay.addStyleName("align-right");
                delay.addStyleName("small");
                delay.setWidth("7em");
                delay.addValueChangeListener(new ValueChangeListener() {
                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        try {
                            notification.setDelayMsec(Integer.parseInt(delay
                                    .getValue()));
                        } catch (Exception e) {
                            notification.setDelayMsec(-1);
                            delay.setValue("");
                        }

                    }
                });
                delay.setValue("1000");
                group.addComponent(delay);

                Button clear = new Button(null, new ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        delay.setValue("");
                    }
                });
                clear.setIcon(FontAwesome.TIMES_CIRCLE);
                clear.addStyleName("last");
                clear.addStyleName("small");
                clear.addStyleName("icon-only");
                group.addComponent(clear);
                group.addComponent(new Label("  msec", ContentMode.HTML));

                GridLayout grid = new GridLayout(3, 3);
                grid.setCaption("Show in position");
                addComponent(grid);
                grid.setSpacing(true);
View Full Code Here

        for (int i = 0; i < 100; ++i) {
            table.addItem(new Object[] { "" + i, "foo" }, i);
        }

        LegacyWindow main = getMainWindow();
        main.setContent(new CssLayout());
        main.addComponent(table);
    }
View Full Code Here

     *
     * @return Default content container
     */
    protected ComponentContainer createDefaultContent() {
        if (placeHolderComponent == null) {
            CssLayout layout = new CssLayout();
            layout.setStyleName("fancypanel-default-layout");
            layout.setSizeFull();
            placeHolderComponent = layout;
        }
        return placeHolderComponent;
    }
View Full Code Here

    private FancyNotifications notifications;

    private ComponentContainer buildLayout() {

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

        TabSheet tabs = new TabSheet();
        topLayout.addComponent(tabs);
        tabs.setSizeFull();

        tabs.addTab(buildWelcome(), "Welcome");
        tabs.addTab(new ImageDemo(), "FancyImage");
        tabs.addTab(new PanelDemo(), "FancyPanel");
        tabs.addTab(new CssLayoutDemo(), "FancyLayout");

        NotificationsDemo notDemo = new NotificationsDemo();
        tabs.addTab(notDemo, "FancyNotifications");

        // Add notification to top most UI elements you have. Then just give it
        // as reference to child components.
        notifications = new FancyNotifications();
        topLayout.addComponent(notifications);
        notDemo.init(notifications);

        return topLayout;
    }
View Full Code Here

    //
    // return layout;
    // }

    private ComponentContainer createPanelContentD() {
        CssLayout layout = new CssLayout();
        layout.addStyleName("demo-panel-d");
        layout.setWidth("100%");
        layout.setHeight("100%");

        Image image = new Image();
        image.setSource(new ThemeResource("images/meme.jpg"));
        image.addStyleName("demo-meme");
        layout.addComponent(image);

        return layout;
    }
View Full Code Here

    header.addComponent(getHeader());
    header.addComponent(getToolbar());
    mainLayout.addComponent(header);

    CssLayout margin = new CssLayout();
    margin.setMargin(false, true, true, true);
    margin.setSizeFull();
    tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    margin.addComponent(tabSheet);
    mainLayout.addComponent(margin);
    mainLayout.setExpandRatio(margin, 1);

    for (IViewContribution viewContribution : viewContributions) {
      tabSheet.addTab(viewContribution.getView(this), viewContribution.getName(), new ThemeResource(
View Full Code Here

TOP

Related Classes of com.vaadin.ui.CssLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.