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")));
}
}
}
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);
}
}
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();
}
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"));
}
Aggregations