Skip to main content



      Home
Home » Newcomers » Newcomers » Focus gets Lost in TreeViewer.
Focus gets Lost in TreeViewer. [message #242053] Tue, 04 December 2007 06:14
Eclipse UserFriend
Hi,

In a tree viewer When an data from one model is copied to another model
through some action, the focus from the tree viewer and from workbench is
getting lost.

If the Last focus was in explorer or IDE or mailbox before the action was
executed, the focus is getting returned over there rather than on the
viewer as soon as the action is performed.

The below piece of code is being run in the runnableProgress ,

public void doRefresh() {

IProgressService progressService =
PlatformUI.getWorkbench().getProgressService();


IRunnableWithProgress runnable = new IRunnableWithProgress() {

public void run(IProgressMonitor monitor) {

monitor.setTaskName("Refreshing data.....");
/* try {
Thread.sleep(800);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
diffInput.refresh();
listInput.refresh();
}

};

try {
progressService.run(true, false, runnable);
}
catch (InvocationTargetException e) {
CemPlugin.getDefault().log(e);
}
catch (InterruptedException e) {
CemPlugin.getDefault().log(e);
}

}


As per the above code, if the commented code is uncommented then the focus
is being set to TreeViewer itself irrespective of last focus. Please let
me know if this is right way to handle the problem.

Thanks in Advance.

Regards,

Kiran
Previous Topic:Plugin Activation in Headless RCP
Next Topic:Cannot export Eclipse product
Goto Forum:
  


Current Time: Wed Jul 16 09:54:32 EDT 2025

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

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

Back to the top