/*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.action.IAction#run()
  */
 public void run() {
   try {
     /*
      * Test if there are any markers at the current position.
      * if there are any, remove breakpointmarker, otherwise create a
      * new one.
      */
     List list = getMarkers();
     if (list.isEmpty()) {
       // create new markers
       IDocument document = getDocument();
       int lineNumber = getVerticalRulerInfo().getLineOfLastMouseButtonActivity();
       if (lineNumber >= document.getNumberOfLines()) {
         return;
       }
       try {
         IRegion line = document.getLineInformation(lineNumber);
         ITextSelection selection =
             new TextSelection(document, line.getOffset(), line.getLength());
         // fBreakpointAdapter.toggleLineBreakpoints(fTextEditor, selection);
         fBreakpointAdapter.toggleBreakpoints(fTextEditor, selection);
       } catch (BadLocationException e) {
         // likely document is folded so you cannot get the line information of the folded line
       }
     } else {
       // remove existing breakpoints of any type
       IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
       Iterator iterator = list.iterator();
       while (iterator.hasNext()) {
         IMarker marker = (IMarker) iterator.next();
         IBreakpoint breakpoint = manager.getBreakpoint(marker);
         if (breakpoint != null) {
           breakpoint.delete();
         }
       }
     }
   } catch (CoreException e) {
     // JDIDebugUIPlugin.errorDialog(ActionMessages.getString("ManageBreakpointRulerAction.error.adding.message1"), e); //$NON-NLS-1$
     // JDIDebugUIPlugin.errorDialog(ActionMessages.ManageBreakpointRulerAction_error_adding_message1, e);
     // This message may not make sense FIXME
     JDIDebugUIPlugin.errorDialog(
         ActionMessages.ManageMethodBreakpointActionDelegate_methodNonAvailable, e);
   }
 }