Package org.locationtech.udig.project.ui.internal

Examples of org.locationtech.udig.project.ui.internal.MapEditorPart


    }
   
    assertEquals(map,ApplicationGIS.getActiveMap());
   
   
    MapEditorPart mapEditor = (MapEditorPart) PlatformUI.getWorkbench()
      .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    assertNotNull(mapEditor);
   
    MapEditorInput input = (MapEditorInput) mapEditor.getEditorInput();
    assertEquals(map, input.getProjectElement());
  }
View Full Code Here


                data.verticalSpan = 1;
                button.setLayoutData(data);
                button.addListener(SWT.MouseUp, new Listener(){

                    public void handleEvent( Event event ) {
                        MapEditorPart editor = (MapEditorPart) PlatformUI.getWorkbench()
                                .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
                        Map map = editor.getMap();
                        Envelope env = geometry.getEnvelopeInternal();
                        try {
                            env = JTS.transform(env, map.getEditManager().getEditLayer()
                                    .layerToMapTransform());
                        } catch (Exception e1) {
View Full Code Here

                display=Display.getDefault();
            }
            final IToolContext context=this.context;
            display.asyncExec(new Runnable(){
                public void run() {
                    MapEditorPart editor = ApplicationGISInternal.findMapEditor(context.getMap());
                    if( editor !=null  && !editor.isDragging() ){
                        editor.setDragging(true);
                    }
                }
            });
        }
       
View Full Code Here

                display=Display.getDefault();
            }
            final IToolContext context=this.context;
            display.asyncExec(new Runnable(){
                public void run() {
                    MapEditorPart editor = ApplicationGISInternal.findMapEditor(context.getMap());
                    if( editor !=null  && editor.isDragging() ){
                        editor.setDragging(false);
                    }
                }
            });
        }
    }
View Full Code Here

                            || url.toLowerCase().indexOf("postgis:jdbc://") != -1 //$NON-NLS-1$
                            || recognizedFile(url)) {
                        event.doit=false;

                        UDIGDropHandler dropHandler = new UDIGDropHandler();
                        MapEditorPart editor = ApplicationGISInternal.getActiveEditor();
                        dropHandler.setTarget(editor);
                        dropHandler.performDrop(url, null);
                    }
                }
                private boolean recognizedFile( String url ) {
View Full Code Here

    for (ILayer layer : layers) {
      assertLayerType(layer,typeNames, ShapefileDataStore.class);
    }
       

        MapEditorPart activeEditor = ApplicationGISInternal.getActiveEditor();
        UDIGDropHandler dropHandler = activeEditor.getDropHandler();
        dropHandler.setTarget(activeEditor);
        dropHandler.setViewerLocation(ViewerDropLocation.NONE);
        dropHandler.performDrop(data, null);

        expectedLayers[0]=2;
View Full Code Here

              continue;
            }
            assertFalse( "Error encountered loading", editor instanceof ErrorEditorPart);
     
            if (editor instanceof MapEditorPart) {
                MapEditorPart mapEditor = (MapEditorPart) editor;
               
                if( mapEditor!=null ) {
                    mapEditor.setTesting(true);
                }
            }
        }
        while ( !activePage.closeAllEditors(false||  activePage.getEditorReferences().length!=0);        
        //super.tearDown();
       
        editors = activePage.getEditorReferences();
        for( IEditorReference reference : editors ) {
          IEditorPart editor = reference.getEditor(false);           
          if( editor instanceof ErrorEditorPart){
              System.out.println("Error opening "+editor.getTitle());
              continue;
            }
          MapEditorPart mapEditor = (MapEditorPart) editor;
            if( mapEditor!=null ){
                mapEditor.setTesting(true);
            }
        }
        while ( !activePage.closeAllEditors(false||  activePage.getEditorReferences().length!=0);        

        editors = activePage.getEditorReferences();
View Full Code Here

            }
           
            Object selection = firstSelectedElement();

            if (contents != null) {
                MapEditorPart activeEditor = ApplicationGISInternal.getActiveEditor();
                final Map finalMap;
                final UDIGDropHandler finalDropHandler;
                if( selection instanceof Map){
                    finalMap = (Map)selection;
                    finalDropHandler = new UDIGDropHandler();
                    activeEditor=null;
                } else if( activeEditor==null ){
                    CreateMapCommand command = new CreateMapCommand(null,Collections.<IGeoResource>emptyList(), null);
                    try {
                        command.run(new NullProgressMonitor());
                    } catch (Exception e) {
                        throw (RuntimeException) new RuntimeException( ).initCause( e );
                    }
                    finalMap = (Map) command.getCreatedMap();
                    finalDropHandler = new UDIGDropHandler();
                } else {
                    finalDropHandler = activeEditor.getDropHandler();
                    finalMap = activeEditor.getMap();
                }
               
                final MapEditorPart finalActiveEditor = activeEditor;
                ILayer selectedLayer = finalMap.getEditManager().getSelectedLayer();
                if( selectedLayer==null ){
                    finalDropHandler.setTarget(finalMap);
                }else{
                    finalDropHandler.setTarget(selectedLayer);
View Full Code Here

        if (ApplicationGISInternal.getActiveMap() == ApplicationGIS.NO_MAP)
            return null;
        MapPart active = ApplicationGISInternal.getActiveEditor();

        if( active instanceof MapEditorPart){
            MapEditorPart editor = (MapEditorPart) active;
            return (SubActionBars2) editor.getMapEditorSite().getActionBars();
        }
        else if( active instanceof ViewPart){
            ViewPart view = (ViewPart) active;
            return (SubActionBars2) view.getViewSite().getActionBars();
        }
View Full Code Here

           
            ProjectExplorer explorer = ProjectExplorer.getProjectExplorer();
            explorer.setSelection(Collections.singleton(input.getProjectElement()), true);

            if( part instanceof MapEditorPart ){
                MapEditorPart mapEditor=(MapEditorPart) part;
                while( !mapEditor.getComposite().isVisible() || !mapEditor.getComposite().isEnabled() ){
                    if( !Display.getCurrent().readAndDispatch() ){
                        Thread.sleep(300);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.ui.internal.MapEditorPart

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.