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();
}