Example usage for com.vaadin.ui VerticalLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:org.vaadin.tori.view.edit.EditViewImpl.java

License:Apache License

private Component buildEmailPreferences() {
    VerticalLayout result = new VerticalLayout();
    result.addStyleName("preferenceslayout");
    result.setSpacing(true);/*from ww w  .j a  v a 2  s .c o  m*/
    result.setMargin(true);

    result.addComponent(buildUseToriMailService());
    result.addComponent(buildEmailFromAddress());
    result.addComponent(buildEmailFromName());
    result.addComponent(buildEmailReplyToAddress());
    result.addComponent(buildEmailHeaderImageURL());

    return result;
}

From source file:org.vaadin.tori.view.edit.EditViewImpl.java

License:Apache License

private Component buildGeneralPreferences() {
    VerticalLayout result = new VerticalLayout();
    result.addStyleName("preferenceslayout");
    result.setSpacing(true);/*from   w w w .  j  av a 2 s .  co  m*/
    result.setMargin(true);

    result.addComponent(buildForumTitle());
    result.addComponent(buildUpdateTitle());
    result.addComponent(buildGAField());
    result.addComponent(buildShowThreadsOnDashboard());
    result.addComponent(buildMayNotreplyNote());
    result.addComponent(buildReplaceLinks());
    result.addComponent(buildReplacements());
    return result;
}

From source file:pt.ist.vaadinframework.ui.ApplicationWindow.java

License:Open Source License

public ApplicationWindow(String theme, Property applicationTitle, Property applicationSubtitle,
        Property copyright) {//from  w ww.j  a va2s .  c om
    setTheme(theme);
    this.applicationTitle = applicationTitle;
    this.applicationSubtitle = applicationSubtitle;
    this.copyright = copyright;
    VerticalLayout main = new VerticalLayout();
    main.setWidth(90, UNITS_PERCENTAGE);
    main.setHeight(98, UNITS_PERCENTAGE);
    main.addStyleName("application-container");

    VerticalLayout header = new VerticalLayout();
    header.setMargin(true, true, false, true);
    header.setSpacing(true);
    main.addComponent(header);
    HorizontalLayout iconAndTitle = new HorizontalLayout();
    iconAndTitle.setSizeFull();
    iconAndTitle.setSpacing(true);
    header.addComponent(iconAndTitle);
    Embedded logo = new Embedded(null, new ThemeResource("../runo/icons/64/globe.png"));
    iconAndTitle.addComponent(logo);
    iconAndTitle.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);

    VerticalLayout titles = new VerticalLayout();
    titles.setSpacing(true);
    iconAndTitle.addComponent(titles);
    iconAndTitle.setExpandRatio(titles, 0.8f);
    Label title = new Label(applicationTitle);
    title.addStyleName("application-title");
    titles.addComponent(title);
    Label subtitle = new Label(applicationSubtitle);
    subtitle.addStyleName("application-subtitle");
    titles.addComponent(subtitle);

    HorizontalLayout controls = new HorizontalLayout();
    controls.setSpacing(true);
    iconAndTitle.addComponent(controls);
    iconAndTitle.setComponentAlignment(controls, Alignment.TOP_RIGHT);
    Label user = new Label("ist148357");
    controls.addComponent(user);
    Link logout = new Link("logout", new ExternalResource("#"));
    controls.addComponent(logout);

    MenuBar menu = new MenuBar();
    menu.addStyleName("application-menu");
    header.addComponent(menu);
    MenuItem hello = menu.addItem("hello", null);
    hello.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });
    MenuItem hello1 = menu.addItem("hello", null);
    hello1.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });
    MenuItem hello2 = menu.addItem("hello", null);
    hello2.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });

    body = new VerticalLayout();
    body.setSizeFull();
    body.setMargin(true);
    body.addStyleName("application-body");
    main.addComponent(body);
    main.setExpandRatio(body, 1f);
    body.addComponent(createDefaultPageBody());

    VerticalLayout footer = new VerticalLayout();
    main.addComponent(footer);
    main.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
    Label copyrightLabel = new Label(copyright);
    copyrightLabel.setSizeUndefined();
    copyrightLabel.addStyleName("application-footer");
    footer.addComponent(copyrightLabel);
    footer.setComponentAlignment(copyrightLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout outer = (VerticalLayout) getContent();
    outer.setSizeFull();
    outer.addComponent(main);
    outer.setComponentAlignment(main, Alignment.MIDDLE_CENTER);
}

