Set Focus to Eclipse Console View in Eclipse RCP
I want to programatically set the focus to the Console View (that is bring that view to being active/displayed in case it isn't). How would I even get a reference to the ConsoleView so that I an call set focus to it from another plugin?
As mentioned in the comment it is done like this:
String id = IConsoleConstants.ID_CONSOLE_VIEW;
IViewPart consoleView = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().showView(id);
To display a specific (custom) console page:
MessageConsole customConsole = ...;
((IConsoleView) consoleView).display(customConsole);
Taken from Eclipse FAQ where futher the custom console creation can be found.
链接地址: http://www.djcxy.com/p/18684.html