Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] saving a dirty editor ...

Hi Richard

I think you have to do it in a UI thread.  Try :

PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
    public void run() {
      
//your code to save editors
    }
});

Best regards,

Mariot

2007/10/9, Richard Stahl <richard.stahl@xxxxxxx>:
Hello everybody,

We are developing some refactoring for C based on the CDT plugin. The
problem I am facing is that I have my own plugin running and before
and after the refactoring I would like to save all "dirty" editors ...

I have tried many alternative, e.g.
PlatformUI.getWorkbench().saveAllEditors(false), but I always come to
the same problem:

org.eclipse.swt.SWTException: Invalid thread access

This seem to happen because the current thread is not the same as the
display.thread in Widget#checkWidget method.

Could you, please, advice me on how to resolve this issue?

Thank you very much.

Best regards,
Richard
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



--
Mariot Chauvin

Back to the top