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


Java XStackFrame.getEvaluator方法代码示例

本文整理汇总了Java中com.intellij.xdebugger.frame.XStackFrame.getEvaluator方法的典型用法代码示例。如果您正苦于以下问题:Java XStackFrame.getEvaluator方法的具体用法?Java XStackFrame.getEvaluator怎么用?Java XStackFrame.getEvaluator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.xdebugger.frame.XStackFrame的用法示例。


在下文中一共展示了XStackFrame.getEvaluator方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createValueHint

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
public AbstractValueHint createValueHint(@NotNull final Project project, @NotNull final Editor editor, @NotNull final Point point, final ValueHintType type) {
  final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
  if (session == null) return null;

  XStackFrame stackFrame = session.getCurrentStackFrame();
  if (stackFrame == null) return null;
  final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
  if (evaluator == null) return null;

  return PsiDocumentManager.getInstance(project).commitAndRunReadAction(new Computable<XValueHint>() {
    public XValueHint compute() {
      int offset = AbstractValueHint.calculateOffset(editor, point);
      TextRange range = getExpressionRange(evaluator, project, type, editor, offset);
      if (range == null) return null;
      int textLength = editor.getDocument().getTextLength();
      if (range.getStartOffset() > range.getEndOffset() || range.getStartOffset() < 0 || range.getEndOffset() > textLength) {
        LOG.error("invalid range: " + range + ", text length = " + textLength + ", evaluator: " + evaluator);
        return null;
      }

      return new XValueHint(project, editor, point, type, range, evaluator, session);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:XQuickEvaluateHandler.java

示例2: getTextToEvaluate

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
@Nullable
private static String getTextToEvaluate(DataContext dataContext, XDebugSession session) {
  final Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
  if (editor == null) {
    return null;
  }

  String text = editor.getSelectionModel().getSelectedText();
  if (text == null && session.isSuspended()) {
    final XStackFrame stackFrame = session.getCurrentStackFrame();
    if (stackFrame != null) {
      final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
      if (evaluator != null) {
        final int offset = editor.getCaretModel().getOffset();
        final Document document = editor.getDocument();
        final TextRange textRange = evaluator.getExpressionRangeAtOffset(session.getProject(), document, offset, false);
        if (textRange != null) {
          text = document.getText(textRange);
        }
      }
    }
  }

  return StringUtil.isEmptyOrSpaces(text) ? null : text;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:XAddToWatchesFromEditorActionHandler.java

示例3: getEvaluator

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
@Nullable
@Override
public XDebuggerEvaluator getEvaluator() {
    final XStackFrame currentStackFrame = getSession().getCurrentStackFrame();

    if (currentStackFrame == null) return null;

    return currentStackFrame.getEvaluator();
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:10,代码来源:LuaDebugProcess.java

示例4: getEvaluator

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
@Nullable
public static XDebuggerEvaluator getEvaluator(final XSuspendContext suspendContext) {
  XExecutionStack executionStack = suspendContext.getActiveExecutionStack();
  if (executionStack != null) {
    XStackFrame stackFrame = executionStack.getTopFrame();
    if (stackFrame != null) {
      return stackFrame.getEvaluator();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XDebuggerUtilImpl.java

示例5: isEnabled

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
public boolean isEnabled(@NotNull final Project project) {
  XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
  if (session == null || !session.isSuspended()) {
    return false;
  }
  XStackFrame stackFrame = session.getCurrentStackFrame();
  return stackFrame != null && stackFrame.getEvaluator() != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:XQuickEvaluateHandler.java

示例6: getValueLookupDelay

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
public int getValueLookupDelay(final Project project) {
  XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
  if (session != null) {
    XStackFrame stackFrame = session.getCurrentStackFrame();
    if (stackFrame != null) {
      XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
      if (evaluator != null) {
        return evaluator.getValuePopupDelay();
      }
    }
  }
  return 700;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:XQuickEvaluateHandler.java

示例7: perform

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) {
  XDebuggerEditorsProvider editorsProvider = session.getDebugProcess().getEditorsProvider();
  XStackFrame stackFrame = session.getCurrentStackFrame();
  if (stackFrame == null) return;
  final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
  if (evaluator == null) return;

  @Nullable Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  @Nullable Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);

  String selectedText = editor != null ? editor.getSelectionModel().getSelectedText() : null;
  if (selectedText != null) {
    selectedText = evaluator.formatTextForEvaluation(selectedText);
  }
  String text = selectedText;

  if (text == null && editor != null) {
    Document document = editor.getDocument();
    TextRange range = evaluator.getExpressionRangeAtOffset(project, document, editor.getCaretModel().getOffset(), true);
    text = range == null ? null : document.getText(range);
  }

  if (text == null) {
    XValue value = XDebuggerTreeActionBase.getSelectedValue(dataContext);
    if (value != null) {
      text = value.getEvaluationExpression();
    }
  }
  if (text == null) {
    text = "";
  }
  final XDebuggerEvaluationDialog dialog = new XDebuggerEvaluationDialog(session, editorsProvider, evaluator, text,
                                                                         stackFrame.getSourcePosition());
  dialog.show();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:XDebuggerEvaluateActionHandler.java

示例8: isEnabled

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
protected boolean isEnabled(final @NotNull XDebugSession session, final DataContext dataContext) {
  if (!super.isEnabled(session, dataContext)) {
    return false;
  }

  XStackFrame stackFrame = session.getCurrentStackFrame();
  return stackFrame != null && stackFrame.getEvaluator() != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:XDebuggerEvaluateActionHandler.java

示例9: addWatchExpression

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
public void addWatchExpression(@NotNull String expression, int index, final boolean navigateToWatchNode) {
  XDebuggerEvaluator evaluator = null;
  XStackFrame stackFrame = mySession.getCurrentStackFrame();
  if (stackFrame != null) {
    evaluator = stackFrame.getEvaluator();
  }
  myRootNode.addWatchExpression(evaluator, expression, index, navigateToWatchNode);
  updateSessionData();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:XWatchesView.java

示例10: getEvaluator

import com.intellij.xdebugger.frame.XStackFrame; //导入方法依赖的package包/类
@Nullable
public XDebuggerEvaluator getEvaluator() {
  XStackFrame frame = getSession().getCurrentStackFrame();
  return frame == null ? null : frame.getEvaluator();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:XDebugProcess.java


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