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


Java XBreakpoint类代码示例

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


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

示例1: registerBreakpoints

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
private synchronized void registerBreakpoints() {

        log.debug("registering pending breakpoints");

        for (XBreakpoint b : installedBreaks) {
            while (!controller.isReady()) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                    return;
                }
            }

            controller.addBreakPoint(b);
        }

        installedBreaks.clear();
    }
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:20,代码来源:LuaDebugProcess.java

示例2: registerBreakpoint

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Override
public void registerBreakpoint(@NotNull XBreakpoint breakpoint) {
  Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
  if (javaBreakpoint == null) {
    javaBreakpoint = createJavaBreakpoint(breakpoint);
    breakpoint.putUserData(Breakpoint.DATA_KEY, javaBreakpoint);
  }
  if (javaBreakpoint != null) {
    final Breakpoint bpt = javaBreakpoint;
    BreakpointManager.addBreakpoint(bpt);
    // use schedule not to block initBreakpoints
    myProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
      @Override
      protected void action() throws Exception {
        bpt.createRequest(myProcess);
      }

      @Override
      public Priority getPriority() {
        return Priority.HIGH;
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JavaBreakpointHandler.java

示例3: unregisterBreakpoint

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Override
public void unregisterBreakpoint(@NotNull final XBreakpoint breakpoint, boolean temporary) {
  final Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
  if (javaBreakpoint != null) {
    // use schedule not to block initBreakpoints
    myProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
      @Override
      protected void action() throws Exception {
        myProcess.getRequestsManager().deleteRequest(javaBreakpoint);
      }

      @Override
      public Priority getPriority() {
        return Priority.HIGH;
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavaBreakpointHandler.java

示例4: getGroup

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Override
public XBreakpointClassGroup getGroup(@NotNull B b, @NotNull Collection<XBreakpointClassGroup> groups) {
  if (b instanceof XBreakpoint) {
    Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint((XBreakpoint)b);
    if (javaBreakpoint == null) {
      return null;
    }
    String className = javaBreakpoint.getShortClassName();
    String packageName = javaBreakpoint.getPackageName();
    if (className == null) {
      return null;
    }
    for (XBreakpointClassGroup group : groups) {
      if (group.getClassName().equals(className) && group.getPackageName().equals(packageName))  {
        return group;
      }
    }
    return new XBreakpointClassGroup(packageName, className);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:XBreakpointGroupingByClassRule.java

示例5: getGroup

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Override
public XBreakpointPackageGroup getGroup(@NotNull B breakpoint, @NotNull Collection<XBreakpointPackageGroup> groups) {
  String packageName = null;
  if (breakpoint instanceof XBreakpoint) {
    Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint((XBreakpoint)breakpoint);
    if (javaBreakpoint != null) {
      packageName = javaBreakpoint.getPackageName();
    }
  }
  if (packageName == null) {
    return null;
  }
  for (XBreakpointPackageGroup group : groups) {
    if (StringUtil.equals(group.getPackageName(), packageName)) {
      return group;
    }
  }
  return new XBreakpointPackageGroup(packageName);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XBreakpointGroupingByPackageRule.java

示例6: addBreakpoint

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Nullable
@Override
public XBreakpoint<JavaMethodBreakpointProperties> addBreakpoint(final Project project, JComponent parentComponent) {
  final AddWildcardBreakpointDialog dialog = new AddWildcardBreakpointDialog(project);
  if (!dialog.showAndGet()) {
    return null;
  }
  return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint<JavaMethodBreakpointProperties>>() {
    @Override
    public XBreakpoint<JavaMethodBreakpointProperties> compute() {
      return XDebuggerManager.getInstance(project).getBreakpointManager()
        .addBreakpoint(JavaWildcardMethodBreakpointType.this, new JavaMethodBreakpointProperties(
          dialog.getClassPattern(),
          dialog.getMethodName()));
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaWildcardMethodBreakpointType.java

示例7: addBreakpoint

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Nullable
@Override
public XBreakpoint<JavaExceptionBreakpointProperties> addBreakpoint(final Project project, JComponent parentComponent) {
  final PsiClass throwableClass =
    JavaPsiFacade.getInstance(project).findClass(CommonClassNames.JAVA_LANG_THROWABLE, GlobalSearchScope.allScope(project));
  TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
    .createInheritanceClassChooser(DebuggerBundle.message("add.exception.breakpoint.classchooser.title"),
                                   GlobalSearchScope.allScope(project), throwableClass, true, true, null);
  chooser.showDialog();
  final PsiClass selectedClass = chooser.getSelected();
  final String qName = selectedClass == null ? null : JVMNameUtil.getNonAnonymousClassName(selectedClass);

  if (qName != null && qName.length() > 0) {
    return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint<JavaExceptionBreakpointProperties>>() {
     @Override
     public XBreakpoint<JavaExceptionBreakpointProperties> compute() {
       return XDebuggerManager.getInstance(project).getBreakpointManager().addBreakpoint(
         JavaExceptionBreakpointType.this, new JavaExceptionBreakpointProperties(qName, ((PsiClassOwner)selectedClass.getContainingFile()).getPackageName()));
     }
   });
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:JavaExceptionBreakpointType.java

示例8: getSourcePosition

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
@Nullable
@Override
public XSourcePosition getSourcePosition(@NotNull XBreakpoint<T> breakpoint) {
  Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
  if (javaBreakpoint != null) {
    final PsiClass aClass = javaBreakpoint.getPsiClass();
    if (aClass != null) {
      return ApplicationManager.getApplication().runReadAction(new Computable<XSourcePosition>() {
        @Override
        public XSourcePosition compute() {
          PsiFile containingFile = aClass.getContainingFile();
          if (containingFile != null && aClass.getTextOffset() >= 0) {
            return XDebuggerUtil.getInstance().createPositionByOffset(containingFile.getVirtualFile(), aClass.getTextOffset());
          }
          return null;
        }
      });
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaBreakpointTypeBase.java

示例9: getText

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
static String getText(XBreakpoint<JavaMethodBreakpointProperties> breakpoint) {
  final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
  try {
    //if(isValid()) {
    final String className = breakpoint.getProperties().myClassPattern;
    final boolean classNameExists = className != null && className.length() > 0;
    if (classNameExists) {
      buffer.append(className);
    }
    if(breakpoint.getProperties().myMethodName != null) {
      if (classNameExists) {
        buffer.append(".");
      }
      buffer.append(breakpoint.getProperties().myMethodName);
    }
    //}
    //else {
    //  buffer.append(DebuggerBundle.message("status.breakpoint.invalid"));
    //}
    return buffer.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(buffer);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaMethodBreakpointType.java

示例10: updateBreakpoints

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
private void updateBreakpoints(@NotNull Document document) {
  Collection<XLineBreakpointImpl> breakpoints = myBreakpoints.getKeysByValue(document);
  if (breakpoints == null) {
    return;
  }

  TIntHashSet lines = new TIntHashSet();
  List<XBreakpoint<?>> toRemove = new SmartList<XBreakpoint<?>>();
  for (XLineBreakpointImpl breakpoint : breakpoints) {
    breakpoint.updatePosition();
    if (!breakpoint.isValid() || !lines.add(breakpoint.getLine())) {
      toRemove.add(breakpoint);
    }
  }

  removeBreakpoints(toRemove);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:XLineBreakpointManager.java

示例11: XDependentBreakpointManager

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
public XDependentBreakpointManager(final XBreakpointManagerImpl breakpointManager) {
  myBreakpointManager = breakpointManager;
  myDispatcher = EventDispatcher.create(XDependentBreakpointListener.class);
  myBreakpointManager.addBreakpointListener(new XBreakpointAdapter<XBreakpoint<?>>() {
    public void breakpointRemoved(@NotNull final XBreakpoint<?> breakpoint) {
      XDependentBreakpointInfo info = mySlave2Info.remove(breakpoint);
      if (info != null) {
        myMaster2Info.remove(info.myMasterBreakpoint, info);
      }

      Collection<XDependentBreakpointInfo> infos = myMaster2Info.removeAll((XBreakpointBase)breakpoint);
      if (infos != null) {
        for (XDependentBreakpointInfo breakpointInfo : infos) {
          XDependentBreakpointInfo removed = mySlave2Info.remove(breakpointInfo.mySlaveBreakpoint);
          if (removed != null) {
            myDispatcher.getMulticaster().dependencyCleared(breakpointInfo.mySlaveBreakpoint);
          }
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XDependentBreakpointManager.java

示例12: setMasterBreakpoint

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
public void setMasterBreakpoint(@NotNull XBreakpoint<?> slave, @NotNull XBreakpoint<?> master, boolean leaveEnabled) {
  XDependentBreakpointInfo info = mySlave2Info.get(slave);
  if (info == null) {
    addDependency((XBreakpointBase<?,?,?>)master, (XBreakpointBase<?,?,?>)slave, leaveEnabled);
  }
  else if (info.myMasterBreakpoint == master) {
    info.myLeaveEnabled = leaveEnabled;
  }
  else {
    myMaster2Info.remove(info.myMasterBreakpoint, info);
    info.myMasterBreakpoint = (XBreakpointBase)master;
    info.myLeaveEnabled = leaveEnabled;
    myMaster2Info.put((XBreakpointBase)master, info);
  }
  myDispatcher.getMulticaster().dependencySet(slave, master);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:XDependentBreakpointManager.java

示例13: testSerialize

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
public void testSerialize() throws Exception {
  XLineBreakpoint<?> master = createMaster();
  XLineBreakpoint<?> slave = createSlave();
  myDependentBreakpointManager.setMasterBreakpoint(slave, master, true);

  Element element = save();
  myDependentBreakpointManager.clearMasterBreakpoint(slave);
  //System.out.println(JDOMUtil.writeElement(element, SystemProperties.getLineSeparator()));
  load(element);

  List<XBreakpoint<?>> breakpoints = getAllBreakpoints();
  assertEquals(3, breakpoints.size());
  assertEquals("default", ((MyBreakpointProperties)breakpoints.get(0).getProperties()).myOption);
  XLineBreakpoint newMaster = (XLineBreakpoint)breakpoints.get(1);
  XLineBreakpoint newSlave = (XLineBreakpoint)breakpoints.get(2);
  assertEquals("file://master", newMaster.getFileUrl());
  assertEquals("file://slave", newSlave.getFileUrl());
  assertSame(newMaster, myDependentBreakpointManager.getMasterBreakpoint(newSlave));
  assertTrue(myDependentBreakpointManager.isLeaveEnabled(newSlave));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:XDependentBreakpointsTest.java

示例14: testAddRemove

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
public void testAddRemove() {
  XBreakpoint<MyBreakpointProperties> defaultBreakpoint = myBreakpointManager.getDefaultBreakpoint(MY_SIMPLE_BREAKPOINT_TYPE);
  assertSameElements(getAllBreakpoints(), defaultBreakpoint);

  XLineBreakpoint<MyBreakpointProperties> lineBreakpoint =
    myBreakpointManager.addLineBreakpoint(MY_LINE_BREAKPOINT_TYPE, "url", 239, new MyBreakpointProperties("123"));

  XBreakpoint<MyBreakpointProperties> breakpoint = myBreakpointManager.addBreakpoint(MY_SIMPLE_BREAKPOINT_TYPE, new MyBreakpointProperties("abc"));

  assertSameElements(getAllBreakpoints(), breakpoint, lineBreakpoint, defaultBreakpoint);
  assertSame(lineBreakpoint, assertOneElement(myBreakpointManager.getBreakpoints(MY_LINE_BREAKPOINT_TYPE)));
  assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), breakpoint, defaultBreakpoint);

  myBreakpointManager.removeBreakpoint(lineBreakpoint);
  assertSameElements(getAllBreakpoints(), breakpoint, defaultBreakpoint);
  assertTrue(myBreakpointManager.getBreakpoints(MY_LINE_BREAKPOINT_TYPE).isEmpty());
  assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), breakpoint, defaultBreakpoint);

  myBreakpointManager.removeBreakpoint(breakpoint);
  assertSameElements(getAllBreakpoints(), defaultBreakpoint);
  assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), defaultBreakpoint);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XBreakpointManagerTest.java

示例15: getAllBreakpoints

import com.intellij.xdebugger.breakpoints.XBreakpoint; //导入依赖的package包/类
protected List<XBreakpoint<?>> getAllBreakpoints() {
  final XBreakpointBase<?,?,?>[] breakpoints = ApplicationManager.getApplication().runReadAction(new Computable<XBreakpointBase<?,?,?>[]>() {
          public XBreakpointBase<?,?,?>[] compute() {
            return myBreakpointManager.getAllBreakpoints();
          }
        });
  final List<XBreakpoint<?>> result = new ArrayList<XBreakpoint<?>>();
  for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) {
    final XBreakpointType type = breakpoint.getType();
    if (type instanceof MySimpleBreakpointType || type instanceof MyLineBreakpointType) {
      result.add(breakpoint);
    }
  }
  Collections.sort(result, new Comparator<XBreakpoint<?>>() {
    @Override
    public int compare(XBreakpoint<?> o1, XBreakpoint<?> o2) {
      return StringUtil.compare(((MyBreakpointProperties)o1.getProperties()).myOption,
                                ((MyBreakpointProperties)o2.getProperties()).myOption, true);
    }
  });
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XBreakpointsTestCase.java


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