Package org.exoplatform.portal.mop.i18n

Examples of org.exoplatform.portal.mop.i18n.I18NAdapter$LifeCycle


        Fill fi = new Fill(inputs.eClearSale.map(u -> Unit.UNIT),
                           inputs.eFuelPulses, inputs.calibration,
                           inputs.price1, inputs.price2, inputs.price3,
                           eStart);
        NotifyPointOfSale np = new NotifyPointOfSale(
                new LifeCycle(inputs.eNozzle1,
                              inputs.eNozzle2,
                              inputs.eNozzle3),
                inputs.eClearSale,
                fi);
        eStart.loop(np.eStart);
View Full Code Here


import sodium.*;
import java.util.Optional;

public class AccumulatePulsesPump implements Pump {
    public Outputs create(Inputs inputs) {
        LifeCycle lc = new LifeCycle(inputs.eNozzle1,
                                     inputs.eNozzle2,
                                     inputs.eNozzle3);
        Behavior<Double> litersDelivered =
                accumulate(lc.eStart.map(u -> Unit.UNIT),
                           inputs.eFuelPulses,
View Full Code Here

                          inputs.eClearSale.map(u -> Unit.UNIT),
                          inputs.eFuelPulses, inputs.calibration,
                          inputs.price1, inputs.price2, inputs.price3,
                          eStart);
        NotifyPointOfSale np = new NotifyPointOfSale(
                new LifeCycle(inputs.eNozzle1,
                              inputs.eNozzle2,
                              inputs.eNozzle3),
                inputs.eClearSale,
                fi);
        eStart.loop(np.eStart);
View Full Code Here

import sodium.*;
import java.util.Optional;

public class ShowDollarsPump implements Pump {
    public Outputs create(Inputs inputs) {
        LifeCycle lc = new LifeCycle(inputs.eNozzle1,
                                     inputs.eNozzle2,
                                     inputs.eNozzle3);
        Fill fi = new Fill(lc.eStart.map(u -> Unit.UNIT),
                           inputs.eFuelPulses, inputs.calibration,
                           inputs.price1, inputs.price2, inputs.price3,
View Full Code Here

    protected abstract Described.State getState(POMSession session, CacheKey key);

    protected final CacheValue getValue(POMSession session, CacheKey key) {
        WorkspaceObject obj = session.findObjectById(key.id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Resolution<Described> res = able.resolveI18NMixin(Described.class, key.locale);
        if (res != null) {
            Described.State state = res.getMixin().getState();
            if (key.locale.equals(res.getLocale())) {
                CacheValue foo = new CacheValue(state);
                putValue(key, foo);
View Full Code Here

        if (locale == null) {
            throw new NullPointerException("No null locale accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getI18NMixin(Described.class, locale, false);
        return desc != null ? desc.getState() : null;
    }
View Full Code Here

        if (locale == null) {
            throw new NullPointerException("No null locale accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getI18NMixin(Described.class, locale, true);
        cache.removeState(new CacheKey(locale, id));
        desc.setState(description);
    }
View Full Code Here

        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getMixin(Described.class, false);
        return desc != null ? desc.getState() : null;
    }
View Full Code Here

        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        if (description != null) {
            Described desc = able.getMixin(Described.class, true);
            desc.setState(description);
        } else {
            able.removeMixin(Described.class);
        }
    }
View Full Code Here

        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Map<Locale, Described> mixins = able.getI18NMixin(Described.class);
        Map<Locale, Described.State> names = null;
        if (mixins != null) {
            names = new HashMap<Locale, Described.State>(mixins.size());
            for (Map.Entry<Locale, Described> entry : mixins.entrySet()) {
                names.put(entry.getKey(), entry.getValue().getState());
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.i18n.I18NAdapter$LifeCycle

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.