1 11 package org.eclipse.debug.internal.ui.actions.breakpoints; 12 13 import org.eclipse.core.resources.IMarkerDelta; 14 import org.eclipse.debug.core.DebugPlugin; 15 import org.eclipse.debug.core.IBreakpointsListener; 16 import org.eclipse.debug.core.model.IBreakpoint; 17 import org.eclipse.debug.internal.ui.actions.SelectAllAction; 18 import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView; 19 import org.eclipse.debug.ui.IDebugView; 20 import org.eclipse.jface.action.IAction; 21 import org.eclipse.jface.viewers.CheckboxTreeViewer; 22 23 public class SelectAllBreakpointsAction extends SelectAllAction implements IBreakpointsListener { 24 25 28 protected boolean isEnabled() { 29 return DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints(); 30 } 31 32 public void run(IAction action) { 33 if (!(getView() instanceof BreakpointsView)) { 34 return; 35 } 36 CheckboxTreeViewer viewer = ((BreakpointsView) getView()).getCheckboxViewer(); 37 viewer.getTree().selectAll(); 38 viewer.setSelection(viewer.getSelection()); 40 } 41 42 45 public void breakpointsAdded(IBreakpoint[] breakpoints) { 46 if (getAction() != null && !getAction().isEnabled()) { 47 update(); 48 } 49 } 50 51 54 public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) { 55 } 56 57 60 public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) { 61 if (getAction() != null) { 62 update(); 63 } 64 } 65 66 69 protected void initialize() { 70 DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this); 71 } 72 73 76 public void dispose() { 77 DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this); 78 super.dispose(); 79 } 80 81 84 protected String getActionId() { 85 return IDebugView.SELECT_ALL_ACTION; 86 } 87 } 88 | Popular Tags |