Example usage for com.vaadin.ui Alignment MIDDLE_LEFT

List of usage examples for com.vaadin.ui Alignment MIDDLE_LEFT

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment MIDDLE_LEFT.

Prototype

Alignment MIDDLE_LEFT

To view the source code for com.vaadin.ui Alignment MIDDLE_LEFT.

Click Source Link

Usage

From source file:dhbw.clippinggorilla.userinterface.views.InterestProfileView.java

private void addRow(InterestProfile profile, boolean included, String value) {
    GridLayout tagLayout = new GridLayout(2, 1);
    tagLayout.setWidth("100%");

    Label labelTagName = new Label(value, ContentMode.HTML);
    labelTagName.setWidth("100%");
    labelTagName.addStyleName(ValoTheme.LABEL_H3);
    labelTagName.addStyleName(ValoTheme.LABEL_NO_MARGIN);

    Button buttonDeleteTag = new Button(VaadinIcons.TRASH);
    buttonDeleteTag.addStyleName(ValoTheme.BUTTON_DANGER);
    buttonDeleteTag.addClickListener(ev -> {
        profile.getTags().remove(value);
        if (included) {
            includedTagsLayouts.get(profile).removeComponent(tagLayout);
        } else {/*from  w w  w .j a  v  a  2  s  .  c om*/
            excludedTagsLayouts.get(profile).removeComponent(tagLayout);
        }
    });

    tagLayout.addComponents(labelTagName, buttonDeleteTag);
    tagLayout.setComponentAlignment(labelTagName, Alignment.MIDDLE_LEFT);
    tagLayout.setComponentAlignment(buttonDeleteTag, Alignment.MIDDLE_RIGHT);
    tagLayout.setWidth("100%");
    tagLayout.setColumnExpandRatio(0, 5);
    tagLayout.setSpacing(true);
    tagLayout.setMargin(false);

    if (included) {
        includedTagsLayouts.get(profile).addComponent(tagLayout, 2);
    } else {
        excludedTagsLayouts.get(profile).addComponent(tagLayout, 2);
    }
}

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

public GroupProfileWindow(GroupInterestProfile p, Runnable onClose, boolean isAdmin) {
    VerticalLayout profileSettingsLayout = new VerticalLayout();
    GridLayout windowContent;// w w w  . j a  v a 2  s.  co m
    Button buttonSave = new Button();

    if (isAdmin) {
        windowContent = new GridLayout(3, 3);

        TextField textFieldName = new TextField();
        Language.set(Word.NAME, textFieldName);
        textFieldName.setWidth("100%");
        textFieldName.setValue(p.getName());
        textFieldName.setMaxLength(255);

        Language.set(Word.SAVE, buttonSave);
        buttonSave.setIcon(VaadinIcons.CHECK);
        buttonSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
        buttonSave.addClickListener(ce -> {
            GroupInterestProfileUtils.changeName(p, textFieldName.getValue());
            GroupInterestProfileUtils.changeSources(p, p.getSources());
            GroupInterestProfileUtils.changeCategories(p, p.getCategories());
            GroupInterestProfileUtils.changeAllTags(p, p.getTags());
            VaadinUtils.infoNotification(Language.get(Word.SUCCESSFULLY_SAVED));
            close();
            onClose.run();
        });

        Label placeholder2 = new Label();
        placeholder2.setWidth("100%");
        windowContent.addComponents(textFieldName, placeholder2);
        windowContent.setComponentAlignment(textFieldName, Alignment.MIDDLE_LEFT);
        windowContent.addComponent(getSources(p, true), 0, 1, 1, 1);
        windowContent.addComponent(getCategories(p, true), 2, 1);
        windowContent.addComponent(getTags(p, true), 0, 2, 2, 2);
    } else {
        windowContent = new GridLayout(3, 2);

        Language.set(Word.CLOSE, buttonSave);
        buttonSave.setIcon(VaadinIcons.CLOSE);
        buttonSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
        buttonSave.addClickListener(ce -> {
            close();
            onClose.run();
        });

        windowContent.addComponent(getSources(p, false), 0, 0, 1, 0);
        windowContent.addComponent(getCategories(p, false), 2, 0);
        windowContent.addComponent(getTags(p, false), 0, 1, 2, 1);
    }

    buttonSave.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);

    Label placeholder = new Label();

    Label labelHelp = new Label(Language.get(Word.HELP_TEXT), ContentMode.HTML);
    labelHelp.setWidth("500px");
    PopupView popupHelp = new PopupView(null, labelHelp);

    Button buttonHelp = new Button(Language.get(Word.HELP), VaadinIcons.QUESTION);
    buttonHelp.addClickListener(ce -> {
        popupHelp.setPopupVisible(true);
    });

    GridLayout footer;
    if (isAdmin) {
        footer = new GridLayout(4, 1);
        footer.addComponents(buttonHelp, popupHelp, placeholder, buttonSave);
        footer.setColumnExpandRatio(2, 5);
    } else {
        footer = new GridLayout(2, 1);
        footer.addComponents(placeholder, buttonSave);
        footer.setColumnExpandRatio(0, 5);

    }
    footer.setSpacing(true);
    footer.setSizeUndefined();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth("100%");
    footer.addStyleName("menubar");
    footer.setComponentAlignment(buttonSave, Alignment.MIDDLE_CENTER);

    windowContent.setWidth("100%");
    windowContent.setSpacing(true);
    windowContent.setMargin(true);
    windowContent.addStyleName("profiles");
    profileSettingsLayout.addComponents(windowContent, footer);
    profileSettingsLayout.setMargin(false);
    profileSettingsLayout.setSpacing(false);
    profileSettingsLayout.setWidth("100%");

    setContent(profileSettingsLayout);
    center();
    setWidthUndefined();
    setCaption(p.getName());
    setWidth("950px");
}

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

