Package org.thechiselgroup.choosel.core.client.persistence

Examples of org.thechiselgroup.choosel.core.client.persistence.Memento


                .getValue(MEMENTO_ZOOM_LEVEL)));
    }

    @Override
    public Memento save(ResourceSetCollector resourceSetCollector) {
        Memento state = new Memento();

        saveCenterPosition(state);
        saveZoomLevel(state);
        state.setValue(MEMENTO_MAP_TYPE, getMapType());

        return state;
    }
View Full Code Here


        assert memento != null;
        assert configuration != null;

        for (Entry<String, Memento> entry : memento.getChildren().entrySet()) {
            String slotId = entry.getKey();
            Memento child = entry.getValue();

            assert child.getFactoryId() != null : "factory id must not be null ("
                    + child + ")";

            Slot slot = configuration.getSlotById(slotId);
            ManagedVisualItemValueResolver resolver = visualItemResolverFactoryPersistenceManagers
                    .get(child.getFactoryId()).restore(child);

            configuration.setCurrentResolver(slot, resolver);
        }
    }
View Full Code Here

    @Override
    public Memento save(ManagedSlotMappingConfiguration configuration) {
        assert configuration != null;

        Memento memento = new Memento();

        Slot[] slots = configuration.getSlots();
        for (Slot slot : slots) {
            if (configuration.isConfigured(slot)) {
                ManagedVisualItemValueResolver resolver = configuration
                        .getCurrentResolver(slot);

                Memento child = visualItemResolverFactoryPersistenceManagers
                        .get(resolver.getId()).save(resolver);
                child.setFactoryId(resolver.getId());
                memento.addChild(slot.getId(), child);
            }
        }

        return memento;
View Full Code Here

        return resolverFactory.create();
    }

    @Override
    public Memento save(ManagedVisualItemValueResolver o) {
        return new Memento();
    }
View Full Code Here

            ResourceSetAccessor accessor) {
    }

    @Override
    public Memento save(ResourceSetCollector resourceSetCollector) {
        return new Memento();
    }
View Full Code Here

        return resolverFactory.create(property);
    }

    @Override
    public Memento save(ManagedVisualItemValueResolver o) {
        Memento memento = new Memento();
        memento.setValue(PROPERTY_KEY,
                ((PropertyDependantManagedVisualItemValueResolverDecorator) o)
                        .getProperty());
        return memento;
    }
View Full Code Here

        noteArea.setText((String) state.getValue(MEMENTO_NOTE));
    }

    @Override
    public Memento save(ResourceSetCollector resourceSetCollector) {
        Memento state = new Memento();
        state.setValue(MEMENTO_NOTE, noteArea.getValue());
        return state;
    }
View Full Code Here

    }

    private void restoreFilter(Memento state,
            PersistableRestorationService restorationService,
            ResourceSetAccessor accessor) {
        Memento child = state.getChild(MEMENTO_FILTER_PREDICATE);
        if (child != null) {
            Predicate<Resource> filterPredicate = (Predicate<Resource>) restorationService
                    .restoreFromMemento(child, accessor);
            filteredResources.setFilterPredicate(filterPredicate);
        }
View Full Code Here

        }
    }

    @Override
    public Memento save(ResourceSetCollector resourceSetCollector) {
        Memento memento = new Memento();

        storeFilterPredicate(resourceSetCollector, memento);
        storeAutomaticResources(resourceSetCollector, memento);
        storeUserResourceSets(resourceSetCollector, memento);
View Full Code Here

            ResourceSetCollector resourceSetCollector, Memento memento) {

        Predicate<Resource> filterPredicate = filteredResources
                .getFilterPredicate();
        if (filterPredicate instanceof Persistable) {
            Memento save = ((Persistable) filterPredicate)
                    .save(resourceSetCollector);
            memento.addChild(MEMENTO_FILTER_PREDICATE, save);
        }
    }
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.persistence.Memento

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.