View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: PluginUpdateAction.java
13   * Created: 2007-00-00
14   * Author: cast
15   * $Id: PluginUpdateAction.java 2300 2009-01-12 17:24:04Z tmilos $
16   */
17  
18  package pl.edu.agh.cast.action;
19  
20  import org.eclipse.jface.action.IAction;
21  import org.eclipse.jface.viewers.ISelection;
22  import org.eclipse.ui.IWorkbenchWindow;
23  import org.eclipse.ui.IWorkbenchWindowActionDelegate;
24  import org.eclipse.update.ui.UpdateManagerUI;
25  
26  /**
27   * Action for opening install wizard.
28   *
29   * @author AGH CAST Team
30   */
31  public class PluginUpdateAction implements IWorkbenchWindowActionDelegate {
32  
33  	private IWorkbenchWindow window;
34  
35  	/**
36  	 * {@inheritDoc}
37  	 *
38  	 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
39  	 */
40  	public void dispose() {
41  		window = null;
42  	}
43  
44  	/**
45  	 * {@inheritDoc}
46  	 *
47  	 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
48  	 */
49  	public void init(IWorkbenchWindow win) {
50  		this.window = win;
51  	}
52  
53  	/**
54  	 * {@inheritDoc}
55  	 *
56  	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
57  	 */
58  	public void run(IAction action) {
59  		UpdateManagerUI.openInstaller(window.getShell());
60  	}
61  
62  	/**
63  	 * {@inheritDoc}
64  	 *
65  	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
66  	 *      org.eclipse.jface.viewers.ISelection)
67  	 */
68  	public void selectionChanged(IAction action, ISelection selection) {
69  	}
70  
71  }