Example usage for com.vaadin.ui HorizontalLayout addStyleName

List of usage examples for com.vaadin.ui HorizontalLayout addStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout addStyleName.

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:it.vige.greenarea.bpm.custom.ui.form.VeicoliCollectionFormPropertyRenderer.java

License:Apache License

@Override
protected HorizontalLayout getButtons(final String item, final Table table) {
    FormProperty operations = getOperations();
    @SuppressWarnings("unchecked")
    Map<String, String> mapOperations = (Map<String, String>) operations.getType().getInformation("values");

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);// www .  j  a v  a  2  s.  c om
    buttons.setWidth(20, UNITS_PIXELS);
    buttons.addStyleName(STYLE_DETAIL_BLOCK);
    for (String operation : mapOperations.keySet()) {
        if (operation.equals(MODIFICA.name())) {
            addButton(operation, buttons, item, table);
        }
    }

    Label buttonSpacer = new Label();
    buttons.addComponent(buttonSpacer);
    buttons.setExpandRatio(buttonSpacer, 1.0f);
    return buttons;
}

From source file:jp.primecloud.auto.ui.ServerDescBasic.java

License:Open Source License

public ServerDescBasic() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);/*from w  w w .j a  va2  s . c  o m*/

    VerticalLayout panel = (VerticalLayout) getContent();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setMargin(true);
    panel.setSpacing(false);
    panel.addStyleName("server-desc-basic");

    HorizontalLayout hlPanels = new HorizontalLayout();
    hlPanels.setWidth("100%");
    hlPanels.setHeight("100%");
    hlPanels.setMargin(true);
    hlPanels.setSpacing(true);
    hlPanels.addStyleName("server-desc-basic");
    //        setContent(hlPanels);

    left.setWidth("100%");
    right.setHeight("100%");
    right.setWidth("100%");

    //????
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");

    Label padding2 = new Label("");
    padding2.setWidth("1px");

    hlPanels.addComponent(left);
    hlPanels.addComponent(padding);
    hlPanels.addComponent(padding2);
    hlPanels.addComponent(right);
    hlPanels.setExpandRatio(left, 40);
    hlPanels.setExpandRatio(right, 60);

    panel.addComponent(hlPanels);
    panel.setExpandRatio(hlPanels, 1.0f);

}

From source file:jp.primecloud.auto.ui.ServerDescDetail.java

License:Open Source License

public ServerDescDetail() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);/*  ww w.j av  a  2 s . com*/

    VerticalLayout panel = (VerticalLayout) getContent();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setMargin(true);
    panel.setSpacing(false);
    panel.addStyleName("server-desc-detail");

    HorizontalLayout hlPanels = new HorizontalLayout();
    hlPanels.setWidth("100%");
    hlPanels.setHeight("100%");
    hlPanels.setMargin(true);
    hlPanels.setSpacing(true);
    hlPanels.addStyleName("server-desc-detail");
    //        setContent(hlPanels);

    left.setWidth("200px");
    right.setWidth("100%");
    right.setHeight("100%");

    hlPanels.addComponent(left);
    hlPanels.addComponent(right);

    hlPanels.setExpandRatio(right, 100);

    panel.addComponent(hlPanels);
    panel.setExpandRatio(hlPanels, 1.0f);
}

From source file:jp.primecloud.auto.ui.ServiceDescBasic.java

License:Open Source License

public ServiceDescBasic() {

    addStyleName(Reindeer.PANEL_LIGHT);//from   ww w. j a  v  a 2 s . c om

    setHeight("100%");

    HorizontalLayout hlPanels = new HorizontalLayout();
    hlPanels.setWidth("100%");
    hlPanels.setHeight("100%");
    hlPanels.setMargin(true);
    hlPanels.setSpacing(true);
    hlPanels.addStyleName("service-desc-basic");
    setContent(hlPanels);

    left.setWidth("100%");
    right.setWidth("100%");

    //????
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");

    Label padding2 = new Label("");
    padding2.setWidth("1px");

    VerticalLayout layLeft = new VerticalLayout();
    layLeft.setMargin(false);
    layLeft.setSpacing(false);
    layLeft.setWidth("100%");
    layLeft.setHeight("100%");
    layLeft.addComponent(left);
    layLeft.setExpandRatio(left, 1.0f);

    VerticalLayout layRight = new VerticalLayout();
    layRight.setMargin(false);
    layRight.setSpacing(false);
    layRight.setWidth("100%");
    layRight.setHeight("100%");
    layRight.addComponent(right);
    layRight.addComponent(serverOpe);
    layRight.setExpandRatio(right, 1.0f);

    hlPanels.addComponent(layLeft);
    hlPanels.addComponent(padding);
    hlPanels.addComponent(padding2);
    hlPanels.addComponent(layRight);
    hlPanels.setExpandRatio(layLeft, 40);
    hlPanels.setExpandRatio(layRight, 60);
}

From source file:jp.primecloud.auto.ui.ServiceDescDetail.java

License:Open Source License

