本文整理汇总了Java中com.intellij.execution.ui.ConsoleView.scrollTo方法的典型用法代码示例。如果您正苦于以下问题:Java ConsoleView.scrollTo方法的具体用法?Java ConsoleView.scrollTo怎么用?Java ConsoleView.scrollTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ui.ConsoleView
的用法示例。
在下文中一共展示了ConsoleView.scrollTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doFilter
import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
private synchronized void doFilter() {
if (myDisposed) {
return;
}
final ConsoleView console = getConsoleNotNull();
console.clear();
myModel.processingStarted();
final String[] lines = myOriginalDocument != null ? myOriginalDocument.toString().split("\n") : ArrayUtil.EMPTY_STRING_ARRAY;;
int offset = 0;
boolean caretPositioned = false;
for (String line : lines) {
final int printed = printMessageToConsole(line);
if (printed > 0) {
if (!caretPositioned) {
if (Comparing.strEqual(myLineUnderSelection, line)) {
caretPositioned = true;
offset += myLineOffset != -1 ? myLineOffset : 0;
}
else {
offset += printed;
}
}
}
}
// we need this, because, document can change before actual scrolling, so offset may be already not at the end
if (caretPositioned) {
console.scrollTo(offset);
}
else {
((ConsoleViewImpl)console).requestScrollingToEnd();
}
}
示例2: printStacktrace
import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printStacktrace(final ConsoleView consoleView, final String unscrambledTrace) {
consoleView.clear();
consoleView.print(unscrambledTrace+"\n", ConsoleViewContentType.ERROR_OUTPUT);
consoleView.scrollTo(0);
}