Example usage for com.vaadin.ui.themes ValoTheme BUTTON_SMALL

List of usage examples for com.vaadin.ui.themes ValoTheme BUTTON_SMALL

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme BUTTON_SMALL.

Prototype

String BUTTON_SMALL

To view the source code for com.vaadin.ui.themes ValoTheme BUTTON_SMALL.

Click Source Link

Document

Small size button.

Usage

From source file:com.hybridbpm.ui.component.ConfigureWindow.java

License:Apache License

public ConfigureWindow(Component dataLayout, String caption) {
    this.dataLayout = dataLayout;
    setCaption(caption);//  w ww  .  j  a va2s.c  o  m

    errorMessage.setVisible(false);
    errorMessage.setStyleName(ValoTheme.LABEL_FAILURE);

    toolbar.setSpacing(true);
    toolbar.addStyleName("toolbar");

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.addStyleName(ValoTheme.BUTTON_SMALL);
    btnOk.setCaption("OK");
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption("Close");
    btnClose.addStyleName(ValoTheme.BUTTON_SMALL);

    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    cssLayout.addComponent(this.dataLayout);
    cssLayout.setSizeFull();
    cssLayout.addStyleName("scrollable");

    layout.setSizeFull();
    layout.setMargin(true);
    layout.addComponent(cssLayout);
    layout.setExpandRatio(cssLayout, 1f);
    layout.addComponent(errorMessage);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT);

    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    setContent(layout);
    setWidth(80, Unit.PERCENTAGE);
    setHeight(80, Unit.PERCENTAGE);
}

From source file:com.hybridbpm.ui.component.development.AbstractEditor.java

License:Apache License

public AbstractEditor() {
    setSizeFull();//  w w  w  .  j a va2  s  .c  o  m
    setSpacing(true);
    setMargin(new MarginInfo(true, false, false, false));
    addComponent(buttonBar);
    setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
    addComponent(horizontalSplitPanel);
    setExpandRatio(horizontalSplitPanel, 1f);

    horizontalSplitPanel.setSizeFull();
    horizontalSplitPanel.setStyleName("transparent");

    buttonBar.setSpacing(true);
    buttonBar.setSpacing(true);

    btnSave.setIcon(FontAwesome.SAVE);
    btnSave.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}

From source file:com.hybridbpm.ui.component.development.DataEditor.java

License:Apache License

private void prepareModeler() {
    btnAdd.setCaption("Add field");
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.addStyleName(ValoTheme.BUTTON_SMALL);

    modelerLayout.setMargin(true);//w w w .j a  va  2  s.  c om
    modelerLayout.setSpacing(true);
    modelerLayout.setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : dataModel.getFields()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        modelerLayout.addComponent(fieldForm);
    }
    modelerLayout.addComponent(btnAdd);
    modelerLayout.setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}

From source file:com.hybridbpm.ui.component.development.FormEditor.java

License:Apache License

public FormEditor(Module module) {
    super();//from   w w w  . j  a v  a2s . co m
    this.module = HybridbpmUI.getDevelopmentAPI().getModuleById(module.getId());
    ;

    btnRun.setIcon(FontAwesome.PLAY);
    btnRun.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnRun.addStyleName(ValoTheme.BUTTON_SMALL);

    btnParameters.setIcon(FontAwesome.WRENCH);
    btnParameters.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnParameters.addStyleName(ValoTheme.BUTTON_SMALL);

    horizontalSplitPanel.addComponents(designEditorLayout, codeEditorLayout);
    buttonBar.addComponent(btnParameters, 0);
    buttonBar.addComponent(btnRun, 0);

    codeEditorLayout.setSizeFull();
    codeEditorLayout.addStyleName("code");
    codeEditorLayout.setMargin(new MarginInfo(false, false, false, true));
    designEditorLayout.setSizeFull();
    designEditorLayout.addStyleName("template");
    designEditorLayout.setMargin(new MarginInfo(false, true, false, false));

    binder.setItemDataSource(this.module);
    binder.bind(codeEditor, "code");
    binder.bind(designEditor, "design");

    switch (module.getType()) {
    case FORM:
        designEditor.setCaption("Design");
        designEditor.setMode(AceMode.html);
        designEditor.setTheme(AceTheme.textmate);
        designEditor.setShowGutter(true);
        designEditor.setSizeFull();
        codeEditor.setCaption("Code");
        codeEditor.setMode(AceMode.groovy);
        codeEditor.setTheme(AceTheme.textmate);
        codeEditor.setShowGutter(true);
        codeEditor.setSizeFull();
        horizontalSplitPanel.setSplitPosition(50, Sizeable.Unit.PERCENTAGE);
        btnRun.setCaption("Test");
        break;
    }
    if (module.getTemplate()) {
        btnRun.setVisible(false);
        btnParameters.setVisible(false);
    }
}

