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


Java EvaluationMode.EXPRESSION属性代码示例

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


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

示例1: getMode

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,代码行数:7,代码来源:TextWithImportsImpl.java

示例2: getEvaluationMode

@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,代码行数:8,代码来源:JavaDebuggerEvaluator.java

示例3: addToWatches

private void addToWatches() {
  if (myMode == EvaluationMode.EXPRESSION) {
    XExpression expression = getInputEditor().getExpression();
    if (!XDebuggerUtilImpl.isEmptyExpression(expression)) {
      XDebugSessionTab tab = ((XDebugSessionImpl)mySession).getSessionTab();
      if (tab != null) {
        tab.getWatchesView().addWatchExpression(expression, -1, true);
        getInputEditor().requestFocusInEditor();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XDebuggerEvaluationDialog.java

示例4: createInputComponent

private EvaluationInputComponent createInputComponent(EvaluationMode mode, XExpression text) {
  final Project project = mySession.getProject();
  text = XExpressionImpl.changeMode(text, mode);
  if (mode == EvaluationMode.EXPRESSION) {
    return new ExpressionInputComponent(project, myEditorsProvider, mySourcePosition, text, myDisposable);
  }
  else {
    return new CodeFragmentInputComponent(project, myEditorsProvider, mySourcePosition, text,
                                          getDimensionServiceKey() + ".splitter", myDisposable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XDebuggerEvaluationDialog.java

示例5: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
  XExpression text = getInputEditor().getExpression();
  EvaluationMode newMode = (myMode == EvaluationMode.EXPRESSION) ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION;
  // remember only on user selection
  XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().setEvaluationDialogMode(newMode);
  switchToMode(newMode, text);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:XDebuggerEvaluationDialog.java

示例6: XDebuggerExpressionEditor

public XDebuggerExpressionEditor(Project project,
                                 XDebuggerEditorsProvider debuggerEditorsProvider,
                                 @Nullable @NonNls String historyId,
                                 @Nullable XSourcePosition sourcePosition,
                                 @NotNull XExpression text,
                                 final boolean multiline) {
  super(project, debuggerEditorsProvider, multiline ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION, historyId, sourcePosition);
  myExpression = XExpressionImpl.changeMode(text, getMode());
  myEditorTextField =
    new EditorTextField(createDocument(myExpression), project, debuggerEditorsProvider.getFileType(), false, !multiline) {
    @Override
    protected EditorEx createEditor() {
      final EditorEx editor = super.createEditor();
      editor.setVerticalScrollbarVisible(multiline);
      editor.getColorsScheme().setEditorFontName(getFont().getFontName());
      editor.getColorsScheme().setEditorFontSize(getFont().getSize());
      return editor;
    }

    @Override
    public Object getData(String dataId) {
      if (LangDataKeys.CONTEXT_LANGUAGES.is(dataId)) {
        return new Language[]{myExpression.getLanguage()};
      } else if (CommonDataKeys.PSI_FILE.is(dataId)) {
        return PsiDocumentManager.getInstance(getProject()).getPsiFile(getDocument());
      }
      return super.getData(dataId);
    }
  };
  myEditorTextField.setFontInheritedFromLAF(false);
  myEditorTextField.setFont(EditorUtil.getEditorFont());
  myComponent = addChooseFactoryLabel(myEditorTextField, multiline);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:XDebuggerExpressionEditor.java

示例7: XDebuggerExpressionComboBox

public XDebuggerExpressionComboBox(final @NotNull Project project, final @NotNull XDebuggerEditorsProvider debuggerEditorsProvider, final @Nullable @NonNls String historyId,
                                   final @Nullable XSourcePosition sourcePosition) {
  super(project, debuggerEditorsProvider, EvaluationMode.EXPRESSION, historyId, sourcePosition);
  myComboBox = new ComboBox(100);
  myComboBox.setEditable(true);
  myExpression = XExpressionImpl.EMPTY_EXPRESSION;
  Dimension minimumSize = new Dimension(myComboBox.getMinimumSize());
  minimumSize.width = 100;
  myComboBox.setMinimumSize(minimumSize);
  initEditor();
  fillComboBox();
  myComponent = addChooseFactoryLabel(myComboBox, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XDebuggerExpressionComboBox.java

示例8: createInputComponent

private EvaluationInputComponent createInputComponent(EvaluationMode mode, String text) {
  final Project project = mySession.getProject();
  if (mode == EvaluationMode.EXPRESSION) {
    return new ExpressionInputComponent(project, myEditorsProvider, mySourcePosition, text);
  }
  else {
    return new CodeFragmentInputComponent(project, myEditorsProvider, mySourcePosition, text, myDisposable);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:XDebuggerEvaluationDialog.java

示例9: actionPerformed

public void actionPerformed(ActionEvent e) {
  String text = myInputComponent.getInputEditor().getText();
  if (myMode == EvaluationMode.EXPRESSION) {
    switchToMode(EvaluationMode.CODE_FRAGMENT, text);
  }
  else {
    if (text.indexOf('\n') != -1) text = "";
    switchToMode(EvaluationMode.EXPRESSION, text);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:XDebuggerEvaluationDialog.java

示例10: XDebuggerExpressionComboBox

public XDebuggerExpressionComboBox(final @NotNull Project project, final @NotNull XDebuggerEditorsProvider debuggerEditorsProvider, final @Nullable @NonNls String historyId,
                                   final @Nullable XSourcePosition sourcePosition) {
  super(project, debuggerEditorsProvider, EvaluationMode.EXPRESSION, historyId, sourcePosition);
  myDebuggerEditorsProvider = debuggerEditorsProvider;
  myComboBox = new ComboBox();
  myComboBox.setEditable(true);
  myExpression = "";
  Dimension minimumSize = new Dimension(myComboBox.getMinimumSize());
  minimumSize.width = 100;
  myComboBox.setMinimumSize(minimumSize);
  initEditor();
  fillComboBox();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:XDebuggerExpressionComboBox.java

示例11: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
  XExpression text = getInputEditor().getExpression();
  EvaluationMode newMode = (myMode == EvaluationMode.EXPRESSION) ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION;
  // remember only on user selection
  XDebuggerSettingManagerImpl.getInstanceImpl().getGeneralSettings().setEvaluationDialogMode(newMode);
  switchToMode(newMode, text);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:XDebuggerEvaluationDialog.java

示例12: XDebuggerExpressionEditor

public XDebuggerExpressionEditor(Project project,
                                 @Nonnull XDebuggerEditorsProvider debuggerEditorsProvider,
                                 @Nullable @NonNls String historyId,
                                 @Nullable XSourcePosition sourcePosition,
                                 @Nonnull XExpression text,
                                 final boolean multiline,
                                 boolean editorFont,
                                 boolean showEditor) {
  super(project, debuggerEditorsProvider, multiline ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION, historyId, sourcePosition);
  myExpression = XExpressionImpl.changeMode(text, getMode());
  myEditorTextField =
          new EditorTextField(createDocument(myExpression), project, debuggerEditorsProvider.getFileType(), false, !multiline) {
            @Override
            protected EditorEx createEditor() {
              final EditorEx editor = super.createEditor();
              editor.setVerticalScrollbarVisible(multiline);
              editor.getColorsScheme().setEditorFontName(getFont().getFontName());
              editor.getColorsScheme().setEditorFontSize(getFont().getSize());
              return editor;
            }

            @Override
            public Object getData(@Nonnull Key dataId) {
              if (LangDataKeys.CONTEXT_LANGUAGES == dataId) {
                return new Language[]{myExpression.getLanguage()};
              } else if (CommonDataKeys.PSI_FILE == dataId) {
                return PsiDocumentManager.getInstance(getProject()).getPsiFile(getDocument());
              }
              return super.getData(dataId);
            }
          };
  if (editorFont) {
    myEditorTextField.setFontInheritedFromLAF(false);
    myEditorTextField.setFont(EditorUtil.getEditorFont());
  }
  myComponent = decorate(myEditorTextField, multiline, showEditor);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:37,代码来源:XDebuggerExpressionEditor.java

示例13: XDebuggerExpressionComboBox

public XDebuggerExpressionComboBox(@Nonnull Project project, @Nonnull XDebuggerEditorsProvider debuggerEditorsProvider, @Nullable @NonNls String historyId,
                                   @Nullable XSourcePosition sourcePosition, boolean showEditor) {
  super(project, debuggerEditorsProvider, EvaluationMode.EXPRESSION, historyId, sourcePosition);
  myComboBox = new ComboBox<>(100);
  myComboBox.setEditable(true);
  myExpression = XExpressionImpl.EMPTY_EXPRESSION;
  Dimension minimumSize = new Dimension(myComboBox.getMinimumSize());
  minimumSize.width = 100;
  myComboBox.setMinimumSize(minimumSize);
  initEditor();
  fillComboBox();
  myComponent = showEditor ? addMultilineButton(myComboBox) : myComboBox;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:XDebuggerExpressionComboBox.java

示例14: getMode

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:consulo,项目名称:consulo-java,代码行数:11,代码来源:TextWithImportsImpl.java

示例15: getEvaluationMode

@Override
public EvaluationMode getEvaluationMode(@NotNull String text, int startOffset, int endOffset, @Nullable PsiFile psiFile)
{
	if(psiFile != null)
	{
		PsiElement[] range = JavaCodeInsightUtilCore.findStatementsInRange(psiFile, startOffset, endOffset);
		return range.length > 1 ? EvaluationMode.CODE_FRAGMENT : EvaluationMode.EXPRESSION;
	}
	return super.getEvaluationMode(text, startOffset, endOffset, null);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:JavaDebuggerEvaluator.java


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