KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > refactoring > RenamePluginAction


1 /*******************************************************************************
2  * Copyright (c) 2007 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.pde.internal.ui.refactoring;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
15 import org.eclipse.pde.core.plugin.IPluginModelBase;
16 import org.eclipse.pde.internal.ui.PDEUIMessages;
17 import org.eclipse.swt.widgets.Shell;
18 import org.eclipse.ui.PlatformUI;
19
20 public class RenamePluginAction extends Action {
21     
22     private RenamePluginInfo fInfo = new RenamePluginInfo();
23     
24     public RenamePluginAction() {
25         super(PDEUIMessages.RenamePluginAction_label);
26     }
27     
28     public void setPlugin(IPluginModelBase base) {
29         fInfo.setBase(base);
30     }
31
32     public void run() {
33         RenamePluginProcessor processor = new RenamePluginProcessor(fInfo);
34         RenamePluginRefactor refactor = new RenamePluginRefactor(processor);
35         RenamePluginWizard wizard = new RenamePluginWizard(refactor, fInfo);
36         RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation( wizard );
37         
38         try {
39           op.run( getShell(), "" ); //$NON-NLS-1$
40
} catch( final InterruptedException JavaDoc irex ) {
41         }
42     }
43     
44     private Shell getShell() {
45         return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
46     }
47
48 }
49
Popular Tags