1 11 package org.eclipse.debug.internal.ui; 12 13 import org.eclipse.debug.core.DebugPlugin; 14 import org.eclipse.debug.core.ILaunch; 15 import org.eclipse.debug.core.ILaunchListener; 16 import org.eclipse.debug.internal.ui.actions.context.ActionRequestMonitor; 17 import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousStepFiltersAdapter; 18 19 25 public class StepFilterManager implements ILaunchListener { 26 27 31 protected StepFilterManager() { 32 DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); 33 } 34 35 38 public void shutdown() { 39 DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); 40 } 41 42 45 public void launchAdded(ILaunch launch) { 46 launchChanged(launch); 47 } 48 51 public void launchChanged(ILaunch launch) { 52 boolean useStepFilters = isUseStepFilters(); 53 IAsynchronousStepFiltersAdapter stepFilterAdapter = (IAsynchronousStepFiltersAdapter)launch.getAdapter(IAsynchronousStepFiltersAdapter.class); 54 if (stepFilterAdapter != null) 55 { 56 stepFilterAdapter.setStepFiltersEnabled(launch, useStepFilters, new ActionRequestMonitor()); 57 } 58 } 59 60 65 public boolean isUseStepFilters() { 66 return DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_USE_STEP_FILTERS); 68 } 69 70 75 public void setUseStepFilters(boolean useFilters) { 76 DebugUIPlugin.getDefault().getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USE_STEP_FILTERS, useFilters); 78 ILaunch[] launchs = DebugPlugin.getDefault().getLaunchManager().getLaunches(); 79 for (int i = 0; i < launchs.length; i++) { 80 ILaunch launch = launchs[i]; 81 launchChanged(launch); 82 } 83 } 84 85 88 public void launchRemoved(ILaunch launch) { 89 } 90 } 91 | Popular Tags |