public Component getSources(GroupInterestProfile profile, boolean isAdmin) {
    VerticalLayout windowLayout = new VerticalLayout();
    windowLayout.setWidth("100%");
    VerticalLayout sourcesLayout = new VerticalLayout();
    sourcesLayout.setWidth("100%");
    Panel sourcesPanel = new Panel(sourcesLayout);

    List<CheckBox> checkBoxes = new ArrayList<>();
    HashMap<String, GridLayout> sourceLayouts = new HashMap<>();
    profile.getSources().entrySet().stream()
            .sorted((e1, e2) -> e1.getKey().getName().compareToIgnoreCase(e2.getKey().getName())).forEach(e -> {
                Source source = e.getKey();
                boolean enabled = e.getValue();
                GridLayout sourceLayout = new GridLayout(5, 1);
                sourceLayout.setSizeFull();

                CheckBox sourceSelected = new CheckBox();
                sourceSelected.setValue(enabled);
                sourceSelected.addStyleName(ValoTheme.CHECKBOX_LARGE);
                sourceSelected.addValueChangeListener(v -> profile.getSources().replace(source, v.getValue()));
                sourceSelected.setEnabled(isAdmin);
                checkBoxes.add(sourceSelected);

                Image sourceLogo = new Image();
                sourceLogo.addStyleName("logosmall");
                sourceLogo.setSource(new ExternalResource(source.getLogo()));
                if (isAdmin) {
                    sourceLogo.addClickListener(c -> {
                        sourceSelected.setValue(!sourceSelected.getValue());
                        profile.getSources().replace(source, sourceSelected.getValue());
                    });/*from  w w  w .ja  v a2s.c o m*/
                }
                VerticalLayout layoutLogo = new VerticalLayout(sourceLogo);
                layoutLogo.setWidth("150px");
                layoutLogo.setHeight("50px");
                layoutLogo.setMargin(false);
                layoutLogo.setSpacing(false);
                layoutLogo.setComponentAlignment(sourceLogo, Alignment.MIDDLE_LEFT);

                Label labelHeadLine = new Label(
                        source.getCategory().getIcon().getHtml() + "  " + source.getName(), ContentMode.HTML);
                labelHeadLine.addStyleName(ValoTheme.LABEL_H3);

                Label labelDescription = new Label(source.getDescription(), ContentMode.HTML);
                labelDescription.setWidth("300px");
                PopupView popup = new PopupView(null, labelDescription);

                Button buttonDescription = new Button(VaadinIcons.INFO_CIRCLE_O);
                buttonDescription.addClickListener(ce -> {
                    popup.setPopupVisible(true);
                });

                sourceLayout.addComponents(sourceSelected, layoutLogo, labelHeadLine, popup, buttonDescription);
                sourceLayout.setComponentAlignment(sourceSelected, Alignment.MIDDLE_CENTER);
                sourceLayout.setComponentAlignment(layoutLogo, Alignment.MIDDLE_CENTER);
                sourceLayout.setColumnExpandRatio(2, 5);
                sourceLayout.setSpacing(true);

                sourceLayouts.put(source.getName().toLowerCase().replaceAll(" ", "").replaceAll("-", "")
                        .replaceAll("_", ""), sourceLayout);
                sourcesLayout.addComponent(sourceLayout);
            });

    sourcesPanel.setContent(sourcesLayout);
    sourcesPanel.setHeight("100%");
    sourcesPanel.setCaption(Language.get(Word.SOURCES));
    Language.setCustom(Word.SOURCES, s -> sourcesPanel.setCaption(s));
    windowLayout.addComponent(sourcesPanel);
    windowLayout.setExpandRatio(sourcesPanel, 1);
    windowLayout.setSpacing(false);
    windowLayout.setMargin(false);

    CheckBox checkBoxSelectAll = new CheckBox();
    Language.setCustom(Word.SELECT_ALL, s -> checkBoxSelectAll.setCaption(s));
    checkBoxSelectAll.setWidth("100%");
    checkBoxSelectAll.addValueChangeListener(e -> {
        profile.getSources().replaceAll((c, enabled) -> checkBoxSelectAll.getValue());
        checkBoxes.forEach(c -> c.setValue(checkBoxSelectAll.getValue()));
    });
    checkBoxSelectAll.setEnabled(isAdmin);

    TextField textFieldSearch = new TextField();
    Language.setCustom(Word.SEARCH, s -> textFieldSearch.setPlaceholder(s));
    textFieldSearch.setWidth("100%");
    textFieldSearch.setMaxLength(255);
    textFieldSearch.setPlaceholder(Language.get(Word.SEARCH));
    textFieldSearch.addValueChangeListener(searchValue -> {
        sourceLayouts.forEach((sourceName, sourceLayout) -> {
            if (!sourceName.contains(searchValue.getValue().toLowerCase().replaceAll(" ", "")
                    .replaceAll("-", "").replaceAll("_", ""))) {
                sourcesLayout.removeComponent(sourceLayout);
            } else {
                sourcesLayout.addComponent(sourceLayout);
            }
        });
    });

    Label placeholder = new Label();
    placeholder.setWidth("100%");

    GridLayout footer = new GridLayout(3, 1);
    footer.setSpacing(true);
    footer.setMargin(new MarginInfo(true, false, false, false));
    footer.addStyleName("menubar");
    footer.setWidth("100%");
    footer.addComponents(checkBoxSelectAll, textFieldSearch, placeholder);
    footer.setComponentAlignment(checkBoxSelectAll, Alignment.MIDDLE_LEFT);
    footer.setComponentAlignment(textFieldSearch, Alignment.MIDDLE_CENTER);

    windowLayout.addComponent(footer);
    windowLayout.setHeight("350px");
    return windowLayout;
}

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

