workbench.addWindowListener(new WindowListenerAdapter());
IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
for (int i = 0; i < workbenchWindows.length; i++) {
IWorkbenchPage page = workbench.getWorkbenchWindows()[i].getActivePage();
try {
page.addSelectionListener(new ReviewSelectionListener());
page.addPartListener(new MarkerTextPartListener());
}
catch (NullPointerException e) {
log.warning("Could not register either review selection listener or part listener.");
}