本文整理汇总了Java中com.intellij.xdebugger.evaluation.EvaluationMode.CODE_FRAGMENT属性的典型用法代码示例。如果您正苦于以下问题:Java EvaluationMode.CODE_FRAGMENT属性的具体用法?Java EvaluationMode.CODE_FRAGMENT怎么用?Java EvaluationMode.CODE_FRAGMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.xdebugger.evaluation.EvaluationMode
的用法示例。
在下文中一共展示了EvaluationMode.CODE_FRAGMENT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MyTableEditor
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);
}
示例2: XDebuggerMultilineEditor
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;
}
};
}
示例3: 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);
}
示例4: 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);
}
示例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);
}
示例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);
}
示例7: getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
final int rowIndex, final int vColIndex) {
myEditor = new MyTableEditor(myProject, new PyDebuggerEditorsProvider(), "numpy.array.table.view", null,
new XExpressionImpl(value.toString(), PythonLanguage.getInstance(), "", EvaluationMode.CODE_FRAGMENT),
getActionsAdapter(rowIndex, vColIndex));
myLastValue = value;
return myEditor.getComponent();
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}