public Component getCategories(GroupInterestProfile profile, boolean isAdmin) {
    Map<Category, Boolean> categories = profile.getCategories();
    VerticalLayout categoriesLayout = new VerticalLayout();
    categoriesLayout.setWidth("100%");
    Panel categoriesPanel = new Panel(categoriesLayout);

    categories.entrySet().stream().sorted((e1, e2) -> e1.getKey().getName().compareTo(e2.getKey().getName()))
            .forEach(e -> {//from   w w  w  . j av  a2 s. c  o m
                Category category = e.getKey();
                boolean enabled = e.getValue();
                GridLayout categoryLayout = new GridLayout(3, 1);
                categoryLayout.setWidth("100%");

                CheckBox categorySelected = new CheckBox();
                categorySelected.setValue(enabled);
                categorySelected.addStyleName(ValoTheme.CHECKBOX_LARGE);
                categorySelected.addValueChangeListener(v -> categories.replace(category, v.getValue()));
                categorySelected.setEnabled(isAdmin);

                Label categoryIcon = new Label(category.getIcon().getHtml(), ContentMode.HTML);
                categoryIcon.addStyleName(ValoTheme.LABEL_H3);
                categoryIcon.addStyleName(ValoTheme.LABEL_NO_MARGIN);

                Label categoryName = new Label(category.getName(), ContentMode.HTML);
                Language.setCustom(null, s -> categoryName.setValue(category.getName()));
                categoryName.addStyleName(ValoTheme.LABEL_H3);
                categoryName.addStyleName(ValoTheme.LABEL_NO_MARGIN);

                categoryLayout.addComponents(categorySelected, categoryIcon, categoryName);
                categoryLayout.setComponentAlignment(categorySelected, Alignment.MIDDLE_CENTER);
                categoryLayout.setComponentAlignment(categoryIcon, Alignment.MIDDLE_LEFT);
                categoryLayout.setComponentAlignment(categoryName, Alignment.MIDDLE_LEFT);
                categoryLayout.setColumnExpandRatio(2, 5);
                categoryLayout.setSpacing(true);

                categoriesLayout.addComponent(categoryLayout);
            });

    categoriesPanel.setContent(categoriesLayout);
    categoriesPanel.setHeight("100%");
    categoriesPanel.setCaption(Language.get(Word.CATEGORIES));
    Language.setCustom(Word.CATEGORIES, s -> categoriesPanel.setCaption(s));

    return categoriesPanel;
}

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

