1
0
Fork 0
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:
Markus Schorn 2006-08-25 13:51:53 +00:00
parent 110e1adca5
commit f5f18b8cb2
3 changed files with 16 additions and 0 deletions

View file

@ -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;

View file

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

View file

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