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

上一篇: 如何通过代码将参数传递给eclipse rcp应用程序中的comman?

下一篇: 在Eclipse RCP中将焦点设置为Eclipse控制台视图