本文整理汇总了Java中org.eclipse.ui.internal.console.IOConsoleViewer类的典型用法代码示例。如果您正苦于以下问题:Java IOConsoleViewer类的具体用法?Java IOConsoleViewer怎么用?Java IOConsoleViewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOConsoleViewer类属于org.eclipse.ui.internal.console包,在下文中一共展示了IOConsoleViewer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWidget
import org.eclipse.ui.internal.console.IOConsoleViewer; //导入依赖的package包/类
private StyledText getWidget() {
// we have to delay this, as the widget/viewer are not set up
// until after the console has finished all its delayed Jobs
if (myWidget == null && myPage != null) {
myViewer = myPage.getViewer();
if (myViewer != null) {
myWidget = myPage.getViewer().getTextWidget();
myWidget.setEditable(false);
// restricted: It is lame that we have to cast to internal class to remove this behavior
if (myViewer instanceof IOConsoleViewer) {
((IOConsoleViewer)myViewer).setAutoScroll(false);
}
}
}
return myWidget;
}
示例2: ConsoleListener
import org.eclipse.ui.internal.console.IOConsoleViewer; //导入依赖的package包/类
/**
* @param viewer
* @param toolBarManager
* @param scrollLockAction
*/
private ConsoleListener(IOConsoleViewer viewer, IToolBarManager toolBarManager, IAction scrollLockAction)
{
this.viewer = viewer;
this.toolBarManager = toolBarManager;
this.scrollLockAction = scrollLockAction;
}
示例3: init
import org.eclipse.ui.internal.console.IOConsoleViewer; //导入依赖的package包/类
public void init(IPageBookViewPage page, IConsole console)
{
if (console.getType() != IDebugUIConstants.ID_PROCESS_CONSOLE_TYPE || !(page instanceof TextConsolePage))
{
return;
}
TextConsolePage consolePage = (TextConsolePage) page;
TextConsoleViewer textViewer = consolePage.getViewer();
if (!(textViewer instanceof IOConsoleViewer))
{
return;
}
final IOConsoleViewer viewer = (IOConsoleViewer) textViewer;
scrollActionEnabled = viewer.isAutoScroll();
final IToolBarManager toolBarManager = consolePage.getSite().getActionBars().getToolBarManager();
IAction slAction = null;
// Look for the ScrollLockAction
for (IContributionItem item : toolBarManager.getItems())
{
if (item instanceof ActionContributionItem)
{
IAction action = ((ActionContributionItem) item).getAction();
if (action instanceof ScrollLockAction)
{
slAction = action;
break;
}
}
}
textWidget = viewer.getTextWidget();
listener = new ConsoleListener(viewer, toolBarManager, slAction);
// Based on Eclipse Snippet191 - Detects scrolling that were initiated by the user.
textWidget.addListener(SWT.MouseDown, listener);
textWidget.addListener(SWT.MouseMove, listener);
textWidget.addListener(SWT.MouseUp, listener);
textWidget.addListener(SWT.KeyDown, listener);
textWidget.addListener(SWT.KeyUp, listener);
ScrollBar vBar = textWidget.getVerticalBar();
if (vBar != null)
{
vBar.addListener(SWT.Selection, listener);
}
}