1 11 package org.eclipse.debug.internal.ui.actions.breakpointGroups; 12 13 import org.eclipse.debug.internal.ui.DebugUIPlugin; 14 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 15 import org.eclipse.jface.action.IAction; 16 import org.eclipse.jface.util.IPropertyChangeListener; 17 import org.eclipse.jface.util.PropertyChangeEvent; 18 import org.eclipse.jface.viewers.ISelection; 19 import org.eclipse.ui.IViewPart; 20 21 25 public abstract class BreakpointWorkingSetAction extends AbstractBreakpointsViewAction implements IPropertyChangeListener { 26 27 protected IAction fAction; 28 29 32 public void selectionChanged(IAction action, ISelection selection) { 33 update(); 34 } 35 36 39 public void init(IViewPart view) { 40 super.init(view); 41 DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); 42 } 43 44 47 public void dispose() { 48 DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); 49 super.dispose(); 50 } 51 54 public void init(IAction action) { 55 fAction = action; 56 super.init(action); 57 update(); 58 } 59 60 63 public void propertyChange(PropertyChangeEvent event) { 64 if (event.getProperty().equals(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME)) { 65 update(); 66 } 67 68 } 69 protected abstract void update(); 70 } 71 | Popular Tags |