Package org.locationtech.udig.catalog.ui.workflow

Examples of org.locationtech.udig.catalog.ui.workflow.ResourceSelectionState


                };
           }
        };
        if (mapImport.run(monitor, object)) {

            ResourceSelectionState state = mapImport.getDialog().getWorkflowWizard().getWorkflow()
                    .getState(ResourceSelectionState.class);

            Set<IGeoResource> keySet = state.getResources().keySet();

            ProjectUIPlugin.trace(Trace.DND, callingClass,
                    "converted " + object + " to " + keySet, null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

            return keySet;
View Full Code Here


    @Override
    protected Workflow createWorkflow() {
        // FIXME Andrea: Jody, this is the part that breaks DnD. Uncomment it to have it working
        // ResourceSearchState searchState = new ResourceSearchState();
        DataSourceSelectionState dsState = new DataSourceSelectionState(true);
        ResourceSelectionState rsState = new ResourceSelectionState();

        Workflow workflow = new Workflow(new State[]{dsState, rsState});
        // Workflow workflow = new Workflow(new State[] { searchState, rsState });
        return workflow;
    }
View Full Code Here

                    resourceList.add( (IGeoResource) item );
                }
            }
        }
        */
        ResourceSelectionState state = getWorkflow().getState(ResourceSelectionState.class);
        if( state != null ){
            java.util.Map<IGeoResource, IService> resourceMap = state.getResources();
            if (resourceMap != null && !resourceMap.isEmpty() ){
                resourceList.addAll( resourceMap.keySet() );
            }
        }
        if( resourceList.isEmpty() ){
View Full Code Here

        viewer.setLabelProvider(labelProvider);
        viewer.setAutoExpandLevel(3);

        // use the state to initialize ui
        ResourceSelectionState state = (ResourceSelectionState) getState();

        label = new Label(composite, SWT.NONE);
        label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        label.setText(MessageFormat.format(Messages.ResourceSelectionPage_NumLayersSelected,0));       
       
View Full Code Here

         
        }, true);
        assertTrue(workflowWizard.getWorkflow().getCurrentState() instanceof ResourceSelectionState);
       
        //check the resource page to ensure that it isn't ignored
        ResourceSelectionState currentState = (ResourceSelectionState) workflowWizard.getWorkflow().getCurrentState();

        assertTrue(currentState.getResources()==null || currentState.getResources().isEmpty());
       
        //Set the resources on the state and press finish
        IService service=currentState.getServices().iterator().next();
        Map<IGeoResource, IService> resources=new HashMap<IGeoResource, IService>();
       
        for (IResolve resolve : service.resources(new NullProgressMonitor())) {
      resources.put((IGeoResource) resolve, service);
    }
       
       
        currentState.setResources(resources);
       
        org.locationtech.udig.project.internal.Map activeMap = ApplicationGISInternal.getActiveMap();
        if( activeMap!=ApplicationGIS.NO_MAP )
            activeMap.getLayersInternal().clear();
View Full Code Here

    l.add("org.locationtech.udig.catalog.tests.ui.dummyPage"); //$NON-NLS-1$
   
    UDIGConnectionFactoryDescriptor d = ConnectionFactoryManager.instance().getConnectionFactoryDescriptors(l).get(0);

    connState = new EndConnectionState(d,true);
    state = new ResourceSelectionState();
    page = new ResourceSelectionPage("foo"); //$NON-NLS-1$
   
    Map<Class<? extends State>, WorkflowWizardPageProvider> map =
      new HashMap<Class<? extends State>, WorkflowWizardPageProvider>();
   
View Full Code Here

    l.add("org.locationtech.udig.catalog.ui.WMS"); //$NON-NLS-1$
   
    UDIGConnectionFactoryDescriptor d = ConnectionFactoryManager.instance().getConnectionFactoryDescriptors(l).get(0);
   
    conn = new EndConnectionState(d,true);
    state = new ResourceSelectionState();
 
    connPage = new ConnectionPageDecorator();
    page = new ResourceSelectionPage("foo"); //$NON-NLS-1$

    Map<Class<? extends State>, WorkflowWizardPageProvider> map =
View Full Code Here

            shell.setActive();
            Map<Class< ? extends State>, WorkflowWizardPageProvider> pageMapping=new HashMap<Class<? extends State>, WorkflowWizardPageProvider>();
            ResourceSelectionPage resourceSelectionPage = new ResourceSelectionPage(Messages.AddToNewMap_resource_selection_page_title);
            resourceSelectionPage.setCollapseCheckedInput(true);
            pageMapping.put(ResourceSelectionState.class, new BasicWorkflowWizardPageFactory(resourceSelectionPage));
            ResourceSelectionState resourceSelectionState = new ResourceSelectionState();
            resourceSelectionState.setServices(services);
            Workflow workflow=new Workflow(new State[]{resourceSelectionState});
            workflow.setContext(resources);
            WorkflowWizard wizard = new WorkflowWizard(workflow, pageMapping);
            WorkflowWizardDialog dialog = new WorkflowWizardDialog(Display.getCurrent().getActiveShell(), wizard);
            dialog.setBlockOnOpen(true);
            dialog.open();
            if (dialog.getReturnCode()==IDialogConstants.CANCEL_ID )
                return null;
            resources=resourceSelectionState.getResources().keySet();
        }
        return resources;
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.ui.workflow.ResourceSelectionState

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.