mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 18:15:23 +02:00
[186848] check for hasChildren() before adding the go into action
This commit is contained in:
parent
332a08db68
commit
32d8bf8bd0
1 changed files with 16 additions and 2 deletions
|
@ -854,8 +854,22 @@ public class SystemView extends SafeTreeViewer
|
||||||
// OPEN IN NEW WINDOW ACTION...
|
// OPEN IN NEW WINDOW ACTION...
|
||||||
if (fromSystemViewPart) {
|
if (fromSystemViewPart) {
|
||||||
GoIntoAction goIntoAction = getGoIntoAction();
|
GoIntoAction goIntoAction = getGoIntoAction();
|
||||||
goIntoAction.setEnabled(selection.size() == 1);
|
boolean singleSelection = selection.size() == 1;
|
||||||
menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
|
goIntoAction.setEnabled(singleSelection);
|
||||||
|
if (singleSelection)
|
||||||
|
{
|
||||||
|
// dkm - first find out if the selection will have children
|
||||||
|
// only add this action if there are children
|
||||||
|
Object selectedObject = selection.getFirstElement();
|
||||||
|
ISystemViewElementAdapter adapter = getViewAdapter(selectedObject);
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
if (adapter.hasChildren((IAdaptable)selectedObject))
|
||||||
|
{
|
||||||
|
menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (showOpenViewActions()) {
|
if (showOpenViewActions()) {
|
||||||
SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
|
SystemOpenExplorerPerspectiveAction openToPerspectiveAction = getOpenToPerspectiveAction();
|
||||||
|
|
Loading…
Add table
Reference in a new issue