Package org.thechiselgroup.choosel.core.client.visualization.model.managed

Examples of org.thechiselgroup.choosel.core.client.visualization.model.managed.ManagedVisualItemValueResolver


            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


        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

        selector.setSelectedValue(resolver.getProperty());
        return selector.asWidget();
    }

    private PropertyDependantVisualItemValueResolver getCurrentResolverFromUIModel() {
        ManagedVisualItemValueResolver currentResolver = uiModel
                .getCurrentResolver();

        // XXX cannot cast because it is actually the Decorator that we are
        // getting, and the delegate is the thing that is PropertyDependant
        assert currentResolver instanceof PropertyDependantVisualItemValueResolver;
View Full Code Here

        // TODO in the future, errors in these two things would likely be
        // handled, instead of exceptions being thrown
        assert state.isAllowable();
        assert state.isConfigured();

        ManagedVisualItemValueResolver resolver = state.getResolver();

        SlotControl slotControl = slotToSlotControls.get(slot);
        if (slotControl == null) {
            // The slot Control has not yet been initialized, initialize it and
            // set the resolverUI
            slotControl = createSlotControl(slot, resolver);
        } else if (!resolver.getId().equals(
                slotControl.getCurrentResolverUIId())) {
            // only the factory has changed, and we need to update the
            // resolverUI
            slotControl.setNewUIModel(createUIControllerFromResolver(slot,
                    resolver));
View Full Code Here

                toCollection(slots));
        return delegatingResolver;
    }

    public static ManagedVisualItemValueResolver mockManagedResolver(String id) {
        ManagedVisualItemValueResolver resolver = mock(ManagedVisualItemValueResolver.class);
        when(resolver.getTargetSlots()).thenReturn(
                LightweightCollections.<Slot> emptyCollection());
        when(resolver.getId()).thenReturn(id);
        return resolver;
    }
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.visualization.model.managed.ManagedVisualItemValueResolver

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.