]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/actions/GenerateJavadocAction.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / actions / GenerateJavadocAction.java
CommitLineData
1b2798f6
EK
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 *******************************************************************************/
11package org.eclipse.jdt.internal.ui.actions;
12
13import org.eclipse.swt.widgets.Shell;
14
15import org.eclipse.jface.action.IAction;
16import org.eclipse.jface.viewers.ISelection;
17import org.eclipse.jface.viewers.IStructuredSelection;
18import org.eclipse.jface.viewers.StructuredSelection;
19
20import org.eclipse.ui.IWorkbenchWindow;
21import org.eclipse.ui.IWorkbenchWindowActionDelegate;
22
23import org.eclipse.jdt.internal.ui.javadocexport.JavadocWizard;
24
25public class GenerateJavadocAction implements IWorkbenchWindowActionDelegate {
26
27 private ISelection fSelection;
28 private Shell fCurrentShell;
29
30 public void dispose() {
31 }
32
33 public void init(IWorkbenchWindow window) {
34 fCurrentShell= window.getShell();
35 }
36
37 public void run(IAction action) {
38 JavadocWizard wizard= new JavadocWizard();
39 IStructuredSelection selection= null;
40 if (fSelection instanceof IStructuredSelection) {
41 selection= (IStructuredSelection)fSelection;
42 } else {
43 selection= new StructuredSelection();
44 }
45 JavadocWizard.openJavadocWizard(wizard, fCurrentShell, selection);
46 }
47
48 public void selectionChanged(IAction action, ISelection selection) {
49 fSelection= selection;
50 }
51}