KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > search > NewSearchViewActionGroup


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.jdt.internal.ui.search;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.jface.viewers.OpenEvent;
17
18 import org.eclipse.ui.IViewPart;
19 import org.eclipse.ui.actions.ActionGroup;
20
21 import org.eclipse.jdt.ui.actions.GenerateActionGroup;
22 import org.eclipse.jdt.ui.actions.JavaSearchActionGroup;
23 import org.eclipse.jdt.ui.actions.OpenEditorActionGroup;
24 import org.eclipse.jdt.ui.actions.OpenViewActionGroup;
25 import org.eclipse.jdt.ui.actions.RefactorActionGroup;
26
27 import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup;
28
29 class NewSearchViewActionGroup extends CompositeActionGroup {
30     private OpenEditorActionGroup fOpenEditorActionGroup;
31     
32     public NewSearchViewActionGroup(IViewPart part) {
33         Assert.isNotNull(part);
34         OpenViewActionGroup openViewActionGroup;
35         setGroups(new ActionGroup[]{
36             fOpenEditorActionGroup= new OpenEditorActionGroup(part),
37             openViewActionGroup= new OpenViewActionGroup(part),
38             new GenerateActionGroup(part),
39             new RefactorActionGroup(part),
40             new JavaSearchActionGroup(part)
41         });
42         openViewActionGroup.containsShowInMenu(false);
43     }
44     
45     public void handleOpen(OpenEvent event) {
46         IAction openAction= fOpenEditorActionGroup.getOpenAction();
47         if (openAction != null && openAction.isEnabled()) {
48             openAction.run();
49             return;
50         }
51     }
52 }
53
54
Popular Tags