mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Type Hierarchy: adds command-id and kbd-shortcut
This commit is contained in:
parent
25dfcccfb3
commit
c2f52f81de
5 changed files with 15 additions and 17 deletions
|
@ -965,11 +965,11 @@
|
||||||
sequence="M1+G"
|
sequence="M1+G"
|
||||||
contextId="org.eclipse.cdt.ui.cEditorScope"
|
contextId="org.eclipse.cdt.ui.cEditorScope"
|
||||||
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
|
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
|
||||||
<!--key
|
<key
|
||||||
sequence="F4"
|
sequence="F4"
|
||||||
contextId="org.eclipse.cdt.ui.cEditorScope"
|
contextId="org.eclipse.cdt.ui.cEditorScope"
|
||||||
commandId="org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy"
|
commandId="org.eclipse.cdt.ui.edit.open.type.hierarchy"
|
||||||
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/-->
|
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
|
||||||
<!--key
|
<!--key
|
||||||
sequence="M1+M2+H"
|
sequence="M1+M2+H"
|
||||||
contextId="org.eclipse.cdt.ui.cEditorScope"
|
contextId="org.eclipse.cdt.ui.cEditorScope"
|
||||||
|
@ -1095,12 +1095,12 @@
|
||||||
description="%ActionDefinition.openCallHierarchy.description"
|
description="%ActionDefinition.openCallHierarchy.description"
|
||||||
name="%ActionDefinition.openCallHierarchy.name"
|
name="%ActionDefinition.openCallHierarchy.name"
|
||||||
id="org.eclipse.cdt.ui.edit.open.call.hierarchy"/>
|
id="org.eclipse.cdt.ui.edit.open.call.hierarchy"/>
|
||||||
<!--command
|
<command
|
||||||
name="%ActionDefinition.openTypeHierarchy.name"
|
name="%ActionDefinition.openTypeHierarchy.name"
|
||||||
description="%ActionDefinition.openTypeHierarchy.description"
|
description="%ActionDefinition.openTypeHierarchy.description"
|
||||||
categoryId="org.eclipse.ui.category.navigate"
|
categoryId="org.eclipse.ui.category.navigate"
|
||||||
id="org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy">
|
id="org.eclipse.cdt.ui.edit.open.type.hierarchy">
|
||||||
</command-->
|
</command>
|
||||||
<!--command
|
<!--command
|
||||||
name="%ActionDefinition.openTypeInHierarchy.name"
|
name="%ActionDefinition.openTypeInHierarchy.name"
|
||||||
description="%ActionDefinition.openTypeInHierarchy.description"
|
description="%ActionDefinition.openTypeInHierarchy.description"
|
||||||
|
@ -1191,13 +1191,13 @@
|
||||||
retarget="true"
|
retarget="true"
|
||||||
tooltip="%OpenCallHierarchy.tooltip">
|
tooltip="%OpenCallHierarchy.tooltip">
|
||||||
</action>
|
</action>
|
||||||
<!--action
|
<action
|
||||||
definitionId="org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy"
|
definitionId="org.eclipse.cdt.ui.edit.open.type.hierarchy"
|
||||||
label="%OpenTypeHierarchyAction.label"
|
label="%OpenTypeHierarchyAction.label"
|
||||||
retarget="true"
|
retarget="true"
|
||||||
menubarPath="navigate/open.ext"
|
menubarPath="navigate/open.ext"
|
||||||
id="org.eclipse.cdt.ui.actions.OpenTypeHierarchy">
|
id="org.eclipse.cdt.ui.actions.OpenTypeHierarchy">
|
||||||
</action-->
|
</action>
|
||||||
<!--action
|
<!--action
|
||||||
id="org.eclipse.cdt.ui.actions.openTypeInHierarchy"
|
id="org.eclipse.cdt.ui.actions.openTypeInHierarchy"
|
||||||
class="org.eclipse.cdt.internal.ui.browser.typehierarchy.OpenTypeInHierarchyAction"
|
class="org.eclipse.cdt.internal.ui.browser.typehierarchy.OpenTypeInHierarchyAction"
|
||||||
|
|
|
@ -2284,10 +2284,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR
|
||||||
// action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DEF);
|
// action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DEF);
|
||||||
// setAction("OpenDefinition", action); //$NON-NLS-1$
|
// setAction("OpenDefinition", action); //$NON-NLS-1$
|
||||||
|
|
||||||
// action = new OpenTypeHierarchyAction(this);
|
|
||||||
// action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_TYPE_HIERARCHY);
|
|
||||||
// setAction("OpenTypeHierarchy", action); //$NON-NLS-1$
|
|
||||||
|
|
||||||
fShowInCViewAction = new ShowInCViewAction(this);
|
fShowInCViewAction = new ShowInCViewAction(this);
|
||||||
action = fShowInCViewAction;
|
action = fShowInCViewAction;
|
||||||
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_CVIEW);
|
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_CVIEW);
|
||||||
|
|
|
@ -125,7 +125,7 @@ public interface ICEditorActionDefinitionIds extends ITextEditorActionDefinition
|
||||||
* Action definition ID of the navigate -> open type hierarchy action
|
* Action definition ID of the navigate -> open type hierarchy action
|
||||||
* (value <code>"org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy"</code>).
|
* (value <code>"org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy"</code>).
|
||||||
*/
|
*/
|
||||||
public static final String OPEN_TYPE_HIERARCHY= "org.eclipse.cdt.ui.edit.text.c.open.type.hierarchy"; //$NON-NLS-1$
|
public static final String OPEN_TYPE_HIERARCHY= "org.eclipse.cdt.ui.edit.open.type.hierarchy"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action definition ID of the navigate -> open action
|
* Action definition ID of the navigate -> open action
|
||||||
|
|
|
@ -21,11 +21,10 @@ import java.util.List;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
|
|
||||||
class THGraphNode {
|
class THGraphNode {
|
||||||
private static final Object[] NO_MEMBERS= new Object[0];
|
|
||||||
private List fOutgoing= Collections.EMPTY_LIST;
|
private List fOutgoing= Collections.EMPTY_LIST;
|
||||||
private List fIncoming= Collections.EMPTY_LIST;
|
private List fIncoming= Collections.EMPTY_LIST;
|
||||||
private ICElement fElement;
|
private ICElement fElement;
|
||||||
private Object[] fMembers= NO_MEMBERS;
|
private Object[] fMembers= null;
|
||||||
|
|
||||||
THGraphNode(ICElement element) {
|
THGraphNode(ICElement element) {
|
||||||
fElement= element;
|
fElement= element;
|
||||||
|
|
|
@ -288,7 +288,10 @@ class THHierarchyModel {
|
||||||
public Object[] getMembers() {
|
public Object[] getMembers() {
|
||||||
if (fHierarchySelection != null) {
|
if (fHierarchySelection != null) {
|
||||||
THGraphNode gnode= fGraph.getNode(fHierarchySelection.getRepresentedDeclaration());
|
THGraphNode gnode= fGraph.getNode(fHierarchySelection.getRepresentedDeclaration());
|
||||||
return gnode.getMembers(fShowInheritedMembers);
|
Object[] result= gnode.getMembers(fShowInheritedMembers);
|
||||||
|
if (result != null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NO_CHILDREN;
|
return NO_CHILDREN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue