本文整理汇总了Java中com.intellij.execution.console.LanguageConsoleView类的典型用法代码示例。如果您正苦于以下问题:Java LanguageConsoleView类的具体用法?Java LanguageConsoleView怎么用?Java LanguageConsoleView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LanguageConsoleView类属于com.intellij.execution.console包,在下文中一共展示了LanguageConsoleView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XValueHint
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
public XValueHint(@NotNull Project project, @NotNull Editor editor, @NotNull Point point, @NotNull ValueHintType type,
@NotNull ExpressionInfo expressionInfo, @NotNull XDebuggerEvaluator evaluator,
@NotNull XDebugSession session) {
super(project, editor, point, type, expressionInfo.getTextRange());
myEvaluator = evaluator;
myDebugSession = session;
myExpression = XDebuggerEvaluateActionHandler.getExpressionText(expressionInfo, editor.getDocument());
myValueName = XDebuggerEvaluateActionHandler.getDisplayText(expressionInfo, editor.getDocument());
myExpressionInfo = expressionInfo;
VirtualFile file;
ConsoleView consoleView = ConsoleViewImpl.CONSOLE_VIEW_IN_EDITOR_VIEW.get(editor);
if (consoleView instanceof LanguageConsoleView) {
LanguageConsoleView console = ((LanguageConsoleView)consoleView);
file = console.getHistoryViewer() == editor ? console.getVirtualFile() : null;
}
else {
file = FileDocumentManager.getInstance().getFile(editor.getDocument());
}
myExpressionPosition = file != null ? XDebuggerUtil.getInstance().createPositionByOffset(file, expressionInfo.getTextRange().getStartOffset()) : null;
}
示例2: createConsole
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@NotNull
public static LanguageConsoleView createConsole(
@NotNull final Module module,
@NotNull final String consoleName,
@NotNull final String promptName,
@Nullable final Pair<List<Command>, CommandExecutor> commandsAndDefaultExecutor) {
final Project project = module.getProject();
final CommandConsole console = CommandConsole.createConsole(module, promptName, commandsAndDefaultExecutor);
// Show console on "toolwindow"
WindowWithActions.showConsoleWithProcess(console,
console.getEditor().getComponent(),
consoleName,
project,
null);
ArgumentHintLayer.attach(console); // Display [arguments]
return console;
}
示例3: XValueHint
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
public XValueHint(@Nonnull Project project, @Nonnull Editor editor, @Nonnull Point point, @Nonnull ValueHintType type,
@Nonnull ExpressionInfo expressionInfo, @Nonnull XDebuggerEvaluator evaluator,
@Nonnull XDebugSession session) {
super(project, editor, point, type, expressionInfo.getTextRange());
myEvaluator = evaluator;
myDebugSession = session;
myExpression = XDebuggerEvaluateActionHandler.getExpressionText(expressionInfo, editor.getDocument());
myValueName = XDebuggerEvaluateActionHandler.getDisplayText(expressionInfo, editor.getDocument());
myExpressionInfo = expressionInfo;
VirtualFile file;
ConsoleView consoleView = ConsoleViewImpl.CONSOLE_VIEW_IN_EDITOR_VIEW.get(editor);
if (consoleView instanceof LanguageConsoleView) {
LanguageConsoleView console = ((LanguageConsoleView)consoleView);
file = console.getHistoryViewer() == editor ? console.getVirtualFile() : null;
}
else {
file = FileDocumentManager.getInstance().getFile(editor.getDocument());
}
myExpressionPosition = file != null ? XDebuggerUtil.getInstance().createPositionByOffset(file, expressionInfo.getTextRange().getStartOffset()) : null;
}
示例4: getConsoleExecuteAction
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Nullable
public static ConsoleExecuteAction getConsoleExecuteAction(@Nullable ConsoleView consoleView) {
if (!(consoleView instanceof LanguageConsoleView)) {
return null;
}
List<AnAction> actions = ActionUtil.getActions(((LanguageConsoleView)consoleView).getConsoleEditor().getComponent());
ConsoleExecuteAction action = ContainerUtil.findInstance(actions, ConsoleExecuteAction.class);
return action == null || !action.isEnabled() ? null : action;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XEvaluateInConsoleFromEditorActionHandler.java
示例5: startConsole
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
private static void startConsole(final Project project,
final Consumer<PyCodeExecutor> consumer,
Module context) {
final PythonConsoleToolWindow toolWindow = PythonConsoleToolWindow.getInstance(project);
if (toolWindow != null) {
toolWindow.activate(new Runnable() {
@Override
public void run() {
List<RunContentDescriptor> descs = toolWindow.getConsoleContentDescriptors();
RunContentDescriptor descriptor = descs.get(0);
if (descriptor != null && descriptor.getExecutionConsole() instanceof PyCodeExecutor) {
consumer.consume((PyCodeExecutor)descriptor.getExecutionConsole());
}
}
});
}
else {
PythonConsoleRunnerFactory consoleRunnerFactory = PythonConsoleRunnerFactory.getInstance();
PydevConsoleRunner runner = consoleRunnerFactory.createConsoleRunner(project, null);
runner.addConsoleListener(new PydevConsoleRunner.ConsoleListener() {
@Override
public void handleConsoleInitialized(LanguageConsoleView consoleView) {
if (consoleView instanceof PyCodeExecutor) {
consumer.consume((PyCodeExecutor)consoleView);
}
}
});
runner.run();
}
}
示例6: PydevConsoleExecuteActionHandler
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
public PydevConsoleExecuteActionHandler(LanguageConsoleView consoleView,
ProcessHandler processHandler,
ConsoleCommunication consoleCommunication) {
super(processHandler, false);
myConsoleView = consoleView;
myConsoleCommunication = consoleCommunication;
myConsoleCommunication.addCommunicationListener(this);
}
示例7: inputRequested
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Override
public void inputRequested() {
final LanguageConsoleView console = myConsoleView;
final Editor currentEditor = console.getConsoleEditor();
if (!PyConsoleUtil.INPUT_PROMPT.equals(console.getPrompt()) && !PyConsoleUtil.HELP_PROMPT.equals(console.getPrompt())) {
console.setPrompt(PyConsoleUtil.INPUT_PROMPT);
PyConsoleUtil.scrollDown(currentEditor);
}
setCurrentIndentSize(1);
}
示例8: finishExecution
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
public void finishExecution() {
final LanguageConsoleView console = myConsoleView;
final Editor currentEditor = console.getConsoleEditor();
if (myInputBuffer != null) {
processLine("\n");
}
cleanEditor(currentEditor);
//console.setPrompt(PyConsoleHighlightingUtil.ORDINARY_PROMPT);
}
示例9: runExecuteAction
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Override
public void runExecuteAction(@NotNull LanguageConsoleView console) {
if (isEnabled()) {
if (!canExecuteNow()) {
HintManager.getInstance().showErrorHint(console.getConsoleEditor(), getPrevCommandRunningMessage());
}
else {
doRunExecuteAction(console);
}
}
else {
HintManager.getInstance().showErrorHint(console.getConsoleEditor(), getConsoleIsNotEnabledMessage());
}
}
示例10: doRunExecuteAction
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
private void doRunExecuteAction(LanguageConsoleView console) {
if (shouldCopyToHistory(console)) {
copyToHistoryAndExecute(console);
}
else {
processLine(console.getConsoleEditor().getDocument().getText());
}
}
示例11: processPrompts
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
static String processPrompts(final LanguageConsoleView languageConsole, String string) {
// Change prompt
for (String prompt : PROMPTS) {
if (string.startsWith(prompt)) {
// Process multi prompts here
if (prompt != HELP_PROMPT) {
final StringBuilder builder = new StringBuilder();
builder.append(prompt).append(prompt);
while (string.startsWith(builder.toString())) {
builder.append(prompt);
}
final String multiPrompt = builder.toString().substring(prompt.length());
if (prompt == INDENT_PROMPT) {
prompt = multiPrompt;
}
string = string.substring(multiPrompt.length());
}
else {
string = string.substring(prompt.length());
}
// Change console editor prompt if required
final String currentPrompt = languageConsole.getPrompt();
final String trimmedPrompt = prompt.trim();
if (currentPrompt != null && !currentPrompt.equals(trimmedPrompt)) {
languageConsole.setPrompt(trimmedPrompt);
scrollDown(languageConsole.getConsoleEditor());
}
break;
}
}
return string;
}
示例12: createToolWindowContent
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Override
public void createToolWindowContent(final @NotNull Project project, final @NotNull ToolWindow toolWindow) {
PydevConsoleRunner runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(project, null);
runner.addConsoleListener(new PydevConsoleRunner.ConsoleListener() {
@Override
public void handleConsoleInitialized(LanguageConsoleView consoleView) {
PythonConsoleToolWindow.getInstance(project).initialized();
}
});
runner.run();
}
示例13: value
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Override
public boolean value(final LanguageConsoleView t) {
// Is execution available?
synchronized (myConsumerSemaphore) {
return myCurrentConsumer != null;
}
}
示例14: createConsoleView
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@Override
protected LanguageConsoleView createConsoleView() {
final LanguageConsoleView res = new GroovyShellLanguageConsoleView(getProject(), getConsoleTitle());
final GroovyFileImpl file = (GroovyFileImpl)res.getFile();
assert file.getContext() == null;
file.putUserData(GROOVY_SHELL_FILE, Boolean.TRUE);
file.setContext(myShellRunner.getContext(myModule));
return res;
}
示例15: createConsoleView
import com.intellij.execution.console.LanguageConsoleView; //导入依赖的package包/类
@NotNull
@Override
protected LanguageConsoleView createConsoleView() {
final LanguageConsoleImpl console = new LanguageConsoleImpl(getProject(), getConsoleTitle(), TheRLanguage.getInstance());
console.setPrompt(null);
return console;
}