From source file:com.hybridbpm.ui.component.document.DocumentBreadcrumbButton.java

License:Apache License

public DocumentBreadcrumbButton(Document document, ClickListener clickListener) {
    this.document = document;
    setStyleName(ValoTheme.BUTTON_LINK);
    addStyleName("breadcrumbs");
    addStyleName(ValoTheme.BUTTON_SMALL);
    if (document != null) {
        setIcon(FontAwesome.ANGLE_RIGHT);
        setCaption(document.getName());/*from   w  w w. ja v  a 2  s . co  m*/
    } else {
        setCaption(Translate.getMessage("breadcrumbsRootButtonCaption"));
    }
    if (clickListener != null) {
        addClickListener(clickListener);
    }
}

From source file:com.kpg.diary.ui.MenuLayout.java

License:Apache License

/**
 * Builds the menu./*from w  w w  .j  a  v  a2s  . c om*/
 *
 * @param navigator
 *            the navigator
 * @return the css layout
 */
private CssLayout buildMenu(Navigator navigator) {
    // Add items
    menuItemsMap();
    HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.addStyleName(ValoTheme.MENU_TITLE);

    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName(ValoTheme.MENU_TITLE);
    menu.addComponent(top);
    // menu.addComponent(createThemeSelect());
    menu.addComponent(top);
    Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(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);

    Label title = new Label("<h2>Diary</h2>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);
    for (final Entry<String, String> item : menuItems.entrySet()) {
        Button b = new Button(item.getValue(), new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName(ValoTheme.MENU_ITEM);
        if (IConstants.NavigationMenu.ADDRESS.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.BOOK);
        } else if (IConstants.NavigationMenu.PERSON.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.USER);
        } else {
            b.setIcon(FontAwesome.APPLE);
        }
        menuItemsLayout.addComponent(b);
    }
    return menu;
}

From source file:com.mcparland.john.vaadin_mvn_arch.samples.Menu.java

License:Apache License

public Menu(Navigator navigator) {
    this.navigator = navigator;
    setPrimaryStyleName(ValoTheme.MENU_ROOT);
    menuPart = new CssLayout();
    menuPart.addStyleName(ValoTheme.MENU_PART);

    // header of the menu
    final HorizontalLayout top = new HorizontalLayout();
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName(ValoTheme.MENU_TITLE);
    top.setSpacing(true);//from   w  w w  . j av a  2s . c  o  m
    Label title = new Label("My CRUD");
    title.addStyleName(ValoTheme.LABEL_H3);
    title.setSizeUndefined();
    Image image = new Image(null, new ThemeResource("img/table-logo.png"));
    image.setStyleName("logo");
    top.addComponent(image);
    top.addComponent(title);
    menuPart.addComponent(top);

    // logout menu item
    MenuBar logoutMenu = new MenuBar();
    logoutMenu.addItem("Logout", FontAwesome.SIGN_OUT, new Command() {

        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            VaadinSession.getCurrent().getSession().invalidate();
            Page.getCurrent().reload();
        }
    });

    logoutMenu.addStyleName("user-menu");
    menuPart.addComponent(logoutMenu);

    // button for toggling the visibility of the menu when on a small screen
    final Button showMenu = new Button("Menu", new ClickListener() {
        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) {
                menuPart.removeStyleName(VALO_MENU_VISIBLE);
            } else {
                menuPart.addStyleName(VALO_MENU_VISIBLE);
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName(VALO_MENU_TOGGLE);
    showMenu.setIcon(FontAwesome.NAVICON);
    menuPart.addComponent(showMenu);

    // container for the navigation buttons, which are added by addView()
    menuItemsLayout = new CssLayout();
    menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS);
    menuPart.addComponent(menuItemsLayout);

    addComponent(menuPart);
}

