Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a2e1c0e9da78e3ed551641bb7b00913e5b3ffc80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c)2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.debug.internal.ui.importexport.breakpoints;

import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Event;

/**
 * This class provides the aciton event for both the context menu in breakpoints view
 * and the drop down menu in the breakpoints view.
 * <p>
 * The action simply calls the wizard to import breakpoints.
 * </p>
 *
 *  @see WizardImportBreakpoints
 *  @see WizardImportBreakpointsPage
 *
 *  @since 3.2
 */
public class ImportBreakpoints extends AbstractDebugActionDelegate {

	/**
	 * Opens import wizard
	 *
	 * @param action IAction the action
	 */
	@Override
	public void run(IAction action) {
		WizardImportBreakpoints wiz = new WizardImportBreakpoints();
		wiz.init(DebugUIPlugin.getDefault().getWorkbench(), null);
		WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz);
		wizdialog.setBlockOnOpen(true);
		wizdialog.open();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
	 */
	@Override
	protected void doAction(Object element) throws DebugException {}

	/* (non-Javadoc)
	 * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
	 */
	@Override
	protected void update(IAction action, ISelection s) {
		getAction().setEnabled(true);
	}

	@Override
	public void runWithEvent(IAction action, Event event) {
		run(action);
	}
}

Back to the top