Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.IProject


        setWindowTitle(Messages.ExportProjectWizard_Title);
        setNeedsProgressMonitor(true);
        selectionPage = new ExportSelectionPage(Messages.ExportSelectionPage_Destination,
                Messages.ExportProjectWizard_Destination2, wizardPageIconDescriptor);
        Object selectionObj = selection.getFirstElement();
        IProject project = null;
        if (selectionObj instanceof MapImpl) {
            MapImpl map = (MapImpl) selectionObj;
            project = map.getProject();
        }
        if (selectionObj instanceof IProject) {
            project = (IProject) selectionObj;
        }
        if (project != null) {
            selectionPage.selectProject(project.getID().toString());
        }
        this.selection = selection;
    }
View Full Code Here


    try {
      IProgressMonitor monitor = getViewSite().getActionBars().getStatusLineManager().getProgressMonitor();
      viewer = new MapViewer(parent, SWT.DOUBLE_BUFFERED);
      List<IGeoResource> resources = new ArrayList<IGeoResource>();
      createResources(resources, monitor);
      IProject activeProject = ApplicationGIS.getActiveProject();

      CreateMapCommand command = new CreateMapCommand("NewMap",resources , activeProject);
      activeProject.sendSync(command);
      Map createdMap = (Map) command.getCreatedMap();
      viewer.setMap(createdMap);
      viewer.init(this);

     
View Full Code Here

        if(map==NO_MAP){
            map = null;
        }
       
        IProject project = project2;
        if (project == null) {
            if (map == null)
                project = ProjectPlugin.getPlugin().getProjectRegistry()
                        .getCurrentProject();
            else
                project = map.getProject();
        }
        List<? extends ILayer> layers;
       
        /*
         * Check or not for duplicate layers in context of the map where georesources are added.
         */
        List<IGeoResource> cleanedGeoResources;
        if(ProjectPlugin.getPlugin().getPluginPreferences().getBoolean(PreferenceConstants.P_CHECK_DUPLICATE_LAYERS)){
            cleanedGeoResources = ProjectUtil.cleanDuplicateGeoResources(resourceList, map);
        }else{
            cleanedGeoResources = resourceList;
        }
       
        if (map == null) {
            CreateMapCommand cmCommand = new CreateMapCommand(null, cleanedGeoResources, project);
            project.sendSync(cmCommand);
            map = cmCommand.getCreatedMap();
            layers=map.getMapLayers();
        } else {
            AddLayersCommand alCommand = new AddLayersCommand(cleanedGeoResources, startPosition2);
            map.sendCommandSync(alCommand);
View Full Code Here

    public void init( IWorkbenchWindow window ) {
    }
   
    public void run( IAction action ) {
        IProject project = ApplicationGIS.getActiveProject();
        ProjectElementAdapter element = ApplicationGIS.createGeneralProjectElement(project ,
                MyProjectElement.class, MyProjectElement.EXT_ID);
        MyProjectElement myElement = (MyProjectElement) element.getBackingObject();
        if( random.nextBoolean() ){
            StringBuilder builder = new StringBuilder();
View Full Code Here

            Object next = iter.next();
            IMap map = cast(maps, next, IMap.class);
            if (map != null) {
                maps.add(map);
            } else {
                IProject project = cast(maps, next, IProject.class);
                if (project != null) {
                    maps.addAll(project.getElements(IMap.class));
                }
            }
        }

        if (maps.isEmpty()) {
View Full Code Here

    }

    private ILayer getLayer() {
        if( layer==null ){
            List< ? extends IProject> projects = ApplicationGIS.getProjects();
            IProject found=null;
            for( IProject project : projects ) {
                if( project.getID().toString().equals(projectID)){
                    found=project;
                    break;
                }
            }
            if( found==null )
                throw new IllegalStateException("This issue is not legal for this uDig instance because the project:"+projectID+" cannot be found."); //$NON-NLS-1$ //$NON-NLS-2$
            List<IMap> maps = found.getElements(IMap.class);
            IMap foundMap=null;
            for( IMap map : maps ) {
                if( map.getID().toString().equals(mapID) ){
                    foundMap=map;
                }
View Full Code Here

                        element, reveal));
                contentProvider.removeListener(old);
                contentProvider.addListener(inputChangedListener.get());
            }
            for( IProjectElement element2 : element ) {
                IProject project = element2.getProject();
                treeViewer.setExpandedState(project, true);
            }
        }
    }
View Full Code Here

    /**
     * @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
     */
    public void run( IAction action ) {
        for( Iterator iter = selection.iterator(); iter.hasNext(); ) {
            IProject project = (IProject) iter.next();
            for( IProjectElement element : project.getElements() ) {
                for( UDIGEditorInputDescriptor desc : ApplicationGIS.getEditorInputs(element) ) {
                    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                            .getActivePage();
                    IEditorPart editor = page.findEditor(desc.createInput(element));
                    if (editor != null)
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.IProject

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.