1 11 package org.eclipse.jdt.internal.debug.ui.actions; 12 13 14 import org.eclipse.debug.core.model.IBreakpoint; 15 import org.eclipse.debug.ui.actions.RulerBreakpointAction; 16 import org.eclipse.jdt.debug.core.IJavaBreakpoint; 17 import org.eclipse.jface.text.source.IVerticalRulerInfo; 18 import org.eclipse.jface.viewers.ISelection; 19 import org.eclipse.jface.viewers.ISelectionChangedListener; 20 import org.eclipse.jface.viewers.ISelectionProvider; 21 import org.eclipse.jface.viewers.StructuredSelection; 22 import org.eclipse.ui.dialogs.PropertyDialogAction; 23 import org.eclipse.ui.texteditor.ITextEditor; 24 import org.eclipse.ui.texteditor.IUpdate; 25 26 27 32 public class JavaBreakpointPropertiesRulerAction extends RulerBreakpointAction implements IUpdate { 33 34 private IBreakpoint fBreakpoint; 35 36 39 public JavaBreakpointPropertiesRulerAction(ITextEditor editor, IVerticalRulerInfo info) { 40 super(editor, info); 41 setText(ActionMessages.JavaBreakpointPropertiesRulerAction_Breakpoint__Properties_1); 42 } 43 46 public void run() { 47 if (getBreakpoint() != null) { 48 PropertyDialogAction action= 49 new PropertyDialogAction(getEditor().getEditorSite(), new ISelectionProvider() { 50 public void addSelectionChangedListener(ISelectionChangedListener listener) { 51 } 52 public ISelection getSelection() { 53 return new StructuredSelection(getBreakpoint()); 54 } 55 public void removeSelectionChangedListener(ISelectionChangedListener listener) { 56 } 57 public void setSelection(ISelection selection) { 58 } 59 }); 60 action.run(); 61 } 62 } 63 64 67 public void update() { 68 fBreakpoint = null; 69 IBreakpoint breakpoint = getBreakpoint(); 70 if (breakpoint != null && (breakpoint instanceof IJavaBreakpoint)) { 71 fBreakpoint = breakpoint; 72 } 73 setEnabled(fBreakpoint != null); 74 } 75 } 76 | Popular Tags |