01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.refactoring;
11:
12: import org.eclipse.jface.action.Action;
13: import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
14: import org.eclipse.pde.core.plugin.IPluginModelBase;
15: import org.eclipse.pde.internal.ui.PDEUIMessages;
16: import org.eclipse.swt.widgets.Shell;
17: import org.eclipse.ui.PlatformUI;
18:
19: public class RenamePluginAction extends Action {
20:
21: private RenamePluginInfo fInfo = new RenamePluginInfo();
22:
23: public RenamePluginAction() {
24: super (PDEUIMessages.RenamePluginAction_label);
25: }
26:
27: public void setPlugin(IPluginModelBase base) {
28: fInfo.setBase(base);
29: }
30:
31: public void run() {
32: RenamePluginProcessor processor = new RenamePluginProcessor(
33: fInfo);
34: PDERefactor refactor = new PDERefactor(processor);
35: RenamePluginWizard wizard = new RenamePluginWizard(refactor,
36: fInfo);
37: RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(
38: wizard);
39:
40: try {
41: op.run(getShell(), ""); //$NON-NLS-1$
42: } catch (final InterruptedException irex) {
43: }
44: }
45:
46: private Shell getShell() {
47: return PlatformUI.getWorkbench().getActiveWorkbenchWindow()
48: .getShell();
49: }
50:
51: }
|