private void addRow(GroupInterestProfile profile, boolean included, String value, boolean isAdmin) {
    GridLayout tagLayout = new GridLayout(2, 1);
    tagLayout.setWidth("100%");

    Label labelTagName = new Label(value, ContentMode.HTML);
    labelTagName.setWidth("100%");
    labelTagName.addStyleName(ValoTheme.LABEL_H3);
    labelTagName.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    tagLayout.addComponent(labelTagName);
    tagLayout.setComponentAlignment(labelTagName, Alignment.MIDDLE_LEFT);

    if (isAdmin) {
        Button buttonDeleteTag = new Button(VaadinIcons.TRASH);
        buttonDeleteTag.addStyleName(ValoTheme.BUTTON_DANGER);
        buttonDeleteTag.addClickListener(ev -> {
            profile.getTags().remove(value);
            if (included) {
                includedTagsLayouts.get(profile).removeComponent(tagLayout);
            } else {
                excludedTagsLayouts.get(profile).removeComponent(tagLayout);
            }/*  w  w  w . ja  v  a2 s .  c om*/
        });
        tagLayout.addComponent(buttonDeleteTag);
        tagLayout.setComponentAlignment(buttonDeleteTag, Alignment.MIDDLE_RIGHT);
    }

    tagLayout.setWidth("100%");
    tagLayout.setColumnExpandRatio(0, 5);
    tagLayout.setSpacing(true);
    tagLayout.setMargin(false);

    if (included) {
        if (isAdmin) {
            includedTagsLayouts.get(profile).addComponent(tagLayout, 2);
        } else {
            includedTagsLayouts.get(profile).addComponent(tagLayout, 1);
        }
    } else {
        if (isAdmin) {
            excludedTagsLayouts.get(profile).addComponent(tagLayout, 2);
        } else {
            excludedTagsLayouts.get(profile).addComponent(tagLayout, 1);
        }
    }
}

From source file:dhbw.clippinggorilla.userinterface.windows.NewSourceWindow.java

/**
 * Value is optional//  w  w  w.j ava2  s .  c  om
 *
 * @param action
 * @param content
 * @param value
 * @return
 */
private Component getRow(Layout parent, Runnable onDelete, String action, String content, String value) {
    Panel panelRow = new Panel();
    GridLayout layoutRow = new GridLayout(2, 1);

    Label labelInfo = new Label("", ContentMode.HTML);
    String stringInfo = action.toUpperCase() + "<br>";
    if (value != null) {
        stringInfo += content + " = " + value;
    } else {
        stringInfo += content + " ";
    }
    labelInfo.setValue(stringInfo);

    Button buttonDelete = new Button(VaadinIcons.TRASH);
    buttonDelete.addStyleName(ValoTheme.BUTTON_DANGER);
    buttonDelete.addClickListener(ce -> {
        onDelete.run();
        parent.removeComponent(panelRow);
    });

    layoutRow.addComponents(labelInfo, buttonDelete);
    layoutRow.setComponentAlignment(buttonDelete, Alignment.MIDDLE_RIGHT);
    layoutRow.setComponentAlignment(labelInfo, Alignment.MIDDLE_LEFT);
    layoutRow.setWidth("100%");
    layoutRow.setMargin(true);
    layoutRow.addStyleName("crawler");
    panelRow.setContent(layoutRow);
    panelRow.setWidth("100%");
    return panelRow;
}

From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java

