KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > actions > breakpointGroups > SetDefaultBreakpointGroupAction


1 /*******************************************************************************
2  * Copyright (c) 2004, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial implementation
10  *******************************************************************************/

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.views.breakpoints.BreakpointSetOrganizer;
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.jface.viewers.ISelection;
17 import org.eclipse.jface.window.Window;
18 import org.eclipse.ui.IWorkingSet;
19
20 /**
21  * Action which prompts the user to set a default breakpoint group.
22  */

23 public class SetDefaultBreakpointGroupAction extends AbstractBreakpointsViewAction {
24     
25     /* (non-Javadoc)
26      * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
27      */

28     public void run(IAction action) {
29         SelectBreakpointWorkingsetDialog sbwsd = new SelectBreakpointWorkingsetDialog(DebugUIPlugin.getShell(), BreakpointSetOrganizer.getDefaultWorkingSet());
30         sbwsd.setTitle(BreakpointGroupMessages.SetDefaultBreakpointGroupAction_0);
31         if(sbwsd.open() == Window.OK) {
32             BreakpointSetOrganizer.setDefaultWorkingSet((IWorkingSet) sbwsd.getResult()[0]);
33         }
34     }
35
36     /* (non-Javadoc)
37      * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
38      */

39     public void selectionChanged(IAction action, ISelection selection) {}
40
41 }
42
Popular Tags