Search in sources :

Example 31 with Messages

use of com.haulmont.cuba.core.global.Messages in project cuba by cuba-platform.

the class WebRelatedEntities method refreshNavigationActions.

protected void refreshNavigationActions() {
    ComponentContainer actionContainer = (ComponentContainer) vPopupComponent;
    actionContainer.removeAllComponents();
    actionOrder.clear();
    if (listComponent != null) {
        MetaClass metaClass = listComponent.getDatasource().getMetaClass();
        Pattern excludePattern = null;
        if (excludeRegex != null) {
            excludePattern = Pattern.compile(excludeRegex);
        }
        for (MetaProperty metaProperty : metaClass.getProperties()) {
            if (RelatedEntitiesSecurity.isSuitableProperty(metaProperty, metaClass) && (excludePattern == null || !excludePattern.matcher(metaProperty.getName()).matches())) {
                addNavigationAction(metaClass, metaProperty);
            }
        }
        if (actionContainer.getComponentCount() == 0) {
            Messages messages = AppBeans.get(Messages.NAME);
            actionContainer.addComponent(new Label(messages.getMainMessage("actions.Related.Empty")));
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) Messages(com.haulmont.cuba.core.global.Messages) MetaClass(com.haulmont.chile.core.model.MetaClass) ComponentContainer(com.vaadin.ui.ComponentContainer) Label(com.vaadin.ui.Label) MetaProperty(com.haulmont.chile.core.model.MetaProperty)

Example 32 with Messages

use of com.haulmont.cuba.core.global.Messages in project cuba by cuba-platform.

the class CubaFileUploadWrapper method setFileNameButtonCaption.

public void setFileNameButtonCaption(String title) {
    this.fileName = title;
    if (StringUtils.isNotEmpty(title)) {
        fileNameButton.setCaption(title);
        fileNameButton.removeStyleName(EMPTY_VALUE_STYLENAME);
    } else {
        Messages messages = AppBeans.get(Messages.NAME);
        fileNameButton.setCaption(messages.getMainMessage("FileUploadField.fileNotSelected"));
        fileNameButton.addStyleName(EMPTY_VALUE_STYLENAME);
    }
}
Also used : Messages(com.haulmont.cuba.core.global.Messages)

Example 33 with Messages

use of com.haulmont.cuba.core.global.Messages in project cuba by cuba-platform.

the class CubaFileUploadWrapper method initLayout.

protected void initLayout(UploadComponent uploadComponent) {
    this.uploadButton = uploadComponent;
    container = new HorizontalLayout();
    container.setSpacing(true);
    container.addStyleName("c-fileupload-container");
    fileNameButton = new Button();
    fileNameButton.setWidth("100%");
    fileNameButton.addStyleName(BUTTON_LINK);
    fileNameButton.addStyleName("c-fileupload-filename");
    setFileNameButtonCaption(null);
    container.addComponent(fileNameButton);
    container.setComponentAlignment(fileNameButton, Alignment.MIDDLE_LEFT);
    container.addComponent(uploadComponent);
    Messages messages = AppBeans.get(Messages.NAME);
    clearButton = new Button(messages.getMainMessage("FileUploadField.clearButtonCaption"));
    clearButton.setStyleName("c-fileupload-clear");
    container.addComponent(clearButton);
    setShowClearButton(showClearButton);
    setShowFileName(false);
    setWidthUndefined();
}
Also used : Messages(com.haulmont.cuba.core.global.Messages)

Example 34 with Messages

use of com.haulmont.cuba.core.global.Messages in project cuba by cuba-platform.

the class WebColorPicker method setCaptions.

protected void setCaptions() {
    Messages messages = AppBeans.get(Messages.NAME);
    component.setPopupCaption(messages.getMainMessage("colorPicker.popupCaption"));
    component.setSwatchesTabCaption(messages.getMainMessage("colorPicker.swatchesTabCaption"));
    component.setConfirmButtonCaption(messages.getMainMessage("colorPicker.confirmButtonCaption"));
    component.setCancelButtonCaption(messages.getMainMessage("colorPicker.cancelButtonCaption"));
    component.setLookupAllCaption(messages.getMainMessage("colorPicker.lookupAll"));
    component.setLookupRedCaption(messages.getMainMessage("colorPicker.lookupRed"));
    component.setLookupGreenCaption(messages.getMainMessage("colorPicker.lookupGreen"));
    component.setLookupBlueCaption(messages.getMainMessage("colorPicker.lookupBlue"));
    component.setRedSliderCaption(messages.getMainMessage("colorPicker.redSliderCaption"));
    component.setGreenSliderCaption(messages.getMainMessage("colorPicker.greenSliderCaption"));
    component.setBlueSliderCaption(messages.getMainMessage("colorPicker.blueSliderCaption"));
    component.setHueSliderCaption(messages.getMainMessage("colorPicker.hueSliderCaption"));
    component.setSaturationSliderCaption(messages.getMainMessage("colorPicker.saturationSliderCaption"));
    component.setValueSliderCaption(messages.getMainMessage("colorPicker.valueSliderCaption"));
}
Also used : Messages(com.haulmont.cuba.core.global.Messages)

Aggregations

Messages (com.haulmont.cuba.core.global.Messages)34 Configuration (com.haulmont.cuba.core.global.Configuration)4 ClientConfig (com.haulmont.cuba.client.ClientConfig)3 File (java.io.File)3 MetaClass (com.haulmont.chile.core.model.MetaClass)2 FileStorageException (com.haulmont.cuba.core.global.FileStorageException)2 CollectionDatasource (com.haulmont.cuba.gui.data.CollectionDatasource)2 ThemeConstants (com.haulmont.cuba.gui.theme.ThemeConstants)2 FileUploadingAPI (com.haulmont.cuba.gui.upload.FileUploadingAPI)2 AppUI (com.haulmont.cuba.web.AppUI)2 CubaButton (com.haulmont.cuba.web.toolkit.ui.CubaButton)2 CubaWindow (com.haulmont.cuba.web.toolkit.ui.CubaWindow)2 FileOutputStream (java.io.FileOutputStream)2 IOException (java.io.IOException)2 Pattern (java.util.regex.Pattern)2 MetaProperty (com.haulmont.chile.core.annotations.MetaProperty)1 EnumClass (com.haulmont.chile.core.datatypes.impl.EnumClass)1 Instance (com.haulmont.chile.core.model.Instance)1 MetaProperty (com.haulmont.chile.core.model.MetaProperty)1 AbstractInstance (com.haulmont.chile.core.model.impl.AbstractInstance)1