1 11 package org.eclipse.debug.internal.ui.actions; 12 13 14 import org.eclipse.core.resources.IMarkerDelta; 15 import org.eclipse.debug.core.DebugPlugin; 16 import org.eclipse.debug.core.IBreakpointsListener; 17 import org.eclipse.debug.core.model.IBreakpoint; 18 import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView; 19 import org.eclipse.debug.ui.IDebugView; 20 import org.eclipse.jface.viewers.CheckboxTreeViewer; 21 import org.eclipse.ui.IViewPart; 22 23 public class SelectAllBreakpointsAction extends SelectAllAction implements IBreakpointsListener { 24 25 protected void update() { 26 getAction().setEnabled( 27 DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints()); 28 } 29 30 33 protected void doAction(Object element) { 34 if (!(getView() instanceof BreakpointsView)) { 35 return; 36 } 37 CheckboxTreeViewer viewer = ((BreakpointsView) getView()).getCheckboxViewer(); 38 viewer.getTree().selectAll(); 39 viewer.setSelection(viewer.getSelection()); 41 } 42 43 46 public void breakpointsAdded(IBreakpoint[] breakpoints) { 47 if (getAction() != null && !getAction().isEnabled()) { 48 update(); 49 } 50 } 51 52 55 public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) { 56 } 57 58 61 public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) { 62 if (getAction() != null) { 63 update(); 64 } 65 } 66 67 70 public void init(IViewPart view) { 71 super.init(view); 72 DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this); 73 } 74 75 public void dispose() { 76 DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this); 77 super.dispose(); 78 } 79 80 protected String getActionId() { 81 return IDebugView.SELECT_ALL_ACTION; 82 } 83 } 84 | Popular Tags |