[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] Re: Asterisk in the editor's title
|
Ok, I solved the problem and now I write you the solution, in case it is useful.
I get an InvalidThreadAccess Exception in WorkbenchPart class when I call the firePropertyChange mathod. The problem was that I didn't use a separate thread. The right way to call the method is something like this
public void setDirty(boolean modified){
isDirty = modified;
Runnable r= new Runnable() {
public void run() {
firePropertyChange(PROP_DIRTY);
}
};
execute(r, false);
}
private void execute(Runnable runnable, boolean postAsync) {
if (postAsync || Display.getCurrent() == null) {
if (fDisplay == null)
fDisplay= getSite().getShell().getDisplay();
fDisplay.asyncExec(runnable);
}
else
runnable.run();
}