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


Java FieldDescriptorImpl类代码示例

本文整理汇总了Java中com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl的典型用法代码示例。如果您正苦于以下问题:Java FieldDescriptorImpl类的具体用法?Java FieldDescriptorImpl怎么用?Java FieldDescriptorImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getModifier

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
public Modifier getModifier() {
  Modifier modifier = null;
  if (myEvaluatedField != null && (myEvaluatedQualifier instanceof ClassType || myEvaluatedQualifier instanceof ObjectReference)) {
    modifier = new Modifier() {
      public boolean canInspect() {
        return myEvaluatedQualifier instanceof ObjectReference;
      }

      public boolean canSetValue() {
        return true;
      }

      public void setValue(Value value) throws ClassNotLoadedException, InvalidTypeException {
        if (myEvaluatedQualifier instanceof ReferenceType) {
          ClassType classType = (ClassType)myEvaluatedQualifier;
          classType.setValue(myEvaluatedField, value);
        }
        else {
          ObjectReference objRef = (ObjectReference)myEvaluatedQualifier;
          objRef.setValue(myEvaluatedField, value);
        }
      }

      public Type getExpectedType() throws ClassNotLoadedException {
        return myEvaluatedField.type();
      }

      public NodeDescriptorImpl getInspectItem(Project project) {
        if(myEvaluatedQualifier instanceof ObjectReference) {
          return new FieldDescriptorImpl(project, (ObjectReference)myEvaluatedQualifier, myEvaluatedField);
        } else
          return null;
      }
    };
  }
  return modifier;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:FieldEvaluator.java

示例2: shouldDisplay

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected boolean shouldDisplay(EvaluationContext context, @NotNull ObjectReference objInstance, @NotNull Field field) {
  final boolean isSynthetic = DebuggerUtils.isSynthetic(field);
  if (!SHOW_SYNTHETICS && isSynthetic) {
    return false;
  }
  if (SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES && isSynthetic) {
    try {
      final StackFrameProxy frameProxy = context.getFrameProxy();
      if (frameProxy != null) {
        final Location location = frameProxy.location();
        if (location != null && objInstance.equals(context.getThisObject()) && Comparing.equal(objInstance.referenceType(), location.declaringType()) && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
          return false;
        }
      }
    }
    catch (EvaluateException ignored) {
    }
  }
  if(!SHOW_STATIC && field.isStatic()) {
    return false;
  }

  if(!SHOW_STATIC_FINAL && field.isStatic() && field.isFinal()) {
    return false;
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ClassRenderer.java

示例3: shouldDisplay

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
private boolean shouldDisplay(EvaluationContext context, @NotNull ObjectReference objInstance, @NotNull Field field) {
  final boolean isSynthetic = DebuggerUtils.isSynthetic(field);
  if (!SHOW_SYNTHETICS && isSynthetic) {
    return false;
  }
  if (SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES && isSynthetic) {
    try {
      final StackFrameProxy frameProxy = context.getFrameProxy();
      if (frameProxy != null) {
        final Location location = frameProxy.location();
        if (location != null && objInstance.equals(context.getThisObject()) && Comparing.equal(objInstance.referenceType(), location.declaringType()) && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
          return false;
        }
      }
    }
    catch (EvaluateException ignored) {
    }
  }
  if(!SHOW_STATIC && field.isStatic()) {
    return false;
  }

  if(!SHOW_STATIC_FINAL && field.isStatic() && field.isFinal()) {
    return false;
  }

  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:ClassRenderer.java

示例4: computeChildren

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
@Override
public void computeChildren(@NotNull final XCompositeNode node)
{
	myEvaluationContext.getDebugProcess().getManagerThread().schedule(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext())
	{
		@Override
		public void contextAction() throws Exception
		{
			final XValueChildrenList children = new XValueChildrenList();

			final ReferenceType refType = myStaticDescriptor.getType();
			List<Field> fields = refType.allFields();
			for(Field field : fields)
			{
				if(field.isStatic())
				{
					final FieldDescriptorImpl fieldDescriptor = myNodeManager.getFieldDescriptor(myStaticDescriptor, null, field);
					children.add(JavaValue.create(fieldDescriptor, myEvaluationContext, myNodeManager));
					//final DebuggerTreeNodeImpl node = myNodeManager.createNode(fieldDescriptor, myEvaluationContext);
					//myChildren.add(node);
				}
			}

			node.addChildren(children, true);
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:28,代码来源:JavaStaticGroup.java

示例5: shouldDisplay

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected boolean shouldDisplay(EvaluationContext context, @NotNull ObjectReference objInstance, @NotNull Field field)
{
	final boolean isSynthetic = DebuggerUtils.isSynthetic(field);
	if(!SHOW_SYNTHETICS && isSynthetic)
	{
		return false;
	}
	if(SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES && isSynthetic)
	{
		try
		{
			final StackFrameProxy frameProxy = context.getFrameProxy();
			if(frameProxy != null)
			{
				final Location location = frameProxy.location();
				if(location != null && objInstance.equals(context.getThisObject()) && Comparing.equal(objInstance.referenceType(), location.declaringType()) && StringUtil.startsWith(field.name()
						, FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX))
				{
					return false;
				}
			}
		}
		catch(EvaluateException ignored)
		{
		}
	}

	// dont show static fields
	return !field.isStatic();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:31,代码来源:ClassRenderer.java

示例6: actionPerformed

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  final SourcePosition place = getPlace(e);

  if(place != null) {
    Document document = PsiDocumentManager.getInstance(project).getDocument(place.getFile());
    if (document != null) {
      DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
      BreakpointManager manager = debuggerManager.getBreakpointManager();
      final int offset = place.getOffset();
      final Breakpoint breakpoint = offset >= 0? manager.findBreakpoint(document, offset, FieldBreakpoint.CATEGORY) : null;

      if(breakpoint == null) {
        FieldBreakpoint fieldBreakpoint = manager.addFieldBreakpoint(document, offset);
        if (fieldBreakpoint != null) {
          if(DebuggerAction.isContextView(e)) {
            final DebuggerTreeNodeImpl selectedNode = DebuggerAction.getSelectedNode(e.getDataContext());
            if (selectedNode != null && selectedNode.getDescriptor() instanceof FieldDescriptorImpl) {
              ObjectReference object = ((FieldDescriptorImpl)selectedNode.getDescriptor()).getObject();
              if(object != null) {
                long id = object.uniqueID();
                InstanceFilter[] instanceFilters = new InstanceFilter[] { InstanceFilter.create(Long.toString(id))};
                fieldBreakpoint.setInstanceFilters(instanceFilters);
                fieldBreakpoint.setInstanceFiltersEnabled(true);
              }
            }
          }

          final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
          if (editor != null) {
            manager.editBreakpoint(fieldBreakpoint, editor);
          }
        }
      }
      else {
        manager.removeBreakpoint(breakpoint);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:ToggleFieldBreakpointAction.java

示例7: createDescriptorImpl

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(@NotNull Project project) {
  return new FieldDescriptorImpl(project, null, myField);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:StaticFieldData.java

示例8: getDisplayKey

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
public DisplayKey<FieldDescriptorImpl> getDisplayKey() {
  return new SimpleDisplayKey<FieldDescriptorImpl>(myField);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:StaticFieldData.java

示例9: createDescriptorImpl

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(@NotNull Project project) {
  return new FieldDescriptorImpl(project, myObjRef, myField);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FieldData.java

示例10: actionPerformed

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(PlatformDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  final SourcePosition place = getPlace(e);

  if(place != null) {
    Document document = PsiDocumentManager.getInstance(project).getDocument(place.getFile());
    if (document != null) {
      DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
      BreakpointManager manager = debuggerManager.getBreakpointManager();
      final int offset = place.getOffset();
      final Breakpoint breakpoint = offset >= 0? manager.findBreakpoint(document, offset, FieldBreakpoint.CATEGORY) : null;

      if(breakpoint == null) {
        FieldBreakpoint fieldBreakpoint = manager.addFieldBreakpoint(document, offset);
        if (fieldBreakpoint != null) {
          if(DebuggerAction.isContextView(e)) {
            final DebuggerTreeNodeImpl selectedNode = DebuggerAction.getSelectedNode(e.getDataContext());
            if (selectedNode != null && selectedNode.getDescriptor() instanceof FieldDescriptorImpl) {
              ObjectReference object = ((FieldDescriptorImpl)selectedNode.getDescriptor()).getObject();
              if(object != null) {
                long id = object.uniqueID();
                InstanceFilter[] instanceFilters = new InstanceFilter[] { InstanceFilter.create(Long.toString(id))};
                fieldBreakpoint.setInstanceFilters(instanceFilters);
                fieldBreakpoint.INSTANCE_FILTERS_ENABLED = true;
              }
            }
          }

          RequestManagerImpl.createRequests(fieldBreakpoint);

          manager.editBreakpoint(fieldBreakpoint, PlatformDataKeys.EDITOR.getData(e.getDataContext()));
        }
      }
      else {
        manager.removeBreakpoint(breakpoint);
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:ToggleFieldBreakpointAction.java

示例11: createDescriptorImpl

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(Project project) {
  return new FieldDescriptorImpl(project, null, myField);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:StaticFieldData.java

示例12: createDescriptorImpl

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(Project project) {
  return new FieldDescriptorImpl(project, myObjRef, myField);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:FieldData.java

示例13: getModifier

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
@Override
public Modifier getModifier()
{
	Modifier modifier = null;
	if(myEvaluatedField != null && (myEvaluatedQualifier instanceof ClassType || myEvaluatedQualifier instanceof ObjectReference))
	{
		modifier = new Modifier()
		{
			@Override
			public boolean canInspect()
			{
				return myEvaluatedQualifier instanceof ObjectReference;
			}

			@Override
			public boolean canSetValue()
			{
				return true;
			}

			@Override
			public void setValue(Value value) throws ClassNotLoadedException, InvalidTypeException
			{
				if(myEvaluatedQualifier instanceof ReferenceType)
				{
					ClassType classType = (ClassType) myEvaluatedQualifier;
					classType.setValue(myEvaluatedField, value);
				}
				else
				{
					ObjectReference objRef = (ObjectReference) myEvaluatedQualifier;
					objRef.setValue(myEvaluatedField, value);
				}
			}

			@Override
			public Type getExpectedType() throws ClassNotLoadedException
			{
				return myEvaluatedField.type();
			}

			@Override
			public NodeDescriptorImpl getInspectItem(Project project)
			{
				if(myEvaluatedQualifier instanceof ObjectReference)
				{
					return new FieldDescriptorImpl(project, (ObjectReference) myEvaluatedQualifier, myEvaluatedField);
				}
				else
				{
					return null;
				}
			}
		};
	}
	return modifier;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:58,代码来源:FieldEvaluator.java

示例14: actionPerformed

import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e)
{
	Project project = e.getData(CommonDataKeys.PROJECT);
	if(project == null)
	{
		return;
	}
	final SourcePosition place = getPlace(e);

	if(place != null)
	{
		Document document = PsiDocumentManager.getInstance(project).getDocument(place.getFile());
		if(document != null)
		{
			DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
			BreakpointManager manager = debuggerManager.getBreakpointManager();
			final int offset = place.getOffset();
			final Breakpoint breakpoint = offset >= 0 ? manager.findBreakpoint(document, offset, FieldBreakpoint.CATEGORY) : null;

			if(breakpoint == null)
			{
				FieldBreakpoint fieldBreakpoint = manager.addFieldBreakpoint(document, offset);
				if(fieldBreakpoint != null)
				{
					if(DebuggerAction.isContextView(e))
					{
						final DebuggerTreeNodeImpl selectedNode = DebuggerAction.getSelectedNode(e.getDataContext());
						if(selectedNode != null && selectedNode.getDescriptor() instanceof FieldDescriptorImpl)
						{
							ObjectReference object = ((FieldDescriptorImpl) selectedNode.getDescriptor()).getObject();
							if(object != null)
							{
								long id = object.uniqueID();
								InstanceFilter[] instanceFilters = new InstanceFilter[]{InstanceFilter.create(Long.toString(id))};
								fieldBreakpoint.setInstanceFilters(instanceFilters);
								fieldBreakpoint.setInstanceFiltersEnabled(true);
							}
						}
					}

					final Editor editor = e.getData(CommonDataKeys.EDITOR);
					if(editor != null)
					{
						manager.editBreakpoint(fieldBreakpoint, editor);
					}
				}
			}
			else
			{
				manager.removeBreakpoint(breakpoint);
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:56,代码来源:ToggleFieldBreakpointAction.java


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