本文整理汇总了Java中com.intellij.execution.ui.RunContentDescriptor.getExecutionConsole方法的典型用法代码示例。如果您正苦于以下问题:Java RunContentDescriptor.getExecutionConsole方法的具体用法?Java RunContentDescriptor.getExecutionConsole怎么用?Java RunContentDescriptor.getExecutionConsole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ui.RunContentDescriptor
的用法示例。
在下文中一共展示了RunContentDescriptor.getExecutionConsole方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeQuery
import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
private static void executeQuery(@NotNull Project project,
@NotNull VirtualFile file,
@NotNull Editor editor,
@NotNull IdeScriptEngine engine) {
String command = getCommand(editor);
String profile = getProfile(file);
RunContentDescriptor descriptor = getConsoleView(project, file);
ConsoleViewImpl consoleView = (ConsoleViewImpl)descriptor.getExecutionConsole();
prepareEngine(project, engine, descriptor);
try {
//myHistoryController.getModel().addToHistory(command);
consoleView.print("> " + command, ConsoleViewContentType.USER_INPUT);
consoleView.print("\n", ConsoleViewContentType.USER_INPUT);
Object o = engine.eval(profile == null ? command : profile + "\n" + command);
consoleView.print("=> " + o, ConsoleViewContentType.NORMAL_OUTPUT);
consoleView.print("\n", ConsoleViewContentType.NORMAL_OUTPUT);
}
catch (Throwable e) {
//noinspection ThrowableResultOfMethodCallIgnored
Throwable ex = ExceptionUtil.getRootCause(e);
consoleView.print(ex.getClass().getSimpleName() + ": " + ex.getMessage(), ConsoleViewContentType.ERROR_OUTPUT);
consoleView.print("\n", ConsoleViewContentType.ERROR_OUTPUT);
}
selectContent(descriptor);
}
示例2: getDebugSession
import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
@Override
@Nullable
public XDebugSession getDebugSession(@NotNull ExecutionConsole executionConsole) {
for (final XDebugSessionImpl debuggerSession : mySessions.values()) {
XDebugSessionTab sessionTab = debuggerSession.getSessionTab();
if (sessionTab != null) {
RunContentDescriptor contentDescriptor = sessionTab.getRunContentDescriptor();
if (contentDescriptor != null && executionConsole == contentDescriptor.getExecutionConsole()) {
return debuggerSession;
}
}
}
return null;
}
示例3: getConsoleView
import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
@NotNull
private static RunContentDescriptor getConsoleView(@NotNull Project project, @NotNull VirtualFile file) {
PsiFile psiFile = ObjectUtils.assertNotNull(PsiManager.getInstance(project).findFile(file));
WeakReference<RunContentDescriptor> ref = psiFile.getCopyableUserData(DESCRIPTOR_KEY);
RunContentDescriptor descriptor = ref == null ? null : ref.get();
if (descriptor == null || descriptor.getExecutionConsole() == null) {
descriptor = createConsoleView(project, psiFile);
psiFile.putCopyableUserData(DESCRIPTOR_KEY, new WeakReference<RunContentDescriptor>(descriptor));
}
return descriptor;
}
示例4: fetchConsoleAndSetToField
import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
/**
* Fetches console from process descriptor and sets it to {@link #myConsole}.
* If override, always set console!
*
* @param descriptor process descriptor
*/
protected void fetchConsoleAndSetToField(@NotNull final RunContentDescriptor descriptor) {
myConsole = (ConsoleViewImpl)descriptor.getExecutionConsole();
}