]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-before/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/actions/ApplyRefactoringScriptAction.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / ui refactoring / org / eclipse / jdt / internal / ui / refactoring / actions / ApplyRefactoringScriptAction.java
1 /*******************************************************************************
2  * Copyright (c) 2005, 2008 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.refactoring.actions;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15
16 import org.eclipse.ui.IWorkbenchWindow;
17 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
18
19 /**
20  * Action to apply a refactoring script to the workspace.
21  *
22  * TODO: remove once bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=131746 is fixed
23  */
24 public final class ApplyRefactoringScriptAction implements IWorkbenchWindowActionDelegate {
25
26         /** The workbench window, or <code>null</code> */
27         private IWorkbenchWindow fWindow= null;
28
29         /**
30          * {@inheritDoc}
31          */
32         public void dispose() {
33                 // Do nothing
34         }
35
36         /**
37          * {@inheritDoc}
38          */
39         public void init(final IWorkbenchWindow window) {
40                 fWindow= window;
41         }
42
43         /**
44          * {@inheritDoc}
45          */
46         public void run(final IAction a) {
47                 if (fWindow != null) {
48                         org.eclipse.ltk.ui.refactoring.actions.ApplyRefactoringScriptAction action= new org.eclipse.ltk.ui.refactoring.actions.ApplyRefactoringScriptAction();
49                         action.init(fWindow);
50                         action.run(a);
51                 }
52         }
53
54         /**
55          * {@inheritDoc}
56          */
57         public void selectionChanged(final IAction action, final ISelection selection) {
58                 // Do nothing
59         }
60 }