mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
F3 for OutlineView, Call Hierarchy and Type Hierarchy, bug 222721.
This commit is contained in:
parent
f66dfa5d9a
commit
e5b6fb457b
9 changed files with 97 additions and 43 deletions
|
@ -336,6 +336,8 @@ OpenTypeHierarchyAction.label=Open Type Hie&rarchy
|
|||
OpenTypeHierarchyAction.tooltip=Opens a Type Hierarchy for the Selected Element
|
||||
ViewCommand.typeHierarchy.name= C Type Hierarchy
|
||||
ViewCommand.typeHierarchy.description= Show the Type Hierarchy view
|
||||
OpenDeclarationAction.label=&Open Declaration
|
||||
OpenDeclarationAction.tooltip=Open an editor on the selected element's declaration
|
||||
|
||||
# hovering contribution
|
||||
CEditorTextHoversName=C Editor Text Hovers
|
||||
|
|
|
@ -1233,10 +1233,19 @@
|
|||
<action
|
||||
definitionId="org.eclipse.cdt.ui.edit.open.type.hierarchy"
|
||||
label="%OpenTypeHierarchyAction.label"
|
||||
tooltip="%OpenTypeHierarchyAction.tooltip"
|
||||
retarget="true"
|
||||
menubarPath="navigate/open.ext"
|
||||
id="org.eclipse.cdt.ui.actions.OpenTypeHierarchy">
|
||||
</action>
|
||||
<action
|
||||
definitionId="org.eclipse.cdt.ui.edit.opendecl"
|
||||
label="%OpenDeclarationAction.label"
|
||||
tooltip="%OpenDeclarationAction.tooltip"
|
||||
retarget="true"
|
||||
menubarPath="navigate/open.ext"
|
||||
id="org.eclipse.cdt.ui.actions.OpenDeclaration">
|
||||
</action>
|
||||
</actionSet>
|
||||
<actionSet
|
||||
description="%BuildConfigurationActionSet.descr"
|
||||
|
@ -1802,34 +1811,28 @@
|
|||
|
||||
<extension
|
||||
point="org.eclipse.ui.actionSetPartAssociations">
|
||||
<actionSetPartAssociation
|
||||
<actionSetPartAssociation
|
||||
targetID="org.eclipse.cdt.ui.SearchActionSet">
|
||||
<part
|
||||
id="org.eclipse.cdt.ui.CView">
|
||||
</part>
|
||||
<part
|
||||
id="org.eclipse.cdt.ui.editor.CEditor">
|
||||
</part>
|
||||
<part
|
||||
id="org.eclipse.search.SearchResultView">
|
||||
</part>
|
||||
<part id="org.eclipse.cdt.ui.CView"/>
|
||||
<part id="org.eclipse.cdt.ui.editor.CEditor"/>
|
||||
<part id="org.eclipse.search.SearchResultView"/>
|
||||
</actionSetPartAssociation>
|
||||
<actionSetPartAssociation targetID="org.eclipse.cdt.ui.CodingActionSet">
|
||||
<actionSetPartAssociation
|
||||
targetID="org.eclipse.cdt.ui.CodingActionSet">
|
||||
<part id="org.eclipse.cdt.ui.editor.CEditor"/>
|
||||
<part id="org.eclipse.cdt.ui.CView"/>
|
||||
</actionSetPartAssociation>
|
||||
|
||||
<actionSetPartAssociation
|
||||
targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
|
||||
<part
|
||||
id="org.eclipse.cdt.ui.editor.CEditor">
|
||||
</part>
|
||||
<part id="org.eclipse.cdt.ui.editor.CEditor"/>
|
||||
</actionSetPartAssociation>
|
||||
<actionSetPartAssociation
|
||||
targetID="org.eclipse.cdt.ui.text.c.actionSet.presentation">
|
||||
<part
|
||||
id="org.eclipse.cdt.ui.editor.CEditor">
|
||||
</part>
|
||||
<part id="org.eclipse.cdt.ui.editor.CEditor"/>
|
||||
</actionSetPartAssociation>
|
||||
<actionSetPartAssociation
|
||||
targetID="org.eclipse.cdt.ui.OpenActionSet">
|
||||
<part id="org.eclipse.cdt.ui.editor.CEditor"/>
|
||||
</actionSetPartAssociation>
|
||||
</extension>
|
||||
<extension
|
||||
|
|
|
@ -64,11 +64,13 @@ import org.eclipse.cdt.core.model.IMethod;
|
|||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.core.model.util.CElementBaseLabels;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.actions.CdtActionConstants;
|
||||
import org.eclipse.cdt.ui.actions.OpenViewActionGroup;
|
||||
import org.eclipse.cdt.ui.refactoring.actions.CRefactoringActionGroup;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup;
|
||||
import org.eclipse.cdt.internal.ui.util.CoreUtility;
|
||||
import org.eclipse.cdt.internal.ui.util.Messages;
|
||||
|
@ -445,6 +447,7 @@ public class CHViewPart extends ViewPart {
|
|||
}
|
||||
};
|
||||
fOpenElement.setToolTipText(CHMessages.CHViewPart_Open_tooltip);
|
||||
fOpenElement.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
|
||||
fShowFilesInLabelsAction= new Action(CHMessages.CHViewPart_ShowFiles_label, IAction.AS_CHECK_BOX) {
|
||||
@Override
|
||||
|
@ -489,6 +492,7 @@ public class CHViewPart extends ViewPart {
|
|||
fOpenViewActionGroup.fillActionBars(actionBars);
|
||||
fSelectionSearchGroup.fillActionBars(actionBars);
|
||||
|
||||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_DECLARATION, fOpenElement);
|
||||
actionBars.setGlobalActionHandler(ActionFactory.NEXT.getId(), fNextAction);
|
||||
actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAction);
|
||||
actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fRefreshAction);
|
||||
|
@ -585,7 +589,7 @@ public class CHViewPart extends ViewPart {
|
|||
try {
|
||||
EditorOpener.open(page, elem);
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -744,7 +748,7 @@ public class CHViewPart extends ViewPart {
|
|||
try {
|
||||
EditorOpener.open(page, fNavigationNode.getRepresentedDeclaration());
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CContentOutlinePage extends AbstractCModelOutlinePage {
|
|||
|
||||
@Override
|
||||
protected OpenViewActionGroup createOpenViewActionGroup() {
|
||||
OpenViewActionGroup ovag= new OpenViewActionGroup(this);
|
||||
OpenViewActionGroup ovag= new OpenViewActionGroup(this, getEditor());
|
||||
ovag.setEnableIncludeBrowser(true);
|
||||
return ovag;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,6 @@ import org.eclipse.cdt.internal.ui.dnd.TextEditorDropAdapter;
|
|||
import org.eclipse.cdt.internal.ui.dnd.TextViewerDragAdapter;
|
||||
import org.eclipse.cdt.internal.ui.search.OccurrencesFinder;
|
||||
import org.eclipse.cdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup;
|
||||
import org.eclipse.cdt.internal.ui.text.CHeuristicScanner;
|
||||
import org.eclipse.cdt.internal.ui.text.CPairMatcher;
|
||||
|
@ -2065,10 +2064,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
|||
setAction("ContentAssistContextInformation", action); //$NON-NLS-1$
|
||||
markAsStateDependentAction("ContentAssistContextInformation", true); //$NON-NLS-1$
|
||||
|
||||
action = new OpenDeclarationsAction(this);
|
||||
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
setAction("OpenDeclarations", action); //$NON-NLS-1$
|
||||
|
||||
action = new TextOperationAction(CEditorMessages.getResourceBundle(), "OpenOutline.", this, CSourceViewer.SHOW_OUTLINE, true); //$NON-NLS-1$
|
||||
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_OUTLINE);
|
||||
setAction("OpenOutline", action); //$NON-NLS-1$*/
|
||||
|
|
|
@ -38,7 +38,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
private RetargetTextEditorAction fContextInformation;
|
||||
private RetargetTextEditorAction fFormatter;
|
||||
private RetargetTextEditorAction fAddInclude;
|
||||
private RetargetTextEditorAction fOpenDeclaration;
|
||||
private RetargetTextEditorAction fShiftLeft;
|
||||
private RetargetTextEditorAction fShiftRight;
|
||||
private TogglePresentationAction fTogglePresentation;
|
||||
|
@ -77,9 +76,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
fAddInclude = new RetargetTextEditorAction(bundle, "AddIncludeOnSelection."); //$NON-NLS-1$
|
||||
fAddInclude.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_INCLUDE);
|
||||
|
||||
fOpenDeclaration = new RetargetTextEditorAction(bundle, "OpenDeclarations."); //$NON-NLS-1$
|
||||
fOpenDeclaration.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
|
||||
// actions that are "contributed" to editors, they are considered belonging to the active editor
|
||||
fTogglePresentation= new TogglePresentationAction();
|
||||
|
||||
|
@ -110,6 +106,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
/*
|
||||
* @see org.eclipse.ui.texteditor.BasicTextEditorActionContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
|
||||
*/
|
||||
@Override
|
||||
public void contributeToMenu(IMenuManager menu) {
|
||||
|
||||
super.contributeToMenu(menu);
|
||||
|
@ -131,7 +128,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
|
||||
IMenuManager navigateMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
|
||||
if (navigateMenu != null) {
|
||||
navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fOpenDeclaration);
|
||||
navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT, fToggleSourceHeader);
|
||||
|
||||
navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fShowOutline);
|
||||
|
@ -150,6 +146,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
/**
|
||||
* @see org.eclipse.ui.part.EditorActionBarContributor#init(IActionBars)
|
||||
*/
|
||||
@Override
|
||||
public void init(IActionBars bars) {
|
||||
super.init(bars);
|
||||
|
||||
|
@ -165,6 +162,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
/*
|
||||
* @see org.eclipse.ui.editors.text.TextEditorActionContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
|
||||
*/
|
||||
@Override
|
||||
public void setActiveEditor(IEditorPart part) {
|
||||
|
||||
super.setActiveEditor(part);
|
||||
|
@ -184,7 +182,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
fContentAssist.setAction(getAction(textEditor, "ContentAssistProposal")); //$NON-NLS-1$
|
||||
fContextInformation.setAction(getAction(textEditor, "ContentAssistContextInformation")); //$NON-NLS-1$
|
||||
fAddInclude.setAction(getAction(textEditor, "AddIncludeOnSelection")); //$NON-NLS-1$
|
||||
fOpenDeclaration.setAction(getAction(textEditor, "OpenDeclarations")); //$NON-NLS-1$
|
||||
fFormatter.setAction(getAction(textEditor, "Format")); //$NON-NLS-1$
|
||||
|
||||
fGotoMatchingBracket.setAction(getAction(textEditor, GotoMatchingBracketAction.GOTO_MATCHING_BRACKET));
|
||||
|
@ -205,6 +202,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.ui.IEditorActionBarContributor#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
setActiveEditor(null);
|
||||
super.dispose();
|
||||
|
|
|
@ -79,11 +79,13 @@ import org.eclipse.cdt.core.model.IMethodDeclaration;
|
|||
import org.eclipse.cdt.core.model.util.CElementBaseLabels;
|
||||
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.actions.CdtActionConstants;
|
||||
import org.eclipse.cdt.ui.actions.OpenViewActionGroup;
|
||||
import org.eclipse.cdt.ui.refactoring.actions.CRefactoringActionGroup;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.SelectionSearchGroup;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.AdaptingSelectionProvider;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider;
|
||||
|
@ -461,7 +463,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
if (md.isConstructor()) return 2;
|
||||
if (md.isDestructor()) return 3;
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -650,7 +652,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
try {
|
||||
return !node.isStatic();
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -664,7 +666,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
try {
|
||||
return ASTAccessVisibility.PUBLIC.equals(node.getVisibility());
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -719,6 +721,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
}
|
||||
};
|
||||
fOpenElement.setToolTipText(Messages.THViewPart_Open_tooltip);
|
||||
fOpenElement.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
|
||||
fShowFilesInLabelsAction= new Action(Messages.THViewPart_ShowFileNames, IAction.AS_CHECK_BOX) {
|
||||
@Override
|
||||
|
@ -755,6 +758,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
fOpenViewActionGroup.fillActionBars(actionBars);
|
||||
fSelectionSearchGroup.fillActionBars(actionBars);
|
||||
|
||||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_DECLARATION, fOpenElement);
|
||||
actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fRefreshAction);
|
||||
actionBars.updateActionBars();
|
||||
|
||||
|
@ -806,7 +810,7 @@ public class THViewPart extends ViewPart implements ITHModelPresenter {
|
|||
try {
|
||||
EditorOpener.open(page, elem);
|
||||
} catch (CModelException e) {
|
||||
CUIPlugin.getDefault().log(e);
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -36,6 +36,13 @@ public class CdtActionConstants {
|
|||
*/
|
||||
public static final String OPEN_SUPER_IMPLEMENTATION= "org.eclipse.cdt.ui.actions.OpenSuperImplementation"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Navigate menu: name of standard Open Declaration global action
|
||||
* (value <code>"org.eclipse.cdt.ui.actions.OpenDeclaration"</code>).
|
||||
* @since 5.0
|
||||
*/
|
||||
public static final String OPEN_DECLARATION= "org.eclipse.cdt.ui.actions.OpenDeclaration"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Navigate menu: name of standard Open Type Hierarchy global action
|
||||
* (value <code>"org.eclipse.cdt.ui.actions.OpenTypeHierarchy"</code>).
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -28,11 +28,14 @@ import org.eclipse.ui.part.Page;
|
|||
import org.eclipse.ui.texteditor.ITextEditor;
|
||||
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.IInclude;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||
import org.eclipse.cdt.internal.ui.callhierarchy.OpenCallHierarchyAction;
|
||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||
import org.eclipse.cdt.internal.ui.editor.ICEditorActionDefinitionIds;
|
||||
import org.eclipse.cdt.internal.ui.includebrowser.OpenIncludeBrowserAction;
|
||||
import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
|
||||
import org.eclipse.cdt.internal.ui.typehierarchy.OpenTypeHierarchyAction;
|
||||
|
||||
/**
|
||||
|
@ -52,6 +55,7 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
private boolean fSuppressCallHierarchy;
|
||||
private boolean fSuppressProperties;
|
||||
private boolean fEnableIncludeBrowser;
|
||||
|
||||
private IWorkbenchSite fSite;
|
||||
private String fGroupName= IContextMenuConstants.GROUP_OPEN;
|
||||
|
||||
|
@ -61,6 +65,7 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
private PropertyDialogAction fOpenPropertiesDialog;
|
||||
private OpenCallHierarchyAction fOpenCallHierarchy;
|
||||
private OpenIncludeBrowserAction fOpenIncludeBrowser;
|
||||
private OpenDeclarationsAction fOpenDeclaration;
|
||||
|
||||
/**
|
||||
* Creates a new <code>OpenActionGroup</code>. The group requires
|
||||
|
@ -70,9 +75,20 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
* @param page the page that owns this action group
|
||||
*/
|
||||
public OpenViewActionGroup(Page page) {
|
||||
createSiteActions(page.getSite());
|
||||
createSiteActions(page.getSite(), null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new <code>OpenActionGroup</code>. The group requires
|
||||
* that the selection provided by the page's selection provider is of type <code>
|
||||
* org.eclipse.jface.viewers.IStructuredSelection</code>.
|
||||
*
|
||||
* @param page the page that owns this action group
|
||||
*/
|
||||
public OpenViewActionGroup(Page page, CEditor editor) {
|
||||
createSiteActions(page.getSite(), editor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>OpenActionGroup</code>. The group requires
|
||||
* that the selection provided by the part's selection provider is of type <code>
|
||||
|
@ -81,7 +97,7 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
* @param part the view part that owns this action group
|
||||
*/
|
||||
public OpenViewActionGroup(IWorkbenchPart part) {
|
||||
createSiteActions(part.getSite());
|
||||
createSiteActions(part.getSite(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,11 +125,17 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
fOpenIncludeBrowser= new OpenIncludeBrowserAction(part);
|
||||
fOpenIncludeBrowser.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_INCLUDE_BROWSER);
|
||||
part.setAction("OpenIncludeBrowser", fOpenIncludeBrowser); //$NON-NLS-1$
|
||||
|
||||
if (part instanceof CEditor) {
|
||||
fOpenDeclaration= new OpenDeclarationsAction((CEditor) part);
|
||||
fOpenDeclaration.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
part.setAction("OpenDeclarations", fOpenDeclaration); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
initialize(part.getEditorSite());
|
||||
}
|
||||
|
||||
private void createSiteActions(IWorkbenchSite site) {
|
||||
private void createSiteActions(IWorkbenchSite site, CEditor editor) {
|
||||
// fOpenSuperImplementation= new OpenSuperImplementationAction(site);
|
||||
// fOpenSuperImplementation.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_SUPER_IMPLEMENTATION);
|
||||
//
|
||||
|
@ -129,6 +151,11 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
fOpenIncludeBrowser= new OpenIncludeBrowserAction(site);
|
||||
fOpenIncludeBrowser.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_INCLUDE_BROWSER);
|
||||
|
||||
if (editor != null) {
|
||||
fOpenDeclaration= new OpenDeclarationsAction(editor);
|
||||
fOpenDeclaration.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
|
||||
}
|
||||
|
||||
fOpenPropertiesDialog= new PropertyDialogAction(site, site.getSelectionProvider());
|
||||
fOpenPropertiesDialog.setActionDefinitionId("org.eclipse.ui.file.properties"); //$NON-NLS-1$
|
||||
|
||||
|
@ -163,6 +190,7 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in ActionGroup
|
||||
*/
|
||||
@Override
|
||||
public void fillActionBars(IActionBars actionBar) {
|
||||
super.fillActionBars(actionBar);
|
||||
setGlobalActionHandlers(actionBar);
|
||||
|
@ -171,9 +199,19 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
/* (non-Javadoc)
|
||||
* Method declared in ActionGroup
|
||||
*/
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
super.fillContextMenu(menu);
|
||||
IStructuredSelection selection= getStructuredSelection();
|
||||
if (!fEditorIsOwner) {
|
||||
if (fOpenDeclaration != null && fOpenDeclaration.isEnabled()) {
|
||||
if (selection != null) {
|
||||
Object elem= selection.getFirstElement();
|
||||
if (elem instanceof ICElement && elem instanceof IInclude == false) {
|
||||
menu.appendToGroup(fGroupName, fOpenDeclaration);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!fSuppressTypeHierarchy && fOpenTypeHierarchy.isEnabled()) {
|
||||
menu.appendToGroup(fGroupName, fOpenTypeHierarchy);
|
||||
}
|
||||
|
@ -185,7 +223,6 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
}
|
||||
}
|
||||
// appendToGroup(menu, fOpenSuperImplementation);
|
||||
IStructuredSelection selection= getStructuredSelection();
|
||||
if (!fSuppressProperties) {
|
||||
if (fOpenPropertiesDialog != null && fOpenPropertiesDialog.isEnabled() && selection != null &&fOpenPropertiesDialog.isApplicableForSelection(selection)) {
|
||||
menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fOpenPropertiesDialog);
|
||||
|
@ -196,6 +233,7 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
/*
|
||||
* @see ActionGroup#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
ISelectionProvider provider= fSite.getSelectionProvider();
|
||||
// provider.removeSelectionChangedListener(fOpenSuperImplementation);
|
||||
|
@ -215,6 +253,9 @@ public class OpenViewActionGroup extends ActionGroup {
|
|||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_TYPE_HIERARCHY, fOpenTypeHierarchy);
|
||||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_CALL_HIERARCHY, fOpenCallHierarchy);
|
||||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_INCLUDE_BROWSER, fOpenIncludeBrowser);
|
||||
if (fOpenDeclaration != null) {
|
||||
actionBars.setGlobalActionHandler(CdtActionConstants.OPEN_DECLARATION, fOpenDeclaration);
|
||||
}
|
||||
if (fOpenPropertiesDialog != null) {
|
||||
actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), fOpenPropertiesDialog);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue