From 9bfc9ae49a15615a809f43f49564e371bcefc6d5 Mon Sep 17 00:00:00 2001 From: Javier Montalvo Orus Date: Thu, 10 May 2007 17:13:09 +0000 Subject: [PATCH] added listener to transport combo box --- .../ServiceDiscoveryWizardMainPage.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/discovery/org.eclipse.tm.discovery.wizard/src/org/eclipse/tm/internal/discovery/wizard/ServiceDiscoveryWizardMainPage.java b/discovery/org.eclipse.tm.discovery.wizard/src/org/eclipse/tm/internal/discovery/wizard/ServiceDiscoveryWizardMainPage.java index fe3ec05c878..6d04a83e2d0 100644 --- a/discovery/org.eclipse.tm.discovery.wizard/src/org/eclipse/tm/internal/discovery/wizard/ServiceDiscoveryWizardMainPage.java +++ b/discovery/org.eclipse.tm.discovery.wizard/src/org/eclipse/tm/internal/discovery/wizard/ServiceDiscoveryWizardMainPage.java @@ -136,7 +136,8 @@ public class ServiceDiscoveryWizardMainPage extends WizardPage { } else { - addressText.setText(tempAddress); + if(tempAddress!=null) + addressText.setText(tempAddress); } } }); @@ -150,6 +151,30 @@ public class ServiceDiscoveryWizardMainPage extends WizardPage { transportCombo.setItems(TransportFactory.getTransportList()); transportCombo.select(0); + transportCombo.addSelectionListener(new SelectionListener(){ + + public void widgetDefaultSelected(SelectionEvent e) { + } + + public void widgetSelected(SelectionEvent event) { + + if(multicastButton.getSelection()) + { + String multicastAddress = null; + + try { + multicastAddress = ProtocolFactory.getMulticastAddress(protocolCombo.getText(), transportCombo.getText()); + } catch (CoreException e1) {} + + if(multicastAddress!=null) + { + tempAddress = addressText.getText(); + addressText.setText(multicastAddress); + } + } + } + }); + transportCombo.setLayoutData(data); new Label(comp,SWT.NULL).setText(Messages.getString("ServiceDiscoveryWizardMainPage.ProtocolLabel")); //$NON-NLS-1$