private Component buildClippingsTab(User user) {
    HorizontalLayout root = new HorizontalLayout();
    root.setCaption(Language.get(Word.CLIPPINGS));
    root.setIcon(VaadinIcons.NEWSPAPER);
    root.setWidth("100%");
    root.setSpacing(true);//from  ww w . j av  a  2s .co  m
    root.setMargin(true);

    FormLayout formLayoutClippingDetails = new FormLayout();
    formLayoutClippingDetails.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
    root.addComponent(formLayoutClippingDetails);

    CheckBox checkBoxReceiveEmails = new CheckBox();
    checkBoxReceiveEmails.setValue(UserUtils.getEmailNewsletter(user));
    checkBoxReceiveEmails.addValueChangeListener(v -> UserUtils.setEmailNewsletter(user, v.getValue()));
    HorizontalLayout layoutCheckBoxReceiveEmails = new HorizontalLayout(checkBoxReceiveEmails);
    layoutCheckBoxReceiveEmails.setCaption(Language.get(Word.EMAIL_SUBSCRIPTION));
    layoutCheckBoxReceiveEmails.setMargin(false);
    layoutCheckBoxReceiveEmails.setSpacing(false);

    HorizontalLayout layoutAddNewClippingTime = new HorizontalLayout();
    layoutAddNewClippingTime.setMargin(false);
    layoutAddNewClippingTime.setCaption(Language.get(Word.ADD_CLIPPING_TIME));
    layoutAddNewClippingTime.setWidth("100%");

    InlineDateTimeField dateFieldNewClippingTime = new InlineDateTimeField();
    LocalDateTime value = LocalDateTime.now(ZoneId.of("Europe/Berlin"));
    dateFieldNewClippingTime.setValue(value);
    dateFieldNewClippingTime.setLocale(VaadinSession.getCurrent().getLocale());
    dateFieldNewClippingTime.setResolution(DateTimeResolution.MINUTE);
    dateFieldNewClippingTime.addStyleName("time-only");

    Button buttonAddClippingTime = new Button();
    buttonAddClippingTime.setIcon(VaadinIcons.PLUS);
    buttonAddClippingTime.addStyleName(ValoTheme.BUTTON_PRIMARY);
    buttonAddClippingTime.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);
    buttonAddClippingTime.addClickListener(e -> {
        LocalTime generalTime = dateFieldNewClippingTime.getValue().toLocalTime();
        layoutClippingTimes.addComponent(getTimeRow(user, generalTime));
        UserUtils.addClippingSendTime(user, generalTime);
    });
    layoutAddNewClippingTime.addComponents(dateFieldNewClippingTime, buttonAddClippingTime);
    layoutAddNewClippingTime.setComponentAlignment(dateFieldNewClippingTime, Alignment.MIDDLE_LEFT);
    layoutAddNewClippingTime.setComponentAlignment(buttonAddClippingTime, Alignment.MIDDLE_CENTER);
    layoutAddNewClippingTime.setExpandRatio(dateFieldNewClippingTime, 5);

    layoutClippingTimes = new VerticalLayout();
    layoutClippingTimes.setMargin(new MarginInfo(true, false, false, true));
    layoutClippingTimes.setCaption(Language.get(Word.CLIPPING_TIMES));
    layoutClippingTimes.setWidth("100%");
    layoutClippingTimes.addStyleName("times");

    Set<LocalTime> userTimes = user.getClippingTime();
    userTimes.forEach(t -> layoutClippingTimes.addComponent(getTimeRow(user, t)));

    formLayoutClippingDetails.addComponents(layoutCheckBoxReceiveEmails, layoutAddNewClippingTime,
            layoutClippingTimes);

    return root;
}

From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java

private Component getTimeRow(User user, LocalTime time) {
    HorizontalLayout layoutTimeRow = new HorizontalLayout();
    layoutTimeRow.setWidth("100%");

    DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT);
    Label labelTime = new Label(time.format(formatter));

    Button buttonDelete = new Button(VaadinIcons.TRASH);
    buttonDelete.addStyleName(ValoTheme.BUTTON_DANGER);
    buttonDelete.setWidth("80px");
    buttonDelete.addClickListener(e -> {
        if (layoutClippingTimes.getComponentCount() > 1) {
            layoutClippingTimes.removeComponent(layoutTimeRow);
            UserUtils.removeClippingSendTime(user, time);
        } else {//from w w  w .  jav a2 s.  c  om
            VaadinUtils.errorNotification(Language.get(Word.AT_LREAST_ONE_TIME));
        }
    });

    layoutTimeRow.addComponents(labelTime, buttonDelete);
    layoutTimeRow.setComponentAlignment(labelTime, Alignment.MIDDLE_LEFT);
    layoutTimeRow.setComponentAlignment(buttonDelete, Alignment.MIDDLE_CENTER);
    layoutTimeRow.setExpandRatio(labelTime, 5);

    return layoutTimeRow;
}

