{
DocsOpenDocDialog dialog = new DocsOpenDocDialog(window.getShell(), false);
if (dialog.open() == Window.OK && dialog.getResultAsDocumentListEntry() != null)
{
DocumentListEntry document = dialog.getResultAsDocumentListEntry();
DocsEditorInput editorInput = new DocsEditorInput(document);
try
{
window.getActivePage().openEditor(editorInput, DocumentEditor.EDITOR_ID, true, IWorkbenchPage.MATCH_INPUT);
}
catch (PartInitException exception)
{
ErrorDialog.openError(window.getShell(),
"Error Opening Document",
"Unable to open " + document.getTitle().getPlainText() + ".\n"
+ exception.toString(),
new Status(IStatus.ERROR, DocsPlugin.PLUGIN_ID, exception.getMessage(), exception));
DocsPlugin.log(exception);
}