I have remembered that the "spatial operations plugin" have got a similar work 
flow, that is launch operation and then open a view.

This is ths code used to open th view:

public class SOViewLauncher implements IOp {

    public void op( Display display, Object target, IProgressMonitor monitor ) 
throws Exception {
        
        display.asyncExec(new Runnable(){

            public void run() {
                ApplicationGIS.getView(true, SOView.id);

            }});
    }
}

Hope it help you

cheers

On Thursday, June 21, 2012 12:54:18 PM Marco Foi wrote:
> The comments in the Workbench.class state this:
> 
> public IWorkbenchWindow getActiveWorkbenchWindow() {
> // Return null if called from a non-UI thread.
>  // This is not spec'ed behaviour and is misleading, however this is how
> // it
>  // worked in 2.1 and we cannot change it now.
> // For more details, see [Bug 57384] [RCP] Main window not active on
>  // startup
> if (Display.getCurrent() == null) {
> return null;                  <<<<<=== I ALWAYS GET HERE !!
>  }
> [...]
> 
> Does this suggest you any way around?
> or
> What I am doing wrong?
> 
> Marco
-- 
Mauricio Pazos
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to