From source file:rs.co.micro.bwNet.main.java

public main() {

    //Layout/*ww w.ja v  a2 s  .  c om*/
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.addStyleName("odvoji");
    layout.setSpacing(true);
    layout.setResponsive(true);
    layout.setId("oprem");

    //Prvo dugme
    Button conf = new Button("Configure");
    Button.ClickListener listener = new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            navigator.addView("configure", new configure());
            navigator.navigateTo("configure");
        }
    };
    conf.addClickListener(listener);

    //Drugo dugme
    Button log = new Button("Login");
    Button.ClickListener listener2 = new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            navigator.addView("login", new login());
            navigator.navigateTo("login");
        }
    };
    log.addClickListener(listener2);

    //Trece dugme
    Button wel = new Button("Welcome");
    Button.ClickListener listener3 = new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            navigator.addView("welcome", new welcome());
            navigator.navigateTo("welcome");
        }
    };
    wel.addClickListener(listener3);

    layout.addComponents(conf, log, wel);
    addComponent(layout);

}

From source file:tad.grupo7.ccamistadeslargas.LoginView.java

/**
 * Crea el formulario.//from  www  . j av a  2  s.  c o m
 */
private void buildLoginForm() {
    final VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSizeUndefined();
    loginPanel.setSpacing(true);
    Responsive.makeResponsive(loginPanel);
    loginPanel.addStyleName("login-panel");

    loginPanel.addComponent(buildFields());
    addComponent(loginPanel);
    setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
}

From source file:uicomponents.BarcodePreviewComponent.java

License:Open Source License

public BarcodePreviewComponent(SampleToBarcodeFieldTranslator translator) {
    this.translator = translator;
    setSpacing(true);//from   ww w  .  jav a2s.  co  m
    setMargin(true);

    Resource res = new ThemeResource("img/qrtest.png");
    Image qr = new Image(null, res);
    qr.setHeight("140px");
    qr.setWidth("140px");
    Image qr2 = new Image(null, res);
    qr2.setHeight("140px");
    qr2.setWidth("140px");

    code = new TextField();
    info1 = new TextField();
    info2 = new TextField();

    codedName = new OptionGroup("Put ID on sticker:");
    codedName.addItems(Arrays.asList("QBiC ID", "Lab ID", "Secondary Name"));
    codedName.setImmediate(true);
    codedName.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    codedName.select("QBiC ID");

    code.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    code.setWidth("200px");
    code.addStyleName("barcode-large");

    styleInfoField(info1);
    styleInfoField(info2);
    styleInfoField(qbicInfo);

    VerticalLayout box = new VerticalLayout();
    box.setHeight("110px");
    box.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    box.addComponent(code);
    box.addComponent(info1);
    box.addComponent(info2);
    box.addComponent(qbicInfo);
    box.setWidth("190px");

    HorizontalLayout test = new HorizontalLayout();
    test.setSizeFull();
    test.addComponent(qr);
    test.addComponent(box);
    test.addComponent(qr2);

    setFieldsReadOnly(true);
    List<String> options = new ArrayList<String>(Arrays.asList("Tissue/Extr. Material", "Secondary Name",
            "QBiC ID", "Lab ID", "MHC Type", "Used Antibody"));
    select1 = new ComboBox("First Info", options);
    select1.setStyleName(Styles.boxTheme);
    select1.setImmediate(true);
    select1.select("Tissue/Extr. Material");
    select2 = new ComboBox("Second Info", options);
    select2.select("Secondary Name");
    select2.setImmediate(true);
    select2.setStyleName(Styles.boxTheme);

    ValueChangeListener vc = new ValueChangeListener() {

        /**
         * 
         */
        private static final long serialVersionUID = -7466519211904860012L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            refresh();
        }
    };
    codedName.addValueChangeListener(vc);
    select1.addValueChangeListener(vc);
    select2.addValueChangeListener(vc);

    HorizontalLayout designBox = new HorizontalLayout();
    designBox.addComponent(select1);
    designBox.addComponent(select2);
    designBox.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    designBox.setSpacing(true);

    VerticalLayout previewBox = new VerticalLayout();
    previewBox.setStyleName(ValoTheme.LAYOUT_CARD);
    previewBox.setCaption("Barcode Example");
    previewBox.addComponent(test);

    addComponent(previewBox);
    addComponent(codedName);
    addComponent(designBox);

    //    overwrite = new CheckBox("Overwrite existing Tube Barcode Files");
    //    addComponent(ProjectwizardUI.questionize(overwrite,
    //        "Overwrites existing files of barcode stickers. This is useful when "
    //            + "the design was changed after creating them.", "Overwrite Sticker Files"));
}

