1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[187709] don't show monitor and show in table actions for leafs (even if they are disabled)

This commit is contained in:
David McKnight 2007-05-31 11:02:44 +00:00
parent 3f1720b18f
commit 01c26f45ed

View file

@ -860,6 +860,7 @@ public class SystemView extends SafeTreeViewer
Object selectedObject = selection.getFirstElement(); Object selectedObject = selection.getFirstElement();
ISystemViewElementAdapter adapter = getViewAdapter(selectedObject); ISystemViewElementAdapter adapter = getViewAdapter(selectedObject);
boolean hasChildren = adapter.hasChildren((IAdaptable)selectedObject);
if (!selectionIsRemoteObject) if (!selectionIsRemoteObject)
{ {
GoIntoAction goIntoAction = getGoIntoAction(); GoIntoAction goIntoAction = getGoIntoAction();
@ -868,7 +869,7 @@ public class SystemView extends SafeTreeViewer
if (singleSelection) { if (singleSelection) {
// dkm - first find out if the selection will have children // dkm - first find out if the selection will have children
// only add this action if there are children // only add this action if there are children
if (adapter.hasChildren((IAdaptable)selectedObject)) if (hasChildren)
{ {
menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction); menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
} }
@ -882,7 +883,7 @@ public class SystemView extends SafeTreeViewer
} }
} }
if (showGenericShowInTableAction()) { if (showGenericShowInTableAction() && hasChildren) {
SystemShowInTableAction showInTableAction = getShowInTableAction(); SystemShowInTableAction showInTableAction = getShowInTableAction();
showInTableAction.setSelection(selection); showInTableAction.setSelection(selection);
menu.appendToGroup(getOpenToPerspectiveAction().getContextMenuGroup(), showInTableAction); menu.appendToGroup(getOpenToPerspectiveAction().getContextMenuGroup(), showInTableAction);