public ServiceDescDetail() {
    addStyleName(Reindeer.PANEL_LIGHT);//w ww. j  a v  a  2s  .  com
    setHeight("100%");

    HorizontalLayout hlPanels = new HorizontalLayout();
    hlPanels.setWidth("100%");
    hlPanels.setHeight("100%");
    hlPanels.setMargin(true);
    hlPanels.setSpacing(true);
    hlPanels.addStyleName("service-desc-detail");
    setContent(hlPanels);

    left.setWidth("250px");
    right.setWidth("100%");
    right.setHeight("100%");

    VerticalLayout layLeft = new VerticalLayout();
    layLeft.setMargin(false);
    layLeft.setSpacing(false);
    layLeft.setWidth("250px");
    layLeft.setHeight("100%");
    layLeft.addComponent(left);
    layLeft.setExpandRatio(left, 1.0f);

    hlPanels.addComponent(layLeft);
    hlPanels.addComponent(right);

    hlPanels.setExpandRatio(right, 100);

}

From source file:lv.polarisit.demosidemenu.ValoThemeUI.java

License:Apache License

CssLayout buildMenu() {
    // Add items/*www.j  a  va  2 s. co m*/
    menuItems.put("MessageView", "First Message");
    menuItems.put("MessageView1", "Second Message");
    /*
    menuItems.put("labels", "Labels");
    menuItems.put("buttons-and-links", "Buttons & Links");
    menuItems.put("textfields", "Text Fields");
    menuItems.put("datefields", "Date Fields");
    menuItems.put("comboboxes", "Combo Boxes");
    menuItems.put("selects", "Selects");
    menuItems.put("checkboxes", "Check Boxes & Option Groups");
    menuItems.put("sliders", "Sliders & Progress Bars");
    menuItems.put("colorpickers", "Color Pickers");
    menuItems.put("menubars", "Menu Bars");
    menuItems.put("trees", "Trees");
    menuItems.put("tables", "Tables");
    menuItems.put("dragging", "Drag and Drop");
    menuItems.put("panels", "Panels");
    menuItems.put("splitpanels", "Split Panels");
    menuItems.put("tabs", "Tabs");
    menuItems.put("accordions", "Accordions");
    menuItems.put("popupviews", "Popup Views");
    // menuItems.put("calendar", "Calendar");
    menuItems.put("forms", "Forms");
    */
    final HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName("valo-menu-title");
    menu.addComponent(top);
    menu.addComponent(createThemeSelect());

    final Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (menu.getStyleName().contains("valo-menu-visible")) {
                menu.removeStyleName("valo-menu-visible");
            } else {
                menu.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    menu.addComponent(showMenu);

    final Label title = new Label("<h3>Vaadin <strong>Valo Theme</strong></h3>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);

    final MenuBar settings = new MenuBar();
    settings.addStyleName("user-menu");
    /*
    final StringGenerator sg = new StringGenerator();
    final MenuItem settingsItem = settings.addItem(sg.nextString(true)
        + " " + sg.nextString(true) + sg.nextString(false),
        new ThemeResource("../tests-valo/img/profile-pic-300px.jpg"),
        null);
            
    settingsItem.addItem("Edit Profile", null);
    settingsItem.addItem("Preferences", null);
    settingsItem.addSeparator();
    settingsItem.addItem("Sign Out", null);
                */
    menu.addComponent(settings);

    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);

    Label label = null;
    int count = -1;
    for (final Entry<String, String> item : menuItems.entrySet()) {
        if (item.getKey().equals("labels")) {
            label = new Label("Components", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        if (item.getKey().equals("panels")) {
            label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");
            count = 0;
            label = new Label("Containers", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        if (item.getKey().equals("forms")) {
            label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");
            count = 0;
            label = new Label("Other", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        final Button b = new Button(item.getValue(), new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        if (count == 2) {
            b.setCaption(b.getCaption() + " <span class=\"valo-menu-badge\">123</span>");
        }
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName("valo-menu-item");
        //            b.setIcon(testIcon.get());
        menuItemsLayout.addComponent(b);
        count++;
    }
    if (label != null)
        label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");

    return menu;
}

From source file:me.uni.emuseo.view.common.form.FormWithButtonsLayout.java

License:Open Source License

protected HorizontalLayout buildButtons() {

    final Button saveButton = new Button();
    final Button cancelButton = new Button();
    ClickListener clickListener = new ClickListener() {

        private static final long serialVersionUID = 5320702365033343873L;

        @Override//w  w  w .j  a  v  a  2 s  .  c  o  m
        public void buttonClick(ClickEvent event) {
            Button button = event.getButton();
            if (button.equals(saveButton)) {
                onPreSave();
            } else if (button.equals(cancelButton)) {
                onCancel();
            }
        }
    };
    HorizontalLayout buttonLayout = new HorizontalLayout();

    saveButton.addStyleName("primary");
    saveButton.setIcon(FontAwesome.SAVE);
    saveButton.addClickListener(clickListener);

    cancelButton.addStyleName("primary");
    cancelButton.setIcon(FontAwesome.UNDO);
    cancelButton.addClickListener(clickListener);

    buttonLayout.addComponent(saveButton);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.setSpacing(true);
    buttonLayout.addStyleName("form-buttons");

    return buttonLayout;
}

From source file:me.uni.emuseo.view.menu.MenuView.java

License:Open Source License

private CssLayout buildMenu() {
    // Add items//from   w  w  w.  j  av  a2  s  .c o  m
    if (authManager.isAuthorizedTo(Permissions.MENU_USERS_VIEW)) {
        menuItems.put(Permissions.MENU_USERS_VIEW, "Uytkownicy");
    }
    if (authManager.isAuthorizedTo(Permissions.MENU_EXHIBIT_VIEW)) {
        menuItems.put(Permissions.MENU_EXHIBIT_VIEW, "Katalog eksponatw");
    }
    if (authManager.isAuthorizedTo(Permissions.MENU_CATEGORIES_VIEW)) {
        menuItems.put(Permissions.MENU_CATEGORIES_VIEW, "Kategorie");
    }
    if (authManager.isAuthorizedTo(Permissions.MENU_RESOURCES_VIEW)) {
        menuItems.put(Permissions.MENU_RESOURCES_VIEW, "Zasoby");
    }

    final HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName("valo-menu-title");
    menu.addComponent(top);
    final Button showMenu = new Button("Menu", new ClickListener() {
        private static final long serialVersionUID = -719702284721453362L;

        @Override
        public void buttonClick(final ClickEvent event) {
            if (menu.getStyleName().contains("valo-menu-visible")) {
                menu.removeStyleName("valo-menu-visible");
            } else {
                menu.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    menu.addComponent(showMenu);
    final Label title = new Label("<h3>e<strong>Museo</strong></h3>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    final MenuBar settings = new MenuBar();
    settings.addStyleName("user-menu");

    settingsItem = settings.addItem("Jan Kowalski", defaultIcon, null);
    if (authManager.isAuthorizedTo(Permissions.MENU_MY_ACCOUNT_VIEW)) {
        settingsItem.addItem("Moje konto", new MenuBar.Command() {
            private static final long serialVersionUID = 7015035735144235104L;

            @Override
            public void menuSelected(MenuItem selectedItem) {
                navigator.navigateTo(Permissions.MENU_MY_ACCOUNT_VIEW);
            }

        });
    }
    if (authManager.isAuthorizedTo(Permissions.MENU_SETTINGS_VIEW)) {
        settingsItem.addItem("Ustawienia", new MenuBar.Command() {
            private static final long serialVersionUID = 7015035735144235105L;

            @Override
            public void menuSelected(MenuItem selectedItem) {
                navigator.navigateTo(Permissions.MENU_SETTINGS_VIEW);
            }

        });
    }
    settingsItem.addSeparator();
    settingsItem.addItem("Wyloguj", new MenuBar.Command() {
        private static final long serialVersionUID = 1333473616079310225L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            final AuthManager authManager = EMuseoUtil.getAppContext().getBean(AuthManager.class);
            authManager.logout();
        }
    });
    menu.addComponent(settings);
    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);

    for (final Entry<String, String> item : menuItems.entrySet()) {
        FontIcon icon = null;
        if (item.getKey().equals(Permissions.MENU_USERS_VIEW)) {
            icon = FontAwesome.USERS;
        } else if (item.getKey().endsWith(Permissions.MENU_EXHIBIT_VIEW)) {
            icon = FontAwesome.UNIVERSITY;
        } else if (item.getKey().endsWith(Permissions.MENU_CATEGORIES_VIEW)) {
            icon = FontAwesome.ARCHIVE;
        } else if (item.getKey().endsWith(Permissions.MENU_RESOURCES_VIEW)) {
            icon = FontAwesome.IMAGE;
        }
        final Button b = new Button(item.getValue(), new ClickListener() {
            private static final long serialVersionUID = -7089398070311521853L;

            @Override
            public void buttonClick(final ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName("valo-menu-item");
        if (icon != null) {
            b.setIcon(icon);
        }
        menuItemsLayout.addComponent(b);
    }
    return menu;
}

From source file:nl.kpmg.lcm.ui.view.administration.components.AuthorizedLcmCreateWindow.java

License:Apache License

private HorizontalLayout initNameLayout() {
    HorizontalLayout nameLayout = new HorizontalLayout();
    nameField.setRequired(true);//from  ww w .  j ava 2 s  .com
    nameField.setWidth("70%");
    nameLayout.setWidth("100%");
    nameLayout.addStyleName("margin-top-10");
    nameLayout.addComponent(nameField);
    return nameLayout;
}

From source file:nl.kpmg.lcm.ui.view.administration.components.AuthorizedLcmCreateWindow.java

License:Apache License

private HorizontalLayout initLcmIdLayout() {
    HorizontalLayout uniqeLcmIdLayout = new HorizontalLayout();
    uniqeLcmIdField.setRequired(true);/*from   ww w.  j  a v  a  2 s  .  c  o m*/
    uniqeLcmIdField.setWidth("70%");
    uniqeLcmIdLayout.setWidth("100%");
    uniqeLcmIdLayout.addStyleName("margin-top-10");
    uniqeLcmIdLayout.addComponent(uniqeLcmIdField);
    return uniqeLcmIdLayout;
}