]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-before/ui/org/eclipse/jdt/internal/ui/wizards/OpenJavaProjectWizardToolbarAction.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui / org / eclipse / jdt / internal / ui / wizards / OpenJavaProjectWizardToolbarAction.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.wizards;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.jface.viewers.StructuredSelection;
17
18 import org.eclipse.ui.IWorkbenchWindow;
19 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
20
21 import org.eclipse.jdt.ui.actions.OpenNewJavaProjectWizardAction;
22
23 public class OpenJavaProjectWizardToolbarAction extends OpenNewJavaProjectWizardAction implements IWorkbenchWindowActionDelegate  {
24
25         public OpenJavaProjectWizardToolbarAction() {
26         }
27
28         /* (non-Javadoc)
29          * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
30          */
31         public void dispose() {
32         }
33
34         /* (non-Javadoc)
35          * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
36          */
37         public void init(IWorkbenchWindow window) {
38                 setShell(window.getShell());
39         }
40
41         /* (non-Javadoc)
42          * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
43          */
44         public void run(IAction action) {
45                 super.run();
46         }
47
48         /* (non-Javadoc)
49          * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
50          */
51         public void selectionChanged(IAction action, ISelection selection) {
52                 if (selection instanceof IStructuredSelection) {
53                         setSelection((IStructuredSelection) selection);
54                 } else {
55                         setSelection(StructuredSelection.EMPTY);
56                 }
57         }
58 }