Package com.serotonin.m2m2.i18n

Examples of com.serotonin.m2m2.i18n.TranslatableMessage


        if (!active)
            day = inactiveDay;

        if (day == -3)
            return new TranslatableMessage("common.day.thirdLast");
        if (day == -2)
            return new TranslatableMessage("common.day.secondLastLast");
        if (day == -1)
            return new TranslatableMessage("common.day.last");
        if (day != 11 && day % 10 == 1)
            return new TranslatableMessage("common.counting.st", Integer.toString(day));
        if (day != 12 && day % 10 == 2)
            return new TranslatableMessage("common.counting.nd", Integer.toString(day));
        if (day != 13 && day % 10 == 3)
            return new TranslatableMessage("common.counting.rd", Integer.toString(day));
        return new TranslatableMessage("common.counting.th", Integer.toString(day));
    }
View Full Code Here


    private TranslatableMessage month(boolean active) {
        int day = activeDay;
        if (!active)
            day = inactiveDay;
        return new TranslatableMessage(months[day]);
    }
View Full Code Here

* @author Matthew Lohbihler
*/
public class EnvCanDataSourceVO extends DataSourceVO<EnvCanDataSourceVO> {
    @Override
    protected void addEventTypes(List<EventTypeVO> ets) {
        ets.add(createEventType(EnvCanDataSourceRT.DATA_RETRIEVAL_FAILURE_EVENT, new TranslatableMessage(
                "event.ds.dataSource"), EventType.DuplicateHandling.IGNORE_SAME_MESSAGE, AlarmLevels.URGENT));
        ets.add(createEventType(EnvCanDataSourceRT.PARSE_EXCEPTION_EVENT, new TranslatableMessage("event.ds.dataParse")));
    }
View Full Code Here

        return EVENT_CODES;
    }

    @Override
    public TranslatableMessage getConnectionDescription() {
        return new TranslatableMessage("envcands.dsconn", stationId);
    }
View Full Code Here

        return sb.toString();
    }

    @Override
    public TranslatableMessage getSourceDisabledMessage() {
        return new TranslatableMessage("event.rtn.maintDisabled");
    }
View Full Code Here

    }

    @Override
    public TranslatableMessage getConfigurationDescription() {
        if (ATTRIBUTE_CODES.isValidId(attributeId))
            return new TranslatableMessage(ATTRIBUTE_CODES.getKey(attributeId));
        return new TranslatableMessage("common.unknown");
    }
View Full Code Here

    public String getTypeName() {
        return definition().getName();
    }

    public TranslatableMessage getDisplayName() {
        return new TranslatableMessage(definition().getNameKey());
    }
View Full Code Here

    public void validate(ProcessResult response) {
        super.validate(response);

        for (Integer index : stateImageMap.values()) {
            if (index < 0)
                response.addMessage("stateImageMappings", new TranslatableMessage("validate.cannotBeNegative"));
        }
        if (defaultImage < 0)
            response.addMessage("defaultImageIndex", new TranslatableMessage("validate.cannotBeNegative"));

        if (imageSet != null) {
            for (Integer index : stateImageMap.values()) {
                if (index >= imageSet.getImageCount())
                    response.addMessage("stateImageMappings", new TranslatableMessage(
                            "emport.error.component.imageIndex", index, imageSet.getId(), imageSet.getImageCount() - 1));
            }
            if (defaultImage >= imageSet.getImageCount())
                response.addMessage("defaultImageIndex", new TranslatableMessage("emport.error.component.imageIndex",
                        defaultImage, imageSet.getId(), imageSet.getImageCount() - 1));
        }
    }
View Full Code Here

    }

    private void addChildImpl(String id, String descriptionKey, ViewComponent viewComponent, int[] dataTypesOverride) {
        viewComponent.setIndex(getIndex());
        viewComponent.setIdSuffix("-" + id);
        children.add(new CompoundChild(id, new TranslatableMessage(descriptionKey), viewComponent, dataTypesOverride));
    }
View Full Code Here

    @Override
    public void validate(ProcessResult response) {
        super.validate(response);

        if (zeroImage < 0)
            response.addMessage("zeroImageIndex", new TranslatableMessage("validate.cannotBeNegative"));
        if (oneImage < 0)
            response.addMessage("oneImageIndex", new TranslatableMessage("validate.cannotBeNegative"));

        if (imageSet != null) {
            if (zeroImage >= imageSet.getImageCount())
                response.addMessage("zeroImageIndex", new TranslatableMessage("emport.error.component.imageIndex",
                        zeroImage, imageSet.getId(), imageSet.getImageCount() - 1));
            if (oneImage >= imageSet.getImageCount())
                response.addMessage("oneImageIndex", new TranslatableMessage("emport.error.component.imageIndex",
                        oneImage, imageSet.getId(), imageSet.getImageCount() - 1));
        }
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.i18n.TranslatableMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.