1 11 package org.eclipse.debug.ui.actions; 12 13 import org.eclipse.swt.widgets.Event; 14 15 import org.eclipse.jface.action.IAction; 16 17 import org.eclipse.jface.text.source.IVerticalRulerInfo; 18 19 import org.eclipse.ui.IActionDelegate2; 20 import org.eclipse.ui.IEditorPart; 21 import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; 22 import org.eclipse.ui.texteditor.ITextEditor; 23 24 73 public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDelegate implements IActionDelegate2 { 74 75 private IEditorPart fEditor = null; 76 private ToggleBreakpointAction fDelegate = null; 77 78 81 protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) { 82 fDelegate = new ToggleBreakpointAction(editor, null, rulerInfo); 83 return fDelegate; 84 } 85 86 89 public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) { 90 if (fEditor != null) { 91 if (fDelegate != null) { 92 fDelegate.dispose(); 93 fDelegate = null; 94 } 95 } 96 fEditor = targetEditor; 97 super.setActiveEditor(callerAction, targetEditor); 98 } 99 100 103 public void init(IAction action) { 104 } 105 106 109 public void dispose() { 110 if (fDelegate != null) { 111 fDelegate.dispose(); 112 } 113 fDelegate = null; 114 fEditor = null; 115 } 116 117 120 public void runWithEvent(IAction action, Event event) { 121 run(action); 122 } 123 } 124 | Popular Tags |