mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
Call Hierarchy: added action 'Focus on'
This commit is contained in:
parent
110e1adca5
commit
f5f18b8cb2
3 changed files with 16 additions and 0 deletions
|
@ -22,6 +22,7 @@ public class CHMessages extends NLS {
|
|||
public static String CHViewPart_emptyPageMessage;
|
||||
public static String CHViewPart_FilterVariables_label;
|
||||
public static String CHViewPart_FilterVariables_tooltip;
|
||||
public static String CHViewPart_FocusOn_label;
|
||||
public static String CHViewPart_HideMacros_label;
|
||||
public static String CHViewPart_HideMacros_tooltip;
|
||||
public static String CHViewPart_NextReference_label;
|
||||
|
|
|
@ -21,6 +21,7 @@ CHViewPart_Refresh_tooltip=Refresh View Content
|
|||
CHViewPart_WorkspaceScope=workspace
|
||||
CHViewPart_Title_callers=Callers of {0} - in {1}
|
||||
CHViewPart_Title_callees=Calls made by {0} - in {1}
|
||||
CHViewPart_FocusOn_label=Focus On ''{0}''
|
||||
CHViewPart_Open_label=Open
|
||||
CHViewPart_Open_tooltip=Open
|
||||
CHViewPart_OpenReference_label=Open Reference
|
||||
|
|
|
@ -69,6 +69,7 @@ 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;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.AdaptingSelectionProvider;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.EditorOpener;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.ExtendedTreeViewer;
|
||||
import org.eclipse.cdt.internal.ui.viewsupport.TreeNavigator;
|
||||
|
@ -658,6 +659,19 @@ public class CHViewPart extends ViewPart {
|
|||
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fShowReference);
|
||||
}
|
||||
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenElement);
|
||||
|
||||
if (node.getParent() != null) {
|
||||
final ICElement element= node.getRepresentedDeclaration();
|
||||
if (element != null) {
|
||||
String label= Messages.format(CHMessages.CHViewPart_FocusOn_label,
|
||||
CElementLabels.getTextLabel(element, CElementLabels.ALL_FULLY_QUALIFIED | CElementLabels.M_PARAMETER_TYPES));
|
||||
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, new Action(label) {
|
||||
public void run() {
|
||||
setInput(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// action groups
|
||||
|
|
Loading…
Add table
Reference in a new issue