1 11 package org.eclipse.debug.internal.ui.actions.breakpointGroups; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.debug.internal.ui.DebugUIPlugin; 15 import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer; 16 import org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetCategory; 17 import org.eclipse.jface.action.IAction; 18 import org.eclipse.jface.viewers.ISelection; 19 import org.eclipse.jface.viewers.IStructuredSelection; 20 import org.eclipse.jface.wizard.WizardDialog; 21 import org.eclipse.ui.IWorkingSet; 22 import org.eclipse.ui.PlatformUI; 23 import org.eclipse.ui.dialogs.IWorkingSetEditWizard; 24 25 28 public class EditBreakpointGroupAction extends AbstractBreakpointsViewAction { 29 30 33 private IWorkingSet fSet = null; 34 35 38 public void run(IAction action) { 39 IWorkingSetEditWizard editWizard = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetEditWizard(fSet); 40 WizardDialog dialog = new WizardDialog(DebugUIPlugin.getShell(), editWizard); 41 dialog.open(); 42 } 43 44 47 public void selectionChanged(IAction action, ISelection sel) { 48 IStructuredSelection selection= (IStructuredSelection) sel; 49 fSet = null; 50 if (selection.size() == 1) { 51 Object element = selection.getFirstElement(); 52 if (element instanceof BreakpointContainer) { 53 BreakpointContainer container = (BreakpointContainer)element; 54 IAdaptable category = container.getCategory(); 55 if (category instanceof WorkingSetCategory) { 56 IWorkingSet set = ((WorkingSetCategory)category).getWorkingSet(); 57 action.setEnabled(true); 58 fSet = set; 59 return; 60 } 61 } 62 } 63 action.setEnabled(false); 64 } 65 66 } 67 | Popular Tags |