final IWorkbench workbench = (IWorkbench) object;
// the 'started' flag is used so that we only run tests when the window
// is opened
// for the first time only.
final boolean[] started = { false };
workbench.addWindowListener(new IWindowListener() {
public void windowOpened(IWorkbenchWindow w) {
if (started[0])
return;
w.getShell().getDisplay().asyncExec(new Runnable() {
public void run() {