From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java

private Component buildSupportTab(User user) {
    VerticalLayout root = new VerticalLayout();
    root.setCaption(Language.get(Word.SUPPORT));
    root.setIcon(VaadinIcons.HEADSET);//from   w w  w . jav a  2  s .  c  o m
    root.setWidth("100%");
    root.setHeight("100%");
    root.setSpacing(true);
    root.setMargin(true);

    TextArea textAreaMessage = new TextArea(Language.get(Word.MESSAGE));
    textAreaMessage.setWidth("100%");
    textAreaMessage.setHeight("100%");

    Button buttonSend = new Button(Language.get(Word.SEND), VaadinIcons.ENVELOPE);
    buttonSend.addStyleName(ValoTheme.BUTTON_PRIMARY);
    buttonSend.addClickListener(ce -> {
        try {
            if (emailsSend.containsKey(user)) {
                Map<LocalDate, Integer> times = emailsSend.get(user);
                if (times.containsKey(LocalDate.now())) {
                    if (times.get(LocalDate.now()) > 3) {
                        if (times.get(LocalDate.now()) > 15) {
                            UserUtils.banUser(user);
                            VaadinUtils.errorNotification("BANNED DUE TO TOO MUCH EMAILS");
                        } else {
                            VaadinUtils.errorNotification("TOO MUCH EMAILS");
                        }
                        return;
                    } else {
                        times.put(LocalDate.now(), times.get(LocalDate.now()) + 1);
                    }
                } else {
                    times.put(LocalDate.now(), 1);
                }
            } else {
                HashMap<LocalDate, Integer> times = new HashMap<>();
                times.put(LocalDate.now(), 1);
                emailsSend.put(user, times);
            }
            Mail.send(Props.get("supportmail"), "SUPPORT", user.toString() + "\n" + textAreaMessage.getValue());
            VaadinUtils.middleInfoNotification(Language.get(Word.SUCCESSFULLY_SEND));
            textAreaMessage.clear();
        } catch (EmailException ex) {
            VaadinUtils.errorNotification(Language.get(Word.SEND_FAILED));
            Log.error("Could not send Supportmail: ", ex);
        }
    });

    root.addComponents(textAreaMessage, buttonSend);
    root.setExpandRatio(textAreaMessage, 5);
    root.setComponentAlignment(buttonSend, Alignment.MIDDLE_LEFT);

    return root;
}

From source file:dhbw.ka.mwi.businesshorizon2.ui.resultscreen.morescenarios.MoreScenarioResultViewImpl.java

License:Open Source License

/**
 * Diese Methode erzeugt die Anzeige der Planungsprmissen fr Szenario 1
 * /*w w w  . ja  v a 2s. c om*/
 * @author Tobias Lindner
 */
public void createScenario1Layout() {
    renditeEKLabel1 = new Label("Renditeforderung EK:");
    renditeFKLabel1 = new Label("Renditeforderung FK:");
    gewerbeStLabel1 = new Label("Gewerbesteuer:");
    koerperStLabel1 = new Label("Krperschaftssteuer <br> inkl. Solidarittszuschlag:  ");
    koerperStLabel1.setContentMode(Label.CONTENT_XHTML);
    personalTaxRateLabel1 = new Label("Persnlicher Steuersatz: ");
    renditeEK1 = new Label();
    renditeFK1 = new Label();
    gewerbeSt1 = new Label();
    koerperSt1 = new Label();
    personalTaxRate1 = new Label();

    companyValue1 = new Label();

    planningGridScenario1.addComponent(renditeEKLabel1, 0, 0);
    planningGridScenario1.addComponent(renditeEK1, 1, 0);
    planningGridScenario1.addComponent(renditeFKLabel1, 0, 1);
    planningGridScenario1.addComponent(renditeFK1, 1, 1);
    planningGridScenario1.addComponent(gewerbeStLabel1, 0, 2);
    planningGridScenario1.addComponent(gewerbeSt1, 1, 2);
    planningGridScenario1.addComponent(koerperStLabel1, 0, 3);
    planningGridScenario1.addComponent(koerperSt1, 1, 3);
    planningGridScenario1.addComponent(personalTaxRateLabel1, 0, 4);
    planningGridScenario1.addComponent(personalTaxRate1, 1, 4);
    planningGridScenario1.setComponentAlignment(koerperSt1, Alignment.MIDDLE_LEFT);

    companyValueLayoutScenario1.addComponent(companyValue1);

}