Search in sources :

Example 16 with CubaButton

use of com.haulmont.cuba.web.widgets.CubaButton in project cuba by cuba-platform.

the class WindowBreadCrumbs method setBeanLocator.

public void setBeanLocator(BeanLocator beanLocator) {
    setWidth(100, Unit.PERCENTAGE);
    setHeightUndefined();
    setPrimaryStyleName(C_HEADLINE_CONTAINER);
    if (workAreaMode == Mode.TABBED) {
        super.setVisible(false);
    }
    Layout logoLayout = createLogoLayout();
    linksLayout = createLinksLayout();
    linksLayout.setSizeUndefined();
    if (workAreaMode == Mode.SINGLE) {
        Messages messages = beanLocator.get(Messages.NAME);
        CubaButton closeBtn = new CubaButton("");
        closeBtn.setDescription(messages.getMainMessage("windowBreadCrumbs.closeButton.description"));
        closeBtn.setClickHandler(this::onCloseWindowButtonClick);
        closeBtn.setIcon(resolveIcon(beanLocator, CubaIcon.CLOSE));
        closeBtn.setStyleName("c-closetab-button");
        this.closeBtn = closeBtn;
    }
    Layout enclosingLayout = createEnclosingLayout();
    enclosingLayout.addComponent(linksLayout);
    addComponent(logoLayout);
    addComponent(enclosingLayout);
    boolean controlsVisible = beanLocator.get(Configuration.class).getConfig(WebConfig.class).getShowBreadCrumbs();
    enclosingLayout.setVisible(controlsVisible);
    if (closeBtn != null) {
        addComponent(closeBtn);
    }
}
Also used : Messages(com.haulmont.cuba.core.global.Messages) CssLayout(com.vaadin.ui.CssLayout) Layout(com.vaadin.ui.Layout) CubaButton(com.haulmont.cuba.web.widgets.CubaButton) WebConfig(com.haulmont.cuba.web.WebConfig)

Aggregations

CubaButton (com.haulmont.cuba.web.widgets.CubaButton)16 Messages (com.haulmont.cuba.core.global.Messages)5 Action (com.haulmont.cuba.gui.components.Action)4 TestIdManager (com.haulmont.cuba.gui.sys.TestIdManager)4 ClientConfig (com.haulmont.cuba.client.ClientConfig)3 Configuration (com.haulmont.cuba.core.global.Configuration)2 Icons (com.haulmont.cuba.gui.icons.Icons)2 AppUI (com.haulmont.cuba.web.AppUI)2 Connection (com.haulmont.cuba.web.Connection)2 CubaLabel (com.haulmont.cuba.web.widgets.CubaLabel)2 CubaWindow (com.haulmont.cuba.web.widgets.CubaWindow)2 ShortcutAction (com.vaadin.event.ShortcutAction)2 CssLayout (com.vaadin.ui.CssLayout)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 Window (com.vaadin.ui.Window)2 Locale (java.util.Locale)2 KeyCombination (com.haulmont.cuba.gui.components.KeyCombination)1 BaseAction (com.haulmont.cuba.gui.components.actions.BaseAction)1 InputDialogAction (com.haulmont.cuba.gui.components.inputdialog.InputDialogAction)1 ShowInfoAction (com.haulmont.cuba.gui.components.sys.ShowInfoAction)1