use of com.intellij.xdebugger.XExpression in project intellij-community by JetBrains.
the class ExpressionInputComponent method showHistory.
private void showHistory() {
List<XExpression> expressions = myExpressionEditor.getRecentExpressions();
if (!expressions.isEmpty()) {
ListPopupImpl popup = new ListPopupImpl(new BaseListPopupStep<XExpression>(null, expressions) {
@Override
public PopupStep onChosen(XExpression selectedValue, boolean finalChoice) {
myExpressionEditor.setExpression(selectedValue);
myExpressionEditor.requestFocusInEditor();
return FINAL_CHOICE;
}
}) {
@Override
protected ListCellRenderer getListElementRenderer() {
return new ColoredListCellRenderer<XExpression>() {
@Override
protected void customizeCellRenderer(@NotNull JList list, XExpression value, int index, boolean selected, boolean hasFocus) {
append(value.getExpression());
}
};
}
};
popup.getList().setFont(EditorUtil.getEditorFont());
popup.showUnderneathOf(myExpressionEditor.getEditorComponent());
}
}
use of com.intellij.xdebugger.XExpression in project intellij-community by JetBrains.
the class XValue method calculateEvaluationExpression.
/**
* 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);
}
use of com.intellij.xdebugger.XExpression in project intellij-community by JetBrains.
the class XDebuggerEditorBase method createLanguagePopup.
private ListPopup createLanguagePopup() {
DefaultActionGroup actions = new DefaultActionGroup();
for (Language language : getSupportedLanguages()) {
//noinspection ConstantConditions
actions.add(new AnAction(language.getDisplayName(), null, language.getAssociatedFileType().getIcon()) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
XExpression currentExpression = getExpression();
setExpression(new XExpressionImpl(currentExpression.getExpression(), language, currentExpression.getCustomInfo()));
requestFocusInEditor();
}
});
}
DataContext dataContext = DataManager.getInstance().getDataContext(getComponent());
return JBPopupFactory.getInstance().createActionGroupPopup("Choose Language", actions, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);
}
use of com.intellij.xdebugger.XExpression in project intellij-community by JetBrains.
the class ExpressionEditorWithHistory method showHistory.
private void showHistory() {
List<XExpression> expressions = getRecentExpressions();
if (!expressions.isEmpty()) {
ListPopupImpl historyPopup = new ListPopupImpl(new BaseListPopupStep<XExpression>(null, expressions) {
@Override
public PopupStep onChosen(XExpression selectedValue, boolean finalChoice) {
setExpression(selectedValue);
requestFocusInEditor();
return FINAL_CHOICE;
}
}) {
@Override
protected ListCellRenderer getListElementRenderer() {
return new ColoredListCellRenderer<XExpression>() {
@Override
protected void customizeCellRenderer(@NotNull JList list, XExpression value, int index, boolean selected, boolean hasFocus) {
append(value.getExpression(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
};
}
};
historyPopup.getList().setFont(EditorUtil.getEditorFont());
historyPopup.showUnderneathOf(getEditorComponent());
}
}
use of com.intellij.xdebugger.XExpression in project intellij-community by JetBrains.
the class WatchInplaceEditor method doOKAction.
@Override
public void doOKAction() {
XExpression expression = getExpression();
super.doOKAction();
int index = myRootNode.removeChildNode(myNode);
if (!XDebuggerUtilImpl.isEmptyExpression(expression) && index != -1) {
myWatchesView.addWatchExpression(expression, index, false);
}
TreeUtil.selectNode(myTree, myNode);
}
Aggregations