Search in sources :

Example 1 with UnitOverseer

use of eu.ggnet.dwoss.redtapext.ee.UnitOverseer in project dwoss by gg-net.

the class UnitAvailabillityTryout method main.

public static void main(String[] args) {
    Dl.remote().add(UnitOverseer.class, new UnitOverseer() {

        private Map<String, Tuple2<UnitShard, String>> data = new HashMap<>();

        {
            data.put("1", new Tuple2<>(new UnitShard("1", 1, "SopoNr.: 1", Boolean.TRUE, 1), "Details zu Unit 1"));
            data.put("2", new Tuple2<>(new UnitShard("2", 2, "SopoNr.: 2", Boolean.FALSE, 1), "Details zu Unit 2"));
            data.put("3", new Tuple2<>(new UnitShard("3", 3, "SopoNr.: 3", Boolean.TRUE, 1), "Details zu Unit 3"));
            data.put("4", new Tuple2<>(new UnitShard("4", 4, "SopoNr.: 4", Boolean.FALSE, 1), "Details zu Unit 4"));
            data.put("5", new Tuple2<>(new UnitShard("5", 5, "SopoNr.: 5 exitiert nicht", null, null), "Existiert Nicht"));
            data.put("6", new Tuple2<>(new UnitShard("6", 6, "SopoNr.: 6", Boolean.FALSE, null), "Details zu Unit 6"));
        }

        @Override
        public String toDetailedHtml(String refurbishId, String username) {
            if (!data.containsKey(refurbishId))
                return refurbishId + " existiert nicht";
            return data.get(refurbishId)._2;
        }

        @Override
        public UnitShard find(String refurbishId) {
            if (!data.containsKey(refurbishId))
                return new UnitShard(refurbishId, 0, "SopoNr.: " + refurbishId + " exitiert nicht", null, null);
            return data.get(refurbishId)._1;
        }

        @Override
        public boolean isAvailable(String refurbishId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void lockStockUnit(long dossierId, String refurbishedId) throws IllegalStateException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Result<List<Position>> createUnitPosition(String refurbishId, long documentId) throws UserInfoException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public String toDetailedHtml(int uniqueUnitId, String username) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    Ui.exec(() -> {
        UiCore.startSwing(() -> new JLabel("Main Application"));
        Ui.build().swing().show(() -> new UnitAvailabilityViewCask());
    });
}
Also used : UnitAvailabilityViewCask(eu.ggnet.dwoss.redtapext.ui.cap.UnitAvailabilityViewCask) UnitOverseer(eu.ggnet.dwoss.redtapext.ee.UnitOverseer) Position(eu.ggnet.dwoss.redtape.ee.entity.Position) UnitShard(eu.ggnet.dwoss.uniqueunit.api.UnitShard) JLabel(javax.swing.JLabel) Result(eu.ggnet.dwoss.util.interactiveresult.Result) Tuple2(eu.ggnet.dwoss.util.Tuple2) UserInfoException(eu.ggnet.dwoss.util.UserInfoException)

Aggregations

Position (eu.ggnet.dwoss.redtape.ee.entity.Position)1 UnitOverseer (eu.ggnet.dwoss.redtapext.ee.UnitOverseer)1 UnitAvailabilityViewCask (eu.ggnet.dwoss.redtapext.ui.cap.UnitAvailabilityViewCask)1 UnitShard (eu.ggnet.dwoss.uniqueunit.api.UnitShard)1 Tuple2 (eu.ggnet.dwoss.util.Tuple2)1 UserInfoException (eu.ggnet.dwoss.util.UserInfoException)1 Result (eu.ggnet.dwoss.util.interactiveresult.Result)1 JLabel (javax.swing.JLabel)1