Sunday, January 15, 2012

Tuesday, August 17, 2010

Closing Editors

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorReference[] editors = page.getEditorReferences();
for (int i = 0; i < editors.length; i++) {
IEditorInput otherInput;
try {
otherInput = editors[i].getEditorInput();
return page.closeEditor(editors[i].getEditor(false), false);
} catch (PartInitException e) {
handleException(e);
}
}