KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > actions > NewRepositoryAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.team.internal.ccvs.ui.actions;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.jface.wizard.WizardDialog;
16 import org.eclipse.swt.widgets.Shell;
17 import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard;
18 import org.eclipse.ui.*;
19 import org.eclipse.ui.IWorkbenchWindow;
20 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
21
22 public class NewRepositoryAction implements IWorkbenchWindowActionDelegate, IViewActionDelegate {
23     Shell shell;
24     
25     /**
26      * @see IWorkbenchWindowActionDelegate#dispose()
27      */

28     public void dispose() {
29     }
30
31     /**
32      * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
33      */

34     public void init(IWorkbenchWindow window) {
35         this.shell = window.getShell();
36     }
37     
38     public void init(IViewPart view) {
39         shell = view.getSite().getShell();
40     }
41
42     /**
43      * @see IActionDelegate#run(IAction)
44      */

45     public void run(IAction action) {
46         NewLocationWizard wizard = new NewLocationWizard();
47         wizard.setSwitchPerspectives(false);
48         WizardDialog dialog = new WizardDialog(shell, wizard);
49         dialog.open();
50     }
51
52     /**
53      * @see IActionDelegate#selectionChanged(IAction, ISelection)
54      */

55     public void selectionChanged(IAction action, ISelection selection) {
56     }
57 }
58
Popular Tags