Example usage for com.vaadin.ui Alignment BOTTOM_LEFT

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

Introduction

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

Prototype

Alignment BOTTOM_LEFT

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

Click Source Link

Usage

From source file:annis.gui.flatquerybuilder.SearchBox.java

License:Apache License

public SearchBox(final String ebene, final FlatQueryBuilder sq, final VerticalNode vn, boolean isRegex,
        boolean negativeSearch) {
    this.vn = vn;
    this.ebene = ebene;
    this.sq = sq;
    this.vfs = new ArrayList<>();
    vnframe = new VerticalLayout();
    vnframe.setSpacing(true);//from www .j a v a 2 s .  com
    vnframe.setImmediate(true);
    this.sb = new VerticalLayout(); //maybe other name? sb is "reserved" by SearchBox
    sb.setImmediate(true);
    sb.setSpacing(false); //used to be true
    lbl = new Label(ebene);
    HorizontalLayout sbtoolbar = new HorizontalLayout();
    sbtoolbar.setSpacing(false);
    // searchbox tickbox for regex
    reBox = new CheckBox(CAPTION_REBOX);
    reBox.setImmediate(true);
    sbtoolbar.addComponent(reBox);
    reBox.addValueChangeListener(new ValueChangeListener() {
        // TODO make this into a nice subroutine
        @Override
        public void valueChange(ValueChangeEvent event) {
            if (reBox.getValue()) {
                for (ValueField vf : vfs) {
                    String value = vf.getValue();
                    vf.setValueMode(ValueField.ValueMode.REGEX);
                    if (value != null) {
                        vf.setValue(sq.escapeRegexCharacters(value));
                    }
                }
            } else {
                for (ValueField vf : vfs) {
                    String value = vf.getValue();
                    vf.setValueMode(ValueField.ValueMode.NORMAL);
                    if (value != null) {
                        vf.setValue(sq.unescape(value));
                    }
                }
            }
        }
    });
    reBox.setValue(isRegex);
    reBox.setEnabled(true);
    reBoxSingleValue = isRegex;
    // searchbox tickbox for negative search
    negSearchBox = new CheckBox(NEGATIVE_SEARCH_LABEL);
    negSearchBox.setImmediate(true);
    negSearchBox.setValue(negativeSearch);

    sbtoolbar.addComponent(negSearchBox);
    // close the searchbox
    btClose = new Button(BUTTON_CLOSE_LABEL, (Button.ClickListener) this);
    btClose.setStyleName(ValoTheme.BUTTON_SMALL);

    HorizontalLayout titleBar = new HorizontalLayout();
    titleBar.setWidth(vnframe.getWidth(), vnframe.getWidthUnits());
    titleBar.addComponent(lbl);
    titleBar.setComponentAlignment(lbl, Alignment.BOTTOM_LEFT);
    titleBar.addComponent(btClose);
    titleBar.setComponentAlignment(btClose, Alignment.TOP_RIGHT);

    btAdd = new Button(LABEL_BUTTON_ADD);
    btAdd.addClickListener((Button.ClickListener) this);
    btAdd.setStyleName(ValoTheme.BUTTON_SMALL);

    vnframe.addComponent(titleBar);
    vnframe.addComponent(sb);
    vnframe.addComponent(btAdd);
    vnframe.setComponentAlignment(btAdd, Alignment.BOTTOM_RIGHT);
    vnframe.addComponent(sbtoolbar);

    ValueField vf = new ValueField(sq, this, ebene);
    vf.setProtected(true);
    vfs.add(vf);
    sb.addComponent(vf);

    setContent(vnframe);
}

From source file:by.bigvova.ui.LoginUI.java

License:Apache License

private Component buildFields() {
    final VerticalLayout layout = new VerticalLayout();
    HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);/*from  w  ww  .j a v  a 2 s .  c o  m*/
    fields.addStyleName("fields");

    final TextField username = new TextField("Username");
    username.setIcon(FontAwesome.USER);
    username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);

    final PasswordField password = new PasswordField("Password");
    password.setIcon(FontAwesome.LOCK);
    password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);

    final Button signin = new Button("Sign In");
    signin.addStyleName(ValoTheme.BUTTON_PRIMARY);
    signin.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    signin.focus();

    final CheckBox checkBox = new CheckBox("Remember me", true);

    signin.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final Button.ClickEvent event) {
            login(username.getValue(), password.getValue(), checkBox.getValue());
        }
    });

    fields.addComponents(username, password, signin);
    fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);

    layout.setSpacing(true);
    layout.addComponent(fields);
    layout.addComponent(checkBox);
    return layout;
}

From source file:com.aaron.mbpet.views.users.UserEditor.java

License:Apache License

public UserEditor(Item personItem, String lableText, boolean mode) {
    this.editMode = mode;
    //       this.setModal(true);
    center();// ww w .  j a v  a 2s . co  m
    setResizable(true);
    setClosable(true);
    setModal(true);
    //      setSizeUndefined();
    setWidth(25, Unit.EM);

    this.currsessionuser = ((MbpetUI) UI.getCurrent()).getSessionUser();

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);

    this.personItem = personItem;
    editorForm = new Form();
    editorForm.setFormFieldFactory(this);
    editorForm.setBuffered(true);
    editorForm.setImmediate(true);
    editorForm.setItemDataSource(personItem,
            Arrays.asList("firstname", "lastname", "email", "username", "password", "organization"));

    //buttons        
    saveButton = new Button("Save", this);
    saveButton.setClickShortcut(KeyCode.ENTER);
    cancelButton = new Button("Cancel", this);
    saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setWidth("100%");
    buttons.addComponents(saveButton, cancelButton);
    buttons.setComponentAlignment(saveButton, Alignment.BOTTOM_LEFT);
    buttons.setComponentAlignment(cancelButton, Alignment.BOTTOM_RIGHT);

    //        editorForm.getFooter().addComponent(buttons);
    //        editorForm.getFooter().addComponent(cancelButton);

    layout.addComponent(new Label("<h3>" + lableText + "</h3>", ContentMode.HTML));
    layout.addComponent(editorForm);
    layout.setComponentAlignment(editorForm, Alignment.MIDDLE_CENTER);
    layout.addComponent(buttons);

    setContent(layout); //editorForm
    setCaption(buildCaption());
}

From source file:com.antonjohansson.managementcenter.core.web.welcome.WelcomeView.java

License:Apache License

private Component getExistingConnectionLayout() {
    ComboBox connection = new ComboBox("Existing connection");
    connection.addItem("SQL Server 01");
    connection.addItem("Elasticsearch Server 01");
    connection.setWidth("400");
    connection.setNullSelectionAllowed(false);
    connection.setTextInputAllowed(false);

    Button connect = new Button("Connect");
    connect.addStyleName(ValoTheme.BUTTON_PRIMARY);
    connect.setClickShortcut(KeyCode.ENTER);
    connect.setWidth("120");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);//w w w  .  j av  a 2s.  c o  m
    layout.addComponents(connection, connect);
    layout.setComponentAlignment(connect, Alignment.BOTTOM_LEFT);
    return layout;
}

From source file:com.antonjohansson.managementcenter.core.web.welcome.WelcomeView.java

License:Apache License

private Component getNewConnectionLayout() {
    engine = new ComboBox("New connection");
    engine.setWidth("400");
    engine.setNullSelectionAllowed(false);
    engine.setTextInputAllowed(false);/*from www . ja  va2  s  . com*/

    create = new Button("Create");
    create.addStyleName(ValoTheme.BUTTON_PRIMARY);
    create.setClickShortcut(KeyCode.ENTER);
    create.setWidth("120");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.addComponents(engine, create);
    layout.setComponentAlignment(create, Alignment.BOTTOM_LEFT);
    return layout;
}

From source file:com.dungnv.streetfood.view.ArticleView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);//w  ww  . j a  va2s .  c o m
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.ARTICLE"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.article.title.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new ArticleSearchDetail(this);
}

From source file:com.dungnv.streetfood.view.CategoryView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);//from w w  w  . j ava  2 s.  c o m
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.CATEGORY"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.category.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new CategorySearchDetail(this);
}

From source file:com.dungnv.streetfood.view.DishView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);//from   w w w .  ja va 2 s  . c  o m
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.DISH"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.dish.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new DishSearchDetail(this);
}

From source file:com.dungnv.streetfood.view.RestaurantView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);//  w w  w . j  a  v  a  2s  .c  o  m
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.RESTAURANT"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.restaurant.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new RestaurantSearchDetail(this);
}

From source file:com.dungnv.streetfood.view.SlideShowView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);/*from   w w  w  .  j  av a  2  s . c  o  m*/
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.RESTAURANT"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.slideShow.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new SlideShowSearchDetail(this);
}