本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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();
}
示例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);
}
}
}
}
示例7: createDescriptorImpl
import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(@NotNull Project project) {
return new FieldDescriptorImpl(project, null, myField);
}
示例8: getDisplayKey
import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
public DisplayKey<FieldDescriptorImpl> getDisplayKey() {
return new SimpleDisplayKey<FieldDescriptorImpl>(myField);
}
示例9: createDescriptorImpl
import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(@NotNull Project project) {
return new FieldDescriptorImpl(project, myObjRef, myField);
}
示例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);
}
}
}
}
示例11: createDescriptorImpl
import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(Project project) {
return new FieldDescriptorImpl(project, null, myField);
}
示例12: createDescriptorImpl
import com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl; //导入依赖的package包/类
protected FieldDescriptorImpl createDescriptorImpl(Project project) {
return new FieldDescriptorImpl(project, myObjRef, myField);
}
示例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;
}
示例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);
}
}
}
}