Java Code Examples for com.intellij.xdebugger.evaluation.EvaluationMode#CODE_FRAGMENT
The following examples show how to use
com.intellij.xdebugger.evaluation.EvaluationMode#CODE_FRAGMENT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XDebuggerEvaluationDialog.java From consulo with Apache License 2.0 | 5 votes |
@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); }
Example 2
Source File: XDebuggerExpressionEditor.java From consulo with Apache License 2.0 | 5 votes |
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); }