WorkspaceModifyOperation and update UI [message #440390] |
Thu, 29 July 2004 03:15 |
hung Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi,
This is what I am trying to do : (worked fine in Eclipse 2.x, doesn't
seem to work so well in Eclipse 3.0) :
After the Wizard is done, create the necessary resources, then expand
and highlight the resource, and open up it on editor.
So what I do is create a WorkspaceModifyOperation() to create bunch of
resources, and then create a UI thread to do :
expanding/selection/opening in editor.
The following code is in my Wizard.performFinish() :
WorkspaceModifyOperation op = new WorkspaceModifyOperation()
{
protected void execute(IProgressMonitor monitor) throws CoreException
{
... //create resources...
}
};
try
{
getContainer().run(true,true,op);
Display.getDefault().syncExec(new Runnable()
{
public void run()
{
..... //expand resource tree
..... //open file
}
});
}
catch ( Exception e )
{
....//handle errors
}
The problem is that sometimes it does what I intend to do, but
sometimes, (specially when I have some other applications running on
my machine), my new resources do not expand in the tree. It seems like
I need to make sure the WorkspaceModifyOperation finish first before I
can invoke the UI thread. But I don't know how to do that in Eclipse 3.
appreciate your help.....
|
|
|
Powered by
FUDForum. Page generated in 0.03142 seconds