org.chromium.debug.ui/src/org/chromium/debug/ui/actions/JsBreakpointPropertiesRulerAction.java
changeset 355 8726e95bcbba
parent 2 e4420d2515f1
equal deleted inserted replaced
354:0bceeb415e7f 355:8726e95bcbba
     5 package org.chromium.debug.ui.actions;
     5 package org.chromium.debug.ui.actions;
     6 
     6 
     7 import org.chromium.debug.core.model.ChromiumLineBreakpoint;
     7 import org.chromium.debug.core.model.ChromiumLineBreakpoint;
     8 import org.eclipse.debug.core.model.IBreakpoint;
     8 import org.eclipse.debug.core.model.IBreakpoint;
     9 import org.eclipse.debug.ui.actions.RulerBreakpointAction;
     9 import org.eclipse.debug.ui.actions.RulerBreakpointAction;
       
    10 import org.eclipse.jface.action.IAction;
    10 import org.eclipse.jface.text.source.IVerticalRulerInfo;
    11 import org.eclipse.jface.text.source.IVerticalRulerInfo;
    11 import org.eclipse.jface.viewers.ISelection;
    12 import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
    12 import org.eclipse.jface.viewers.ISelectionChangedListener;
       
    13 import org.eclipse.jface.viewers.ISelectionProvider;
       
    14 import org.eclipse.jface.viewers.StructuredSelection;
       
    15 import org.eclipse.ui.dialogs.PropertyDialogAction;
       
    16 import org.eclipse.ui.texteditor.ITextEditor;
    13 import org.eclipse.ui.texteditor.ITextEditor;
    17 import org.eclipse.ui.texteditor.IUpdate;
    14 import org.eclipse.ui.texteditor.IUpdate;
    18 
    15 
    19 /**
    16 /**
    20  * Action to bring up the breakpoint properties dialog.
    17  * Action to bring up the breakpoint properties dialog.
    29   }
    26   }
    30 
    27 
    31   @Override
    28   @Override
    32   public void run() {
    29   public void run() {
    33     if (getBreakpoint() != null) {
    30     if (getBreakpoint() != null) {
    34       PropertyDialogAction action =
    31       JsBreakpointPropertiesAction.runAction(getBreakpoint(), getEditor().getEditorSite());
    35           new PropertyDialogAction(getEditor().getEditorSite(),
       
    36               new ISelectionProvider() {
       
    37                 public void addSelectionChangedListener(ISelectionChangedListener listener) {
       
    38                 }
       
    39 
       
    40                 public ISelection getSelection() {
       
    41                   return new StructuredSelection(getBreakpoint());
       
    42                 }
       
    43 
       
    44                 public void removeSelectionChangedListener(ISelectionChangedListener listener) {
       
    45                 }
       
    46 
       
    47                 public void setSelection(ISelection selection) {
       
    48                 }
       
    49               });
       
    50       action.run();
       
    51     }
    32     }
    52   }
    33   }
    53 
    34 
    54   public void update() {
    35   public void update() {
    55     breakpoint = null;
    36     breakpoint = null;
    59       breakpoint = activeBreakpoint;
    40       breakpoint = activeBreakpoint;
    60     }
    41     }
    61     setEnabled(breakpoint != null);
    42     setEnabled(breakpoint != null);
    62   }
    43   }
    63 
    44 
       
    45 
       
    46   public static class Delegate extends AbstractRulerActionDelegate {
       
    47 
       
    48     @Override
       
    49     protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
       
    50       return new JsBreakpointPropertiesRulerAction(editor, rulerInfo);
       
    51     }
       
    52 
       
    53   }
    64 }
    54 }