RCP freezes up [message #465399] |
Wed, 28 March 2007 19:26 |
Eclipse User |
|
|
|
Originally posted by: dray.cse.unl.edu
I am running a new thread in the fillstatusLine to get data from an
external lib. Even though I am using a separate thread , RCP freezes up
for a few seconds and then starts working normally. Is there a way to
totally run the thread in the background so that the RCP does not freeze
at all . I also tried Job instead of using a thread but got the same
result.
This is the code I am using in the fillStatusLine.
new Thread(new Runnable() {
public void run() {
if (FIRMConnector.connect()) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
statusLine.setErrorMessage(null, null);
statusLine.setMessage(VegDriPlugin.getImage(Images.CONNECTED _ICON),
"Connected");
}
});
} else {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
statusLine.setErrorMessage(VegDriPlugin.getImage(Images.DISC ONNECTED_ICON),
"Disconnected");
newAction.setEnabled(false);
executeAction.setEnabled(false);
aggregateAction.setEnabled(false);
importAction.setEnabled(false);
}
});
}
}
}).start();
I am also saving the state of the window overriding the initialize method.
Here is the code:
@Override
public void initialize(IWorkbenchConfigurer configurer) {
configurer.setExitOnLastWindowClose(true);
configurer.setSaveAndRestore(true);
}
This is also causing the hourglass to appear for a few seconds.
How can I have this also done in the background?
Any suggestions will be very helpful.
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03699 seconds