From source file:uk.co.intec.keyDatesApp.pages.MainView.java

License:Apache License

/**
 * Removes any existing row data loaded to the page and loads
 * ViewEntryWrappers passed to this method. If no entries were passed to the
 * method, the message "No entries found matching criteria" is displayed.
 * Otherwise writes the entries to the page, grouped under the date each Key
 * Date is for.//w  w w. j ava 2s.  c o m
 *
 * @param data
 *            Map of data where key is a java.sql.Date (so does not include
 *            a time element) and value is the wrapped ViewEntries for that
 *            date.
 */
public void loadRowData(final Map<Object, List<ViewEntryWrapper>> data) {
    body.removeAllComponents();
    if (null == data || data.isEmpty()) {
        final Label msg = new Label("No entries found matching criteria");
        msg.setStyleName(ValoTheme.LABEL_FAILURE);
        body.addComponent(msg);
    } else {
        for (final Object key : data.keySet()) {
            if (key instanceof java.sql.Date) { // It will be!
                // Add the header
                final VerticalLayout catContainer = new VerticalLayout();
                catContainer.addStyleName(ValoTheme.MENU_TITLE);
                catContainer.addStyleName("category-header");
                final Label category = new Label();
                final java.sql.Date sqlDate = (java.sql.Date) key;
                category.setValue(DATE_ONLY.format(sqlDate));
                catContainer.addComponent(category);
                body.addComponent(catContainer);

                // Load the entries
                for (final ViewEntryWrapper veWrapped : data.get(key)) {
                    final VerticalLayout entryRow = new VerticalLayout();
                    final KeyDateEntryWrapper entry = (KeyDateEntryWrapper) veWrapped;
                    final StringBuilder suffixTitle = new StringBuilder("");
                    if (getViewWrapper().getViewName().equals(KeyDateViewWrapper.ViewType.BY_DATE)) {
                        if (StringUtils.isNotEmpty(entry.getCustomer())) {
                            suffixTitle.append(" (" + entry.getCustomer());
                            if (StringUtils.isNotEmpty(entry.getContact())) {
                                suffixTitle.append(" - " + entry.getContact());
                            }
                            suffixTitle.append(")");
                        }
                    } else {
                        if (StringUtils.isNotEmpty(entry.getContact())) {
                            suffixTitle.append(" - " + entry.getContact());
                        }
                    }
                    final Button title = new Button(entry.getTitle() + suffixTitle.toString());
                    title.addStyleName(ValoTheme.BUTTON_LINK);
                    // Add click event
                    title.addClickListener(new DocLinkListener(KeyDateView.VIEW_NAME, entry.getNoteId()));
                    entryRow.addComponent(title);

                    // Add summary, if appropriate
                    if (StringUtils.isNotEmpty(entry.getDescription())) {
                        final Label summary = new Label(entry.getDescription());
                        summary.setContentMode(ContentMode.HTML);
                        summary.addStyleName(ValoTheme.LABEL_SMALL);
                        summary.addStyleName("view-desc");
                        entryRow.addComponent(summary);
                    }

                    body.addComponent(entryRow);
                }
            }
        }

    }
}