@Override
 public String getDisplayText(XLineBreakpoint<P> breakpoint) {
   BreakpointWithHighlighter javaBreakpoint =
       (BreakpointWithHighlighter) BreakpointManager.getJavaBreakpoint(breakpoint);
   if (javaBreakpoint != null) {
     return javaBreakpoint.getDescription();
   } else {
     return super.getDisplayText(breakpoint);
   }
 }
  private void update(@NotNull List<BreakpointWithHighlighter> breakpoints) {
    final TIntHashSet intHash = new TIntHashSet();
    for (BreakpointWithHighlighter breakpoint : breakpoints) {
      SourcePosition sourcePosition = breakpoint.getSourcePosition();
      breakpoint.reload();

      if (breakpoint.isValid()) {
        if (sourcePosition == null
            || breakpoint.getSourcePosition().getLine() != sourcePosition.getLine()) {
          fireBreakpointChanged(breakpoint);
        }

        if (intHash.contains(breakpoint.getLineIndex())) {
          remove(breakpoint);
        } else {
          intHash.add(breakpoint.getLineIndex());
        }
      } else {
        remove(breakpoint);
      }
    }
  }
 @Override
 protected void createOrWaitPrepare(DebugProcessImpl debugProcess, String classToBeLoaded) {
   if (isInScopeOf(debugProcess, classToBeLoaded)) {
     super.createOrWaitPrepare(debugProcess, classToBeLoaded);
   }
 }
  @Override
  protected void doShowPopup(
      final Project project,
      final JComponent component,
      final Point whereToShow,
      final Object breakpoint) {
    if (!(breakpoint instanceof BreakpointWithHighlighter)) return;

    final BreakpointWithHighlighter javaBreakpoint = (BreakpointWithHighlighter) breakpoint;
    Key<? extends BreakpointWithHighlighter> category = javaBreakpoint.getCategory();

    final BreakpointFactory[] allFactories =
        ApplicationManager.getApplication().getExtensions(BreakpointFactory.EXTENSION_POINT_NAME);
    BreakpointFactory breakpointFactory = null;
    for (BreakpointFactory factory : allFactories) {
      if (factory.getBreakpointCategory().equals(category)) {
        breakpointFactory = factory;
      }
    }
    assert breakpointFactory != null : "can't find factory for breakpoint " + javaBreakpoint;

    final BreakpointPropertiesPanel propertiesPanel =
        breakpointFactory.createBreakpointPropertiesPanel(project, true);
    propertiesPanel.initFrom(javaBreakpoint, false);

    final JComponent mainPanel = propertiesPanel.getPanel();
    final String displayName = javaBreakpoint.getDisplayName();

    final JBPopupListener saveOnClose =
        new JBPopupListener() {
          @Override
          public void beforeShown(LightweightWindowEvent event) {}

          @Override
          public void onClosed(LightweightWindowEvent event) {
            propertiesPanel.saveTo(
                javaBreakpoint,
                new Runnable() {
                  @Override
                  public void run() {}
                });
          }
        };

    final Runnable showMoreOptions =
        new Runnable() {
          @Override
          public void run() {
            UIUtil.invokeLaterIfNeeded(
                new Runnable() {
                  @Override
                  public void run() {
                    final JBPopup popup =
                        BreakpointsMasterDetailPopupFactory.getInstance(project)
                            .createPopup(javaBreakpoint);
                    if (popup != null) {
                      popup.showCenteredInCurrentWindow(project);
                    }
                  }
                });
          }
        };
    final Balloon balloon =
        DebuggerUIUtil.showBreakpointEditor(
            project, mainPanel, displayName, whereToShow, component, showMoreOptions, breakpoint);
    balloon.addListener(saveOnClose);

    propertiesPanel.setDelegate(
        new BreakpointPropertiesPanel.Delegate() {
          @Override
          public void showActionsPanel() {
            propertiesPanel.setActionsPanelVisible(true);
            balloon.hide();
            final Balloon newBalloon =
                DebuggerUIUtil.showBreakpointEditor(
                    project,
                    mainPanel,
                    displayName,
                    whereToShow,
                    component,
                    showMoreOptions,
                    breakpoint);
            newBalloon.addListener(saveOnClose);
          }
        });

    ApplicationManager.getApplication()
        .invokeLater(
            new Runnable() {
              @Override
              public void run() {
                IdeFocusManager.findInstance().requestFocus(mainPanel, true);
              }
            });
  }
 protected void reload(PsiFile file) {
   super.reload(file);
   myMethodName = findMethodName(file, getHighlighter().getStartOffset());
 }