KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > callhierarchy > SearchScopeWorkingSetAction


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  * Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation
10  * (report 36180: Callers/Callees view)
11  * Michael Fraenkel (fraenkel@us.ibm.com) - patch
12  * (report 60714: Call Hierarchy: display search scope in view title)
13  *******************************************************************************/

14 package org.eclipse.jdt.internal.ui.callhierarchy;
15
16 import org.eclipse.ui.IWorkingSet;
17 import org.eclipse.ui.PlatformUI;
18
19 import org.eclipse.jdt.core.search.IJavaSearchScope;
20
21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
22 import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
23
24
25 class SearchScopeWorkingSetAction extends SearchScopeAction {
26     private IWorkingSet[] fWorkingSets;
27     
28     public SearchScopeWorkingSetAction(SearchScopeActionGroup group, IWorkingSet[] workingSets, String JavaDoc name) {
29         super(group, name);
30         setToolTipText(CallHierarchyMessages.SearchScopeActionGroup_workingset_tooltip);
31         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_SEARCH_SCOPE_ACTION);
32         
33         this.fWorkingSets = workingSets;
34     }
35     
36     public IJavaSearchScope getSearchScope() {
37         return JavaSearchScopeFactory.getInstance().createJavaSearchScope(fWorkingSets, true);
38     }
39     
40     /**
41      *
42      */

43     public IWorkingSet[] getWorkingSets() {
44         return fWorkingSets;
45     }
46     
47     /* (non-Javadoc)
48      * @see org.eclipse.jdt.internal.ui.callhierarchy.SearchScopeActionGroup.SearchScopeAction#getSearchScopeType()
49      */

50     public int getSearchScopeType() {
51         return SearchScopeActionGroup.SEARCH_SCOPE_TYPE_WORKING_SET;
52     }
53
54     /* (non-Javadoc)
55      * @see org.eclipse.jdt.internal.ui.callhierarchy.SearchScopeAction#getFullDescription()
56      */

57     public String JavaDoc getFullDescription() {
58         return JavaSearchScopeFactory.getInstance().getWorkingSetScopeDescription(fWorkingSets, true);
59     }
60 }
61
Popular Tags