Search in sources :

Example 56 with Messages

use of com.haulmont.cuba.core.global.Messages 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

Messages (com.haulmont.cuba.core.global.Messages)56 ClientConfig (com.haulmont.cuba.client.ClientConfig)7 Configuration (com.haulmont.cuba.core.global.Configuration)7 Notifications (com.haulmont.cuba.gui.Notifications)5 Icons (com.haulmont.cuba.gui.icons.Icons)4 CubaButton (com.haulmont.cuba.web.widgets.CubaButton)4 File (java.io.File)4 MetaClass (com.haulmont.chile.core.model.MetaClass)3 FileStorageException (com.haulmont.cuba.core.global.FileStorageException)3 UserSessionSource (com.haulmont.cuba.core.global.UserSessionSource)3 WindowManager (com.haulmont.cuba.gui.WindowManager)3 ThemeConstants (com.haulmont.cuba.gui.theme.ThemeConstants)3 FileUploadingAPI (com.haulmont.cuba.gui.upload.FileUploadingAPI)3 UserSession (com.haulmont.cuba.security.global.UserSession)3 FileOutputStream (java.io.FileOutputStream)3 IOException (java.io.IOException)3 Locale (java.util.Locale)3 MetaProperty (com.haulmont.chile.core.annotations.MetaProperty)2 Metadata (com.haulmont.cuba.core.global.Metadata)2 Dialogs (com.haulmont.cuba.gui.Dialogs)2