本文整理匯總了Java中com.intellij.debugger.DebuggerContext類的典型用法代碼示例。如果您正苦於以下問題:Java DebuggerContext類的具體用法?Java DebuggerContext怎麽用?Java DebuggerContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DebuggerContext類屬於com.intellij.debugger包,在下文中一共展示了DebuggerContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
@Override
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
String fieldName;
if(isStatic()) {
String typeName = myField.declaringType().name().replace('$', '.');
typeName = DebuggerTreeNodeExpression.normalize(typeName, PositionUtil.getContextElement(context), context.getProject());
fieldName = typeName + "." + getName();
}
else {
//noinspection HardCodedStringLiteral
fieldName = isOuterLocalVariableValue()? StringUtil.trimStart(getName(), OUTER_LOCAL_VAR_FIELD_PREFIX) : "this." + getName();
}
try {
return elementFactory.createExpressionFromText(fieldName, null);
}
catch (IncorrectOperationException e) {
throw new EvaluateException(DebuggerBundle.message("error.invalid.field.name", getName()), e);
}
}
示例2: getWrappedDescriptor
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
private static ValueDescriptor getWrappedDescriptor(Value ref, final Project project) {
final Field field = ((ObjectReference)ref).referenceType().fieldByName("value");
final Value wrapped = ((ObjectReference)ref).getValue(field);
return new ValueDescriptorImpl(project, wrapped) {
@Override
public Value calcValue(EvaluationContextImpl evaluationContext) throws EvaluateException {
return wrapped;
}
@Override
public String calcValueName() {
return field.name();
}
@Override
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
return JavaPsiFacade.getElementFactory(context.getProject()).createExpressionFromText("this." + field.name(), null);
}
};
}
示例3: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
String fieldName;
if(isStatic()) {
String typeName = myField.declaringType().name().replace('$', '.');
typeName = DebuggerTreeNodeExpression.normalize(typeName, PositionUtil.getContextElement(context), context.getProject());
fieldName = typeName + "." + getName();
}
else {
//noinspection HardCodedStringLiteral
fieldName = isOuterLocalVariableValue()? StringUtil.trimStart(getName(), OUTER_LOCAL_VAR_FIELD_PREFIX) : "this." + getName();
}
try {
return elementFactory.createExpressionFromText(fieldName, null);
}
catch (IncorrectOperationException e) {
throw new EvaluateException(DebuggerBundle.message("error.invalid.field.name", getName()), e);
}
}
示例4: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
@Override
public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context)
{
LOG.assertTrue(node.getDescriptor() instanceof ArrayElementDescriptorImpl, node.getDescriptor().getClass().getName());
ArrayElementDescriptorImpl descriptor = (ArrayElementDescriptorImpl) node.getDescriptor();
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
try
{
return elementFactory.createExpressionFromText("this[" + descriptor.getIndex() + "]", elementFactory.getArrayClass(LanguageLevel.HIGHEST));
}
catch(IncorrectOperationException e)
{
LOG.error(e);
return null;
}
}
示例5: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException
{
Value expressionValue = getLastChildrenValue(node.getParent().getDescriptor());
if(expressionValue == null)
{
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression"));
}
NodeRenderer childrenRenderer = getChildrenRenderer(expressionValue, (ValueDescriptor) node.getParent().getDescriptor());
PsiExpression childrenPsiExpression = myChildrenExpression.getPsiExpression(node.getProject());
if(childrenPsiExpression == null)
{
return null;
}
return DebuggerTreeNodeExpression.substituteThis(childrenRenderer.getChildValueExpression(node, context), (PsiExpression) childrenPsiExpression.copy(), expressionValue);
}
示例6: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
@Override
public PsiElement getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException
{
FieldDescriptor fieldDescriptor = (FieldDescriptor) node.getDescriptor();
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
try
{
return elementFactory.createExpressionFromText(fieldDescriptor.getField().name(), DebuggerUtils.findClass(fieldDescriptor.getObject().referenceType().name(), context.getProject(),
context.getDebugProcess().getSearchScope()));
}
catch(IncorrectOperationException e)
{
throw new EvaluateException(DebuggerBundle.message("error.invalid.field.name", fieldDescriptor.getField().name()), null);
}
}
示例7: getFullValueDescriptor
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public ValueDescriptorImpl getFullValueDescriptor()
{
ValueDescriptorImpl descriptor = new ValueDescriptorImpl(myProject, myValue)
{
@Override
public Value calcValue(EvaluationContextImpl evaluationContext) throws EvaluateException
{
return myValue;
}
@Override
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException
{
return null;
}
};
descriptor.myFullValue = true;
return descriptor;
}
示例8: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
@Override
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException
{
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(myProject).getElementFactory();
String fieldName;
if(isStatic())
{
String typeName = myField.declaringType().name().replace('$', '.');
typeName = DebuggerTreeNodeExpression.normalize(typeName, PositionUtil.getContextElement(context), myProject);
fieldName = typeName + "." + getName();
}
else
{
//noinspection HardCodedStringLiteral
fieldName = isOuterLocalVariableValue() ? StringUtil.trimStart(getName(), OUTER_LOCAL_VAR_FIELD_PREFIX) : "this." + getName();
}
try
{
return elementFactory.createExpressionFromText(fieldName, null);
}
catch(IncorrectOperationException e)
{
throw new EvaluateException(DebuggerBundle.message("error.invalid.field.name", getName()), e);
}
}
示例9: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) {
LOG.assertTrue(node.getDescriptor() instanceof ArrayElementDescriptorImpl, node.getDescriptor().getClass().getName());
ArrayElementDescriptorImpl descriptor = (ArrayElementDescriptorImpl)node.getDescriptor();
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
try {
LanguageLevel languageLevel = LanguageLevelProjectExtension.getInstance(node.getProject()).getLanguageLevel();
return elementFactory.createExpressionFromText("this[" + descriptor.getIndex() + "]", elementFactory.getArrayClass(languageLevel));
}
catch (IncorrectOperationException e) {
LOG.error(e);
return null;
}
}
示例10: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException {
Value expressionValue = node.getParent().getDescriptor().getUserData(EXPRESSION_VALUE);
if (expressionValue == null) {
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression"));
}
NodeRenderer childrenRenderer = getChildrenRenderer(expressionValue, (ValueDescriptor) node.getParent().getDescriptor());
return DebuggerTreeNodeExpression.substituteThis(
childrenRenderer.getChildValueExpression(node, context),
(PsiExpression)myChildrenExpression.getPsiExpression(node.getProject()).copy(),
expressionValue);
}
示例11: getChildValueExpression
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
@Override
public PsiElement getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException {
FieldDescriptor fieldDescriptor = (FieldDescriptor)node.getDescriptor();
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
try {
return elementFactory.createExpressionFromText(fieldDescriptor.getField().name(), DebuggerUtils.findClass(
fieldDescriptor.getObject().referenceType().name(), context.getProject(), context.getDebugProcess().getSearchScope())
);
}
catch (IncorrectOperationException e) {
throw new EvaluateException(DebuggerBundle.message("error.invalid.field.name", fieldDescriptor.getField().name()), null);
}
}
示例12: actionPerformed
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public void actionPerformed(AnActionEvent e) {
DebuggerTreeNodeImpl selectedNode = (DebuggerTreeNodeImpl)((DebuggerUtilsEx)DebuggerUtils.getInstance()).getSelectedNode(e.getDataContext());
if(selectedNode == null) return;
if(!isPrimitiveArray(selectedNode)) return;
final DebuggerContext debuggerContext = DebuggerUtils.getInstance().getDebuggerContext(e.getDataContext());
if(debuggerContext == null || debuggerContext.getDebugProcess() == null) return;
for(Enumeration children = selectedNode.children(); children.hasMoreElements(); ) {
final DebuggerTreeNode child = (DebuggerTreeNode)children.nextElement();
if(child.getDescriptor() instanceof ValueDescriptor) {
debuggerContext.getDebugProcess().getManagerThread().invokeCommand(new SuspendContextCommand() {
public SuspendContext getSuspendContext() {
return debuggerContext.getSuspendContext();
}
public void action() {
child.setRenderer(myRenderer);
}
public void commandCancelled() {
}
});
}
}
}
示例13: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
try {
return elementFactory.createExpressionFromText("this[" + myIndex + "]", null);
}
catch (IncorrectOperationException e) {
throw new EvaluateException(e.getMessage(), e);
}
}
示例14: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
try {
return elementFactory.createExpressionFromText(getName(), PositionUtil.getContextElement(context));
}
catch (IncorrectOperationException e) {
throw new EvaluateException(DebuggerBundle.message("error.invalid.local.variable.name", getName()), e);
}
}
示例15: getDescriptorEvaluation
import com.intellij.debugger.DebuggerContext; //導入依賴的package包/類
public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(context.getProject()).getElementFactory();
try {
return elementFactory.createExpressionFromText("this", null);
}
catch (IncorrectOperationException e) {
throw new EvaluateException(e.getMessage(), e);
}
}