Package org.locationtech.udig.project.internal.commands

Examples of org.locationtech.udig.project.internal.commands.CreateMapCommand


                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();
                }
View Full Code Here


  @Test
    public void testWithProjectWithName() throws Exception {
    Project project = ProjectPlugin.getPlugin().getProjectRegistry()
      .getDefaultProject();
   
    CreateMapCommand cmCommand
      = new CreateMapCommand("MyMap", (List<IGeoResource>) service.resources(null), project); //$NON-NLS-1$
    project.sendSync(cmCommand);
   
    Map map = (Map) cmCommand.getCreatedMap();
    assertNotNull(map);
    assertEquals(map.getProject(),project);
    assertEquals(map.getName(), "MyMap"); //$NON-NLS-1$
   
  }
View Full Code Here

    public void testWithoutProjectWithoutName() throws Exception {
    Project project = ProjectPlugin.getPlugin().getProjectRegistry()
    .getDefaultProject();
 
    List<IGeoResource> members = (List<IGeoResource>) service.resources(null);
        CreateMapCommand cmCommand
      = new CreateMapCommand(null, members, null);
    project.sendSync(cmCommand);
 
    Map map = (Map) cmCommand.getCreatedMap();
    assertNotNull(map);
    assertNotNull(map.getProject());
   
    assertEquals(map.getName(),members.get(0).getInfo(null).getTitle());
 
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.commands.CreateMapCommand

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.