當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。