Search in sources :

Example 1 with IMessage

use of org.jowidgets.i18n.api.IMessage in project jo-client-platform by jo-source.

the class MoveOrderedBeanActionBuilderImpl method setDefaultUpText.

private void setDefaultUpText() {
    final String entityLabel = getEntityLabel();
    if (EmptyCheck.isEmpty(entityLabel)) {
        executorActionBuilder.setText(Messages.getMessage("MoveOrderedBeanActionBuilder.move_up_label").get());
    } else {
        final IMessage message = Messages.getMessage("MoveOrderedBeanActionBuilder.move_up_label_entity");
        executorActionBuilder.setText(MessageReplacer.replace(message, entityLabel));
    }
}
Also used : IMessage(org.jowidgets.i18n.api.IMessage)

Example 2 with IMessage

use of org.jowidgets.i18n.api.IMessage in project jo-client-platform by jo-source.

the class MoveOrderedBeanActionBuilderImpl method setDefaultDownText.

private void setDefaultDownText() {
    final String entityLabel = getEntityLabel();
    if (EmptyCheck.isEmpty(entityLabel)) {
        executorActionBuilder.setText(Messages.getMessage("MoveOrderedBeanActionBuilder.move_down_label").get());
    } else {
        final IMessage message = Messages.getMessage("MoveOrderedBeanActionBuilder.move_down_label_entity");
        executorActionBuilder.setText(MessageReplacer.replace(message, entityLabel));
    }
}
Also used : IMessage(org.jowidgets.i18n.api.IMessage)

Example 3 with IMessage

use of org.jowidgets.i18n.api.IMessage in project jo-client-platform by jo-source.

the class MoveOrderedBeanActionBuilderImpl method setEntityLabels.

@Override
public IMoveOrderedBeanActionBuilder<BEAN_TYPE> setEntityLabels(final Object entityId) {
    checkExhausted();
    if (entityId != null) {
        final IEntityService entityService = ServiceProvider.getService(IEntityService.ID);
        if (entityService != null) {
            final IBeanDtoDescriptor descriptor = entityService.getDescriptor(entityId);
            if (descriptor != null) {
                final IMessage labelSingular = descriptor.getLabelSingular();
                if (labelSingular != null && !EmptyCheck.isEmpty(labelSingular.get())) {
                    setEntityLabelSingular(labelSingular.get());
                }
                final IMessage labelPlural = descriptor.getLabelPlural();
                if (labelPlural != null && !EmptyCheck.isEmpty(labelPlural.get())) {
                    setEntityLabelPlural(labelPlural.get());
                }
            }
        }
    }
    return this;
}
Also used : IMessage(org.jowidgets.i18n.api.IMessage) IEntityService(org.jowidgets.cap.common.api.service.IEntityService) IBeanDtoDescriptor(org.jowidgets.cap.common.api.bean.IBeanDtoDescriptor)

Aggregations

IMessage (org.jowidgets.i18n.api.IMessage)3 IBeanDtoDescriptor (org.jowidgets.cap.common.api.bean.IBeanDtoDescriptor)1 IEntityService (org.jowidgets.cap.common.api.service.IEntityService)1