]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/workingsets/EditWorkingSetAction.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / workingsets / EditWorkingSetAction.java
CommitLineData
1b2798f6
EK
1/*******************************************************************************
2 * Copyright (c) 2000, 2011 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 API and implementation
10 *******************************************************************************/
11package org.eclipse.jdt.internal.ui.workingsets;
12
13import org.eclipse.swt.widgets.Shell;
14
15import org.eclipse.jface.action.Action;
16
17import org.eclipse.ui.IWorkbenchPartSite;
18import org.eclipse.ui.PlatformUI;
19
20import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
21import org.eclipse.jdt.internal.ui.JavaPlugin;
22
23/**
24 * Displays an IWorkingSetEditWizard for editing a working set.
25 *
26 * @since 2.1
27 */
28public class EditWorkingSetAction extends Action {
29 private IWorkbenchPartSite fSite;
30 private Shell fShell;
31 WorkingSetFilterActionGroup fActionGroup;
32
33 public EditWorkingSetAction(WorkingSetFilterActionGroup actionGroup, IWorkbenchPartSite site) {
34 this(actionGroup);
35 fSite= site;
36 }
37
38 public EditWorkingSetAction(WorkingSetFilterActionGroup actionGroup, Shell shell) {
39 this(actionGroup);
40 fShell= shell;
41 }
42
43 private EditWorkingSetAction(WorkingSetFilterActionGroup actionGroup) {
44 super(WorkingSetMessages.EditWorkingSetAction_text);
45 actionGroup.generated_5170808443770517083(this);
46 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.EDIT_WORKING_SET_ACTION);
47 }
48
49 /*
50 * Overrides method from Action
51 */
52 @Override
53 public void run() {
54 fActionGroup.generated_4954213448617810227(this);
55 }
56
57 Shell getShell() {
58 if (fSite != null) {
59 return fSite.getShell();
60 } else if (fShell != null) {
61 return fShell;
62 } else {
63 return JavaPlugin.getActiveWorkbenchShell();
64 }
65 }
66}