IViewReference[] references = WGADesignerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
for (IViewReference ref : references) {
if (ref.getId().equals(IConsoleConstants.ID_CONSOLE_VIEW)) {
IWorkbenchPart part = ref.getPart(false);
if (part != null && part instanceof PageBookView) {
PageBookView view = (PageBookView) part;
IPage page = view.getCurrentPage();
if (page instanceof TextConsolePage) {
TextConsolePage textConsolePage = (TextConsolePage) page;
return textConsolePage.getViewer().getTextWidget();
}
}