1 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 |