From 46c9cb3331d9ac5a227b9f40a250d8de3c1141c9 Mon Sep 17 00:00:00 2001 From: Kushal Munir < kmunir@ca.ibm.com> Date: Wed, 11 Oct 2006 14:29:04 +0000 Subject: [PATCH] Bug 154524: Local node is shown in RSE even though the Local subsystem is not installed --- .../UI/org/eclipse/rse/ui/view/SystemViewPart.java | 11 +++++++---- .../model/org/eclipse/rse/model/SystemRegistry.java | 9 ++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java index a9dd3cb1bc8..6ebe4c8029b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewPart.java @@ -446,10 +446,13 @@ public class SystemViewPart { // assume this is the primary RSE view - // WE GET ALL THE WAY HERE, BUT THESE LINES OF CODE ARE INEFFECTIVE FOR SOME REASON!! - TreeItem firstItem = systemView.getTree().getItems()[0]; - systemView.setSelection(new StructuredSelection(firstItem.getData())); - systemView.setExpandedState(firstItem.getData(), true); + // WE GET ALL THE WAY HERE, BUT THESE LINES OF CODE ARE INEFFECTIVE FOR SOME REASON!! + + if (systemView.getTree().getItemCount() > 0) { + TreeItem firstItem = systemView.getTree().getItems()[0]; + systemView.setSelection(new StructuredSelection(firstItem.getData())); + systemView.setExpandedState(firstItem.getData(), true); + } } } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java index 6a74adb4121..0415e3872ac 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java @@ -254,7 +254,14 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven if (sysType != null) { // sysType can be null if workspace contains a host that is no longer defined by the workbench RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class)); if (adapter.isEnabled(sysType)) { - result.add(con); + + // Bug 154524 Local node is shown in RSE even though the Local subsystem is not installed + // so we check for subsystems + ISubSystem[] subsystems = con.getSubSystems(); + + if (subsystems != null && subsystems.length != 0) { + result.add(con); + } } } }