Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » WorkspaceModifyOperation and update UI
WorkspaceModifyOperation and update UI [message #440390] Thu, 29 July 2004 03:15
hung is currently offline hungFriend
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.....
Previous Topic:vertically align text in Label?
Next Topic:How to enable a table the edit Style like in Excel?
Goto Forum:
  


Current Time: Thu Apr 25 13:58:13 GMT 2024

Powered by FUDForum. Page generated in 0.03142 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top