if (viewPart == null) {
try {
viewPart = page.showView(EDITOR_VIEW_ID);
}
catch (PartInitException e) {
throw new ReviewException(e.getMessage());
}
}
// if there exists the view, but if not on the top,
// then brings it to top when the view is already showed.
else if (!page.isPartVisible(viewPart)) {
page.bringToTop(viewPart);
}
if (viewPart instanceof ReviewEditorView) {
return (ReviewEditorView) viewPart;
}
else {
throw new ReviewException("The instance is not ReviewEditorView.");
}
}