From 6670d4e1e656b6e01eb662e70a6ce7386e9114c0 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Wed, 13 Jun 2007 15:29:24 +0000 Subject: [PATCH] [189426] System File/Folder Dialogs - New Connection Not Added to Drop Down --- .../rse/ui/actions/SystemNewConnectionAction.java | 2 ++ .../org/eclipse/rse/ui/widgets/SystemHostCombo.java | 11 ++--------- .../newconnection/RSEMainNewConnectionWizard.java | 3 ++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java index 4f100948bd0..19a575f8ac2 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java @@ -14,6 +14,7 @@ * Uwe Stieber (Wind River) - Set action id for identification from plugin.xml menu extensions. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Uwe Stieber (Wind River) - [192202] Default RSE new connection wizard does not allow to query created host instance anymore + * Uwe Stieber (Wind River) - [189426] System File/Folder Dialogs - New Connection Not Added to Drop Down ********************************************************************************/ package org.eclipse.rse.ui.actions; @@ -169,6 +170,7 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction { * @see org.eclipse.rse.ui.actions.SystemBaseWizardAction#postProcessWizard(org.eclipse.jface.wizard.IWizard) */ protected void postProcessWizard(IWizard wizard) { + if (wizard instanceof RSEMainNewConnectionWizard) wizard = ((RSEMainNewConnectionWizard)wizard).getSelectedWizard(); if (wizard instanceof RSEDefaultNewConnectionWizard) { setValue(((RSEDefaultNewConnectionWizard)wizard).getCreatedHost()); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java index 3818fd7711f..2841f2cdf78 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java @@ -16,7 +16,6 @@ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods - * Rupen Mardirossian (IBM) - [189426] modify addOurButtonSelectionListener to return proper IHost added to populate ComboBox ********************************************************************************/ package org.eclipse.rse.ui.widgets; @@ -984,15 +983,9 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, public void widgetSelected(SelectionEvent event) { setBusyCursor(true); - IHost[] hostlist = RSECorePlugin.getTheSystemRegistry().getHosts(); - newConnectionAction.run(); + newConnectionAction.run(); setBusyCursor(false); - IHost[] hostlist2 = RSECorePlugin.getTheSystemRegistry().getHosts(); - IHost newConnection=null; - if(hostlist2.length>hostlist.length) - { - newConnection = hostlist2[hostlist2.length-1]; - } + IHost newConnection = (IHost)newConnectionAction.getValue(); //System.out.println("newConnection == " + newConnection); if (newConnection != null ) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEMainNewConnectionWizard.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEMainNewConnectionWizard.java index bb3a1cc3f46..8be2978cd0e 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEMainNewConnectionWizard.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSEMainNewConnectionWizard.java @@ -15,6 +15,7 @@ * Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods + * Uwe Stieber (Wind River) - [189426] System File/Folder Dialogs - New Connection Not Added to Drop Down ********************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; @@ -86,6 +87,7 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS setDialogSettings(settings.getSection(sectionName)); selectedContext = null; + selectedWizard = null; mainPage = new RSENewConnectionWizardSelectionPage(); initializedWizards.clear(); selectionChangedListener.clear(); @@ -98,7 +100,6 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS super.dispose(); selectedContext = null; - selectedWizard = null; selectedSystemType = null; selectedWizardCanFinishEarly = false; mainPage = null;