Example usage for com.vaadin.ui NativeButton setHeight

List of usage examples for com.vaadin.ui NativeButton setHeight

Introduction

In this page you can find the example usage for com.vaadin.ui NativeButton setHeight.

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

From source file:com.foc.vaadin.FocWebVaadinWindow.java

License:Apache License

/**
 * adjustButtonStyleInHeaderBar allows to customize the look of a button displayed in header menu bar 
 * //from   w  w  w . j  ava  2s .c  o m
 * @param nBut
 * @param asFirst
 * @param addButton
 */
protected void adjustButtonStyleInHeaderBar(NativeButton nBut, boolean asFirst, boolean addButton) {
    nBut.setHeight("40px");
    nBut.setStyleName("focBannerButton");
    if (addButton) {
        if (centerHeaderLayout != null) {
            if (asFirst) {
                centerHeaderLayout.addComponentAsFirst(nBut);
            } else {
                centerHeaderLayout.addComponent(nBut);
            }
            centerHeaderLayout.setComponentAlignment(nBut, Alignment.TOP_LEFT);
        }
    }
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVOptionMobileLayout.java

License:Apache License

private void addMoreItemsAsButtons(FVMenuBar menuBar) {
    List<MenuItem> munItemList = menuBar.getItems();

    if (munItemList.size() > 0) {
        MenuItem moreItem = munItemList.get(0);
        if (moreItem != null) {
            List<MenuItem> children = moreItem.getChildren();
            for (int i = 0; i < children.size(); i++) {
                MenuItem menuItem = children.get(i);
                if (menuItem != null) {
                    String title = menuItem.getText();
                    FVMenuBarCommand menuBarCommand = (FVMenuBarCommand) menuItem.getCommand();
                    if (menuBarCommand != null) {
                        NativeButton button = new NativeButton(title);
                        button.setWidth("100%");
                        button.setHeight("40px");
                        button.addStyleName("focBannerButton");
                        addComponent(button);
                        button.addClickListener(new MenuItemButtonClickListener(menuItem, menuBarCommand));
                    }/*from   www .  j ava2 s  . c o m*/
                }
            }
        }
    }

}

From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.tagging.components.SearchEngineMetaDescription.java

License:Open Source License

private Component createSEOProgressBar() {
    ProgressBar seoProgressBar = new ProgressBar();
    seoProgressBar.setWidth("250px");
    seoProgressBar.setValue(0.5f);/* ww  w .  j a v  a  2s.  c  o  m*/

    HorizontalLayout layout = new HorizontalLayout();
    layout.addComponent(new Label("SEO Rating:"));
    layout.addComponent(seoProgressBar);
    layout.setSpacing(true);
    layout.setMargin(new MarginInfo(false, false, true, false));

    NativeButton addUpdateButton = new NativeButton("", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            // do nothing
        }
    });
    addUpdateButton.addStyleName("update-button");
    addUpdateButton.setHeight("28px");
    addUpdateButton.setCaption("Update");
    addUpdateButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            updateMetaDescriptionPreview(textArea.getValue());
        }
    });
    layout.addComponent(addUpdateButton);

    return layout;
}

From source file:edu.kit.dama.ui.repo.MyVaadinUI.java

License:Apache License

/**
 * Build the search view and execute the provided query immediately.
 *
 * @param pQuery The query to execute or null if an empty view should be
 * shown./*from  ww  w  .ja v  a2  s. c  o  m*/
 */
private void buildSearchView(String pQuery) {
    loginButton.setWidth("70px");
    loginButton.setStyleName(BaseTheme.BUTTON_LINK);
    logoutButton.setWidth("70px");
    logoutButton.setStyleName(BaseTheme.BUTTON_LINK);
    adminButton.setWidth("70px");
    adminButton.setStyleName(BaseTheme.BUTTON_LINK);

    logoutButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            loggedInUser = UserData.NO_USER;
            refreshMainLayout();
        }
    });

    adminButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Page.getCurrent()
                    .open(DataManagerSettings.getSingleton().getStringProperty(
                            DataManagerSettings.GENERAL_BASE_URL_ID, "http://localhost:8889/BaReDemo")
                            + "/admin", "_blank");
        }
    });

    searchField = UIUtils7.factoryTextField(null, "Search for...");
    searchField.setWidth("920px");
    searchField.setHeight("60px");
    searchField.addStyleName("searchField");

    paginationPanel = new PaginationPanel(this);
    paginationPanel.setSizeFull();
    paginationPanel.setAllEntries(new LinkedList<DigitalObjectId>());

    searchProvider = new FulltextElasticSearchProvider(
            DataManagerSettings.getSingleton()
                    .getStringProperty(DataManagerSettings.ELASTIC_SEARCH_DEFAULT_CLUSTER_ID, "KITDataManager"),
            DataManagerSettings.getSingleton()
                    .getStringProperty(DataManagerSettings.ELASTIC_SEARCH_DEFAULT_HOST_ID, "localhost"),
            DataManagerSettings.getSingleton().getStringProperty(
                    DataManagerSettings.ELASTIC_SEARCH_DEFAULT_INDEX_ID,
                    ElasticsearchHelper.ELASTICSEARCH_TYPE),
            ElasticsearchHelper.ELASTICSEARCH_TYPE);
    NativeButton goButton = new NativeButton();
    goButton.setIcon(new ThemeResource("img/24x24/search.png"));
    goButton.setWidth("60px");
    goButton.setHeight("60px");
    goButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            doSearch();
        }
    });
    goButton.setClickShortcut(KeyCode.ENTER);

    setupLoginForm();
    loginForm.setWidth("320px");
    loginForm.setHeight("150px");
    final PopupView loginPopup = new PopupView(null, loginForm);
    loginPopup.setHideOnMouseOut(false);
    loginButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            //mainLayout.replaceComponent(searchLayout, loginForm);
            loginPopup.setPopupVisible(true);
        }
    });

    Label filler = new Label();
    memberLayout = new HorizontalLayout(filler, adminButton, loginButton, loginPopup);
    memberLayout.setComponentAlignment(loginButton, Alignment.TOP_RIGHT);
    memberLayout.setComponentAlignment(adminButton, Alignment.TOP_RIGHT);
    memberLayout.setComponentAlignment(loginPopup, Alignment.TOP_RIGHT);

    memberLayout.setExpandRatio(filler, 1.0f);
    memberLayout.setMargin(false);
    memberLayout.setSpacing(false);
    memberLayout.setWidth("100%");
    memberLayout.setHeight("30px");

    Label spacer = new Label("<hr/>", ContentMode.HTML);
    spacer.setHeight("20px");

    searchLayout = new UIUtils7.GridLayoutBuilder(3, 4)
            .addComponent(searchField, Alignment.TOP_LEFT, 0, 0, 2, 1)
            .addComponent(goButton, Alignment.TOP_RIGHT, 2, 0, 1, 1).fillRow(spacer, 0, 1, 1)
            .addComponent(paginationPanel, Alignment.MIDDLE_CENTER, 0, 2, 3, 2).getLayout();
    searchLayout.addStyleName("paper");
    searchLayout.setSpacing(true);
    searchLayout.setMargin(true);
    paginationPanel.setWidth("980px");
    //wrapper
    Label icon8Link = new Label("<a href=\"http://icons8.com\">Icons by icon8.com</a>", ContentMode.HTML);
    mainLayout = new VerticalLayout(memberLayout, searchLayout, icon8Link);
    mainLayout.setComponentAlignment(memberLayout, Alignment.TOP_CENTER);
    mainLayout.setComponentAlignment(searchLayout, Alignment.TOP_CENTER);
    mainLayout.setComponentAlignment(icon8Link, Alignment.BOTTOM_RIGHT);
    mainLayout.setExpandRatio(memberLayout, .05f);
    mainLayout.setExpandRatio(searchLayout, .93f);
    mainLayout.setExpandRatio(icon8Link, .02f);

    VerticalLayout fullscreen = new VerticalLayout(mainLayout);
    fullscreen.setComponentAlignment(mainLayout, Alignment.TOP_CENTER);
    fullscreen.setSizeFull();
    setContent(fullscreen);

    mainLayout.setWidth("1024px");
    mainLayout.setHeight("768px");

    if (pQuery != null) {
        searchField.setValue(pQuery);
        doSearch();
    }
}

From source file:edu.nps.moves.mmowgli.modules.cards.CardChainTreeTablePopup.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public CardChainTreeTablePopup(Object rootId, boolean modal, boolean wantSaveButton) {
    super(null);/*  w ww . j  a va  2 s  . co m*/
    setWidth("600px");
    setHeight("400px");
    addStyleName("m-noborder"); // V7 difference

    super.initGui();
    selectedId = tempSelectedId = rootId;
    setModal(modal);
    setListener(this);
    setResizable(true);

    setTitleString("Card chain");
    saveClicked = false;

    contentVLayout.setSpacing(true);

    treeT = new CardChainTree(rootId, false, !modal);
    if (rootId == null) {
        setTitleString("Card chains");
        // instead, do some creative backgrounding to pseudo select children of a card, treeT.setMultiSelect(true);
    }
    //treeT.setSizeFull();
    treeT.setWidth("99%");
    treeT.setHeight("99%");
    treeT.addItemClickListener((ItemClickListener) this);
    treeT.addStyleName("m-greyborder");
    contentVLayout.addComponent(treeT);
    contentVLayout.setComponentAlignment(treeT, Alignment.MIDDLE_CENTER);
    contentVLayout.setExpandRatio(treeT, 1.0f);

    /* todo...the saved data was never being retrieved, should pass it back to create action plan panel */

    if (wantSaveButton) {
        // need a save button
        HorizontalLayout hl = new HorizontalLayout();
        hl.setWidth("100%");
        contentVLayout.addComponent(hl);
        Label lab;
        hl.addComponent(lab = new Label());
        hl.setExpandRatio(lab, 1.0f);

        NativeButton saveButt = new NativeButton();
        hl.addComponent(saveButt);
        saveButt.setIcon(Mmowgli2UI.getGlobals().getMediaLocator().getSaveButtonIcon());
        saveButt.setWidth("45px"); //38px");
        saveButt.setHeight("16px");
        saveButt.addStyleName("borderless");
        saveButt.addClickListener(saveListener = new SaveListener());
        saveButt.setClickShortcut(KeyCode.ENTER);
        hl.addComponent(lab = new Label());
        lab.setWidth("30px");
        contentVLayout.addComponent(hl);
    }
}