本文整理汇总了Java中com.intellij.xdebugger.evaluation.EvaluationMode类的典型用法代码示例。如果您正苦于以下问题:Java EvaluationMode类的具体用法?Java EvaluationMode怎么用?Java EvaluationMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EvaluationMode类属于com.intellij.xdebugger.evaluation包,在下文中一共展示了EvaluationMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateAndAct
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
private static void evaluateAndAct(Project project,
JavaStackFrame stackFrame,
StringBuilder sb,
XDebuggerEvaluator.XEvaluationCallback callback) {
XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
if (evaluator != null) {
evaluator.evaluate(XExpressionImpl.fromText(sb.toString(), EvaluationMode.CODE_FRAGMENT),
callback,
stackFrame.getSourcePosition());
}
else {
Messages.showMessageDialog(project, XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"),
UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
Messages.getErrorIcon());
}
}
示例2: MyTableEditor
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
public MyTableEditor(Project project,
XDebuggerEditorsProvider debuggerEditorsProvider,
@Nullable @NonNls String historyId,
@Nullable XSourcePosition sourcePosition, @NotNull XExpression text, @NotNull final KeyAdapter actionAdapter) {
super(project, debuggerEditorsProvider, EvaluationMode.CODE_FRAGMENT, historyId, sourcePosition);
myExpression = XExpressionImpl.changeMode(text, getMode());
myEditorTextField = new EditorTextField(createDocument(myExpression), project, debuggerEditorsProvider.getFileType()) {
@Override
protected EditorEx createEditor() {
final EditorEx editor = super.createEditor();
editor.setVerticalScrollbarVisible(false);
editor.setOneLineMode(true);
editor.getContentComponent().addKeyListener(actionAdapter);
return editor;
}
@Override
protected boolean isOneLineMode() {
return true;
}
};
myEditorTextField.setFontInheritedFromLAF(false);
}
示例3: createDocument
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public Document createDocument(@NotNull Project project,
@NotNull String text,
@Nullable XSourcePosition sourcePosition,
@NotNull EvaluationMode mode) {
final PsiFile psiFile = PsiFileFactory.getInstance(project)
.createFileFromText("XPathExpr." + myFileType.getDefaultExtension(), myFileType, text, LocalTimeCounter.currentTime(), true);
if (sourcePosition instanceof XsltSourcePosition && ((XsltSourcePosition)sourcePosition).getLocation() instanceof Debugger.StyleFrame) {
final Debugger.Locatable location = ((XsltSourcePosition)sourcePosition).getLocation();
final EvalContextProvider context = new EvalContextProvider(((Debugger.StyleFrame)location).getVariables());
context.attachTo(psiFile);
} else {
final PsiElement contextElement = XsltBreakpointHandler.findContextElement(project, sourcePosition);
if (contextElement != null) {
final BreakpointContext context = new BreakpointContext(contextElement);
context.attachTo(psiFile);
}
}
final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
assert document != null;
return document;
}
示例4: getEditorsProvider
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public XDebuggerEditorsProvider getEditorsProvider() {
return new XDebuggerEditorsProvider() {
@NotNull
@Override
public FileType getFileType() {
return SquirrelFileType.INSTANCE;
}
@NotNull
@Override
public Document createDocument(@NotNull Project project,
@NotNull String text,
@Nullable XSourcePosition sourcePosition,
@NotNull EvaluationMode mode) {
LightVirtualFile file = new LightVirtualFile("plain-text-squirrel-debugger.nut", text);
//noinspection ConstantConditions
return FileDocumentManager.getInstance().getDocument(file);
}
};
}
示例5: XDebuggerMultilineEditor
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
public XDebuggerMultilineEditor(Project project,
XDebuggerEditorsProvider debuggerEditorsProvider,
@Nullable @NonNls String historyId,
@Nullable XSourcePosition sourcePosition, @NotNull String text) {
super(project, debuggerEditorsProvider, EvaluationMode.CODE_FRAGMENT, historyId, sourcePosition);
myEditorTextField = new EditorTextField(createDocument(text), project, debuggerEditorsProvider.getFileType()) {
@Override
protected EditorEx createEditor() {
final EditorEx editor = super.createEditor();
editor.setVerticalScrollbarVisible(true);
return editor;
}
@Override
protected boolean isOneLineMode() {
return false;
}
};
}
示例6: createDocument
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String text, @Nullable XSourcePosition sourcePosition, @NotNull EvaluationMode evaluationMode)
{
log.debug("createDocument " + text);
VirtualFile contextVirtualFile = sourcePosition == null ? null : sourcePosition.getFile();
LuaPsiElement context = null;
int contextOffset = sourcePosition == null ? -1 : sourcePosition.getOffset();
if(contextVirtualFile != null)
{
context = getContextElement(contextVirtualFile, contextOffset, project);
}
LuaExpressionCodeFragment codeFragment = LuaPsiElementFactory.getInstance(project).createExpressionCodeFragment(text, context, true);
assert codeFragment != null;
Document file = PsiDocumentManager.getInstance(project).getDocument(codeFragment);
if(file == null)
{
}
return file;
}
示例7: JavaScriptLineBreakpointType
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
public JavaScriptLineBreakpointType()
{
super("javascript", "JavaScript Breakpoints", new XDebuggerEditorsProvider()
{
@NotNull
@Override
public FileType getFileType()
{
return JavaScriptFileType.INSTANCE;
}
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String s, @Nullable XSourcePosition sourcePosition, @NotNull EvaluationMode evaluationMode)
{
return JSDebuggerSupportUtils.createDocument(s, project, sourcePosition == null ? null : sourcePosition.getFile(), sourcePosition == null ? 0 : sourcePosition.getOffset());
}
});
}
示例8: createDocument
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String text, @Nullable XSourcePosition xSourcePosition, @NotNull EvaluationMode evaluationMode)
{
final PsiFile psiFile = PsiFileFactory.getInstance(project)
.createFileFromText("muleExpr." + getFileType().getDefaultExtension(), getFileType(), text, LocalTimeCounter.currentTime(), true);
return PsiDocumentManager.getInstance(project).getDocument(psiFile);
}
示例9: createDocument
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String text, @Nullable XSourcePosition sourcePosition, @NotNull EvaluationMode evaluationMode) {
final PsiFile psiFile = PsiFileFactory.getInstance(project)
.createFileFromText("MelExpr." + getFileType().getDefaultExtension(), getFileType(), text, LocalTimeCounter.currentTime(), true);
final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
assert document != null;
return document;
}
示例10: createDocument
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String text, @Nullable XSourcePosition xSourcePosition, @NotNull EvaluationMode evaluationMode) {
final PsiFile psiFile = PsiFileFactory.getInstance(project)
.createFileFromText("muleExpr." + getFileType().getDefaultExtension(), getFileType(), text, LocalTimeCounter.currentTime(), true);
return PsiDocumentManager.getInstance(project).getDocument(psiFile);
}
示例11: createExpression
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@NotNull
@Override
public XExpression createExpression(@NotNull Project project, @NotNull Document document, @Nullable Language language, @NotNull EvaluationMode mode) {
PsiDocumentManager.getInstance(project).commitDocument(document);
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
if (psiFile != null) {
return new XExpressionImpl(psiFile.getText(), language, ((JavaCodeFragment)psiFile).importsToString(), mode);
}
return super.createExpression(project, document, language, mode);
}
示例12: getMode
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
private static EvaluationMode getMode(CodeFragmentKind kind) {
switch (kind) {
case EXPRESSION: return EvaluationMode.EXPRESSION;
case CODE_BLOCK: return EvaluationMode.CODE_FRAGMENT;
}
throw new IllegalStateException("Unknown kind " + kind);
}
示例13: getKind
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
private static CodeFragmentKind getKind(EvaluationMode mode) {
switch (mode) {
case EXPRESSION: return CodeFragmentKind.EXPRESSION;
case CODE_FRAGMENT: return CodeFragmentKind.CODE_BLOCK;
}
throw new IllegalStateException("Unknown mode " + mode);
}
示例14: getEvaluationMode
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
@Override
public EvaluationMode getEvaluationMode(@NotNull String text, int startOffset, int endOffset, @Nullable PsiFile psiFile) {
if (psiFile != null) {
PsiElement[] range = CodeInsightUtil.findStatementsInRange(psiFile, startOffset, endOffset);
return range.length > 1 ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION;
}
return super.getEvaluationMode(text, startOffset, endOffset, null);
}
示例15: calculateEvaluationExpression
import com.intellij.xdebugger.evaluation.EvaluationMode; //导入依赖的package包/类
/**
* Asynchronously calculates expression which evaluates to the current value
*/
@NotNull
public Promise<XExpression> calculateEvaluationExpression() {
String expression = getEvaluationExpression();
XExpression res =
expression != null ? XDebuggerUtil.getInstance().createExpression(expression, null, null, EvaluationMode.EXPRESSION) : null;
return Promise.resolve(res);
}