From source file:com.save.client.promodeals.PDDataGridProperties.java

Window delete(Object itemId, int promoId) {
    Window sub = new Window("REMOVE PROMO DEAL");
    sub.setWidth("250px");
    sub.setModal(true);// www.  j  av a 2  s . c  o m
    sub.center();

    VerticalLayout v = new VerticalLayout();
    v.setWidth("100%");
    v.setMargin(true);

    Button delBtn = new Button("CONFIRM DELETE?", (Button.ClickEvent event) -> {
        boolean result = pds.delete(promoId, "removed");
        getContainerDataSource().removeItem(itemId);
        sub.close();
    });
    delBtn.setWidth("100%");
    delBtn.addStyleName(ValoTheme.BUTTON_PRIMARY);
    delBtn.addStyleName(ValoTheme.BUTTON_SMALL);
    v.addComponent(delBtn);

    sub.setContent(v);
    return sub;
}

From source file:com.save.client.promodeals.PromoUI.java

public PromoUI(int clientId) {
    this.clientId = clientId;

    setWidth("90%");
    setHeight("100%");
    setMargin(new MarginInfo(true, true, false, false));

    PDDataGridProperties dataGrid = new PDDataGridProperties(getClientId());

    Button button = new Button("Acknowledgement Form");
    button.setWidthUndefined();/* w  ww .j  av a2s.c om*/
    button.setIcon(FontAwesome.OPENID);
    button.addStyleName(ValoTheme.BUTTON_LINK);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener((Button.ClickEvent event) -> {
        Window sub = new com.save.clients.AcknowledgementPromoForm(getClientId());
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }

        sub.addCloseListener((Window.CloseEvent e) -> {
            dataGrid.getContainerDataSource().removeAllItems();
            dataGrid.setContainerDataSource(new PDDataContainer(getClientId()));
        });
    });
    addComponent(button);
    setComponentAlignment(button, Alignment.TOP_RIGHT);

    addComponent(dataGrid);
    setExpandRatio(dataGrid, 2);
}

From source file:com.save.employee.maintenance.MRUI.java

public MRUI(int employeeId) {
    this.employeeId = employeeId;

    setWidth("90%");
    setHeight("100%");
    setMargin(new MarginInfo(true, false, false, false));

    MRDataGridProperties dataGrid = new MRDataGridProperties(getEmployeeId());

    Button mrForm = new Button("Maintenance/Reimbursement Form");
    mrForm.setWidthUndefined();/*from w w w . j a  v  a  2  s  . c o  m*/
    mrForm.setIcon(FontAwesome.OPENID);
    mrForm.addStyleName(ValoTheme.BUTTON_SMALL);
    mrForm.addStyleName(ValoTheme.BUTTON_LINK);
    mrForm.addClickListener((Button.ClickEvent event) -> {
        Window sub = new MRFormWindow(getEmployeeId());
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }

        sub.addCloseListener((Window.CloseEvent e) -> {
            dataGrid.getContainerDataSource().removeAllItems();
            dataGrid.setContainerDataSource(new MRDataContainer(getEmployeeId()));
        });
    });

    addComponent(mrForm);
    setComponentAlignment(mrForm, Alignment.MIDDLE_RIGHT);

    addComponent(dataGrid);
    setExpandRatio(dataGrid, 2);
}