~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewAction.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.cdt.internal.ui.cview;
12
 
 
13
 
import org.eclipse.cdt.ui.CUIPlugin;
14
 
import org.eclipse.jface.viewers.Viewer;
15
 
import org.eclipse.swt.widgets.Shell;
16
 
import org.eclipse.ui.IWorkbench;
17
 
import org.eclipse.ui.IWorkbenchWindow;
18
 
import org.eclipse.ui.actions.SelectionProviderAction;
19
 
 
20
 
/**
21
 
 * Superclass of all actions provided by the cview.
22
 
 */
23
 
public abstract class CViewAction extends SelectionProviderAction {
24
 
        
25
 
        private CView cview;
26
 
 
27
 
        /**
28
 
         * Creates a new instance of the class.
29
 
         */
30
 
        public CViewAction(CView cview, String label) {
31
 
                super(cview.getViewer(), label);
32
 
                this.cview = cview;
33
 
        }
34
 
 
35
 
        /**
36
 
         * Returns the cview for which this action was created.
37
 
         */
38
 
        public CView getCView() {
39
 
                return cview;
40
 
        }
41
 
 
42
 
        /**
43
 
         * Returns the viewer
44
 
         */
45
 
        protected Viewer getViewer() {
46
 
                return getCView().getViewer();
47
 
        }
48
 
 
49
 
        /**
50
 
         * Returns the shell to use within actions.
51
 
         */
52
 
        protected Shell getShell() {
53
 
                return getCView().getSite().getShell();
54
 
        }
55
 
 
56
 
        /**
57
 
         * Returns the workbench.
58
 
         */
59
 
        protected IWorkbench getWorkbench() {
60
 
                return CUIPlugin.getDefault().getWorkbench();
61
 
        }
62
 
 
63
 
        /**
64
 
         * Returns the workbench window.
65
 
         */
66
 
        protected IWorkbenchWindow getWorkbenchWindow() {
67
 
                return getCView().getSite().getWorkbenchWindow();
68
 
        }
69
 
}