Examples of DropEnabledViewContentDisplay


Examples of org.thechiselgroup.choosel.dnd.client.resources.DropEnabledViewContentDisplay

        assert contentType != null;

        ViewContentDisplay viewContentDisplay = viewContentDisplayConfiguration
                .createDisplay(contentType);

        ViewContentDisplay contentDisplay = new DropEnabledViewContentDisplay(
                viewContentDisplay, contentDropTargetManager);

        ResourceModel resourceModel = new DefaultResourceModel(
                resourceSetFactory);

        if (viewContentDisplay instanceof RequiresAutomaticResourceSet) {
            ((RequiresAutomaticResourceSet) viewContentDisplay)
                    .setAutomaticResources(resourceModel
                            .getAutomaticResourceSet());
        }

        DefaultResourceModelPresenter resourceModelPresenter = new DefaultResourceModelPresenter(
                new ResourceSetAvatarResourceSetsPresenter(
                        allResourcesDragAvatarFactory),
                new ResourceSetAvatarResourceSetsPresenter(
                        userSetsDragAvatarFactory), resourceModel);

        DefaultSelectionModel selectionModel = new DefaultSelectionModel(
                selectionModelLabelFactory, resourceSetFactory);

        DefaultSelectionModelPresenter selectionModelPresenter = new DefaultSelectionModelPresenter(
                new ResourceSetAvatarResourceSetsPresenter(dropTargetFactory),
                new ResourceSetAvatarResourceSetsPresenter(
                        selectionDragAvatarFactory), selectionModel);

        Map<Slot, VisualItemValueResolver> fixedSlotResolvers = viewContentDisplayConfiguration
                .getFixedSlotResolvers(contentType);

        CompositeVisualItemBehavior visualItemBehaviors = new CompositeVisualItemBehavior();

        // visualItemBehaviors.add(new ViewInteractionLogger(logger));
        visualItemBehaviors.add(new HighlightingVisualItemBehavior(hoverModel));
        visualItemBehaviors.add(new DragVisualItemBehavior(dragEnablerFactory));
        visualItemBehaviors.add(new PopupWithHighlightingVisualItemBehavior(
                detailsWidgetHelper, popupManagerFactory, hoverModel));
        visualItemBehaviors.add(new SwitchSelectionOnClickVisualItemBehavior(
                selectionModel, commandManager));

        SlotMappingInitializer slotMappingInitializer = createSlotMappingInitializer(contentType);

        ResourceMultiCategorizer categorizer = createDefaultCategorizer(contentType);

        VisualizationModel visualizationModel = new FixedSlotResolversVisualizationModelDecorator(
                new DefaultVisualizationModel(contentDisplay,
                        selectionModel.getSelectionProxy(),
                        hoverModel.getResources(), visualItemBehaviors,
                        errorHandler, new DefaultResourceSetFactory(),
                        categorizer), fixedSlotResolvers);

        visualizationModel.setContentResourceSet(resourceModel.getResources());

        DefaultManagedSlotMappingConfiguration managedConfiguration = new DefaultManagedSlotMappingConfiguration(
                resolverFactoryProvider, slotMappingInitializer,
                visualizationModel, visualizationModel);

        /**
         * Visual Mappings Control is what sets up the side panel section that
         * handles mapping the slot to its resolvers.
         *
         */
        final VisualMappingsControl visualMappingsControl = createVisualMappingsControl(
                visualizationModel, managedConfiguration, contentType);
        assert visualMappingsControl != null : "createVisualMappingsControl must not return null";

        LightweightList<ViewPart> viewParts = createViewParts(contentType);

        LightweightList<SidePanelSection> sidePanelSections = createSidePanelSections(
                contentType, contentDisplay, visualMappingsControl,
                resourceModel, visualizationModel);

        for (ViewPart viewPart : viewParts) {
            viewPart.addSidePanelSections(sidePanelSections);
        }

        String label = contentDisplay.getName();

        managedConfiguration
                .addManagedSlotMappingConfigurationChangedEventHandler(new ManagedSlotMappingConfigurationChangedEventHandler() {
                    @Override
                    public void onSlotMappingStateChanged(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.