当前位置: 首页>>代码示例>>Java>>正文


Java EvaluationMode类代码示例

本文整理汇总了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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PopFrameAction.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ArrayTableCellEditor.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:XsltDebuggerEditorsProvider.java

示例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);
        }
    };
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:23,代码来源:SquirrelDebugProcess.java

示例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;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:XDebuggerMultilineEditor.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:27,代码来源:LuaDebuggerEditorsProvider.java

示例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());
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:JavaScriptLineBreakpointType.java

示例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);
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:MuleDebuggerEditorsProvider.java

示例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;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:MuleDebuggerEditorProperties.java

示例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);
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:9,代码来源:WeaveDebuggerEditorsProvider.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaDebuggerEditorsProvider.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TextWithImportsImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TextWithImportsImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaDebuggerEvaluator.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XValue.java


注:本文中的com.intellij.xdebugger.evaluation.EvaluationMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。