/** * Creates a new <code>DeclarationsSearchGroup</code>. The group requires * that the selection provided by the site's selection provider is of type <code> * IStructuredSelection</code>. * * @param site the workbench site that owns this action group */ public DeclarationsSearchGroup(IWorkbenchSite site) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindDeclarationsAction= new FindDeclarationsAction(site); fFindDeclarationsAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKSPACE); fFindDeclarationsInProjectAction= new FindDeclarationsInProjectAction(site); fFindDeclarationsInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_PROJECTS); fFindDeclarationsInHierarchyAction= new FindDeclarationsInHierarchyAction(site); fFindDeclarationsInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_HIERARCHY); fFindDeclarationsInWorkingSetAction= new FindDeclarationsInWorkingSetAction(site); fFindDeclarationsInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= fSite.getSelectionProvider(); ISelection selection= provider.getSelection(); registerAction(fFindDeclarationsAction, provider, selection); registerAction(fFindDeclarationsInProjectAction, provider, selection); registerAction(fFindDeclarationsInHierarchyAction, provider, selection); registerAction(fFindDeclarationsInWorkingSetAction, provider, selection); }
/** * Creates a new <code>DeclarationsSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public DeclarationsSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindDeclarationsAction= new FindDeclarationsAction(site); fFindDeclarationsAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKSPACE); fFindDeclarationsInProjectAction= new FindDeclarationsInProjectAction(site); fFindDeclarationsInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_PROJECTS); fFindDeclarationsInHierarchyAction= new FindDeclarationsInHierarchyAction(site); fFindDeclarationsInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_HIERARCHY); fFindDeclarationsInWorkingSetAction= new FindDeclarationsInWorkingSetAction(site); fFindDeclarationsInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindDeclarationsAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInHierarchyAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInWorkingSetAction, provider, selection, specialSelectionProvider); }
/** * Creates a new <code>DeclarationsSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public DeclarationsSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindDeclarationsAction= new FindDeclarationsAction(site); fFindDeclarationsAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKSPACE); fFindDeclarationsInProjectAction= new FindDeclarationsInProjectAction(site); fFindDeclarationsInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_PROJECTS); fFindDeclarationsInHierarchyAction= new FindDeclarationsInHierarchyAction(site); fFindDeclarationsInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_HIERARCHY); fFindDeclarationsInWorkingSetAction= new FindDeclarationsInWorkingSetAction(site); fFindDeclarationsInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindDeclarationsAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInHierarchyAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInWorkingSetAction, provider, selection, specialSelectionProvider); }