private GDBJtagDeviceContribution findJtagDeviceByName(String name) {
   GDBJtagDeviceContribution[] availableDevices =
       GDBJtagDeviceContributionFactory.getInstance().getGDBJtagDeviceContribution();
   for (GDBJtagDeviceContribution device : availableDevices) {
     if (device.getDeviceName().equals(name)) {
       return device;
     }
   }
   return null;
 }
 private void useRemoteChanged() {
   boolean enabled = useRemote.getSelection();
   jtagDevice.setEnabled(enabled);
   ipAddress.setEnabled(enabled);
   portNumber.setEnabled(enabled);
   connection.setEnabled(enabled);
   GDBJtagDeviceContribution selectedDeviceEntry = findJtagDeviceByName(jtagDevice.getText());
   if ((selectedDeviceEntry == null) || (selectedDeviceEntry.getDevice() == null)) {
     remoteConnectParmsLayout.topControl = null;
     remoteConnectionParameters.layout();
   } else {
     IGDBJtagDevice device = selectedDeviceEntry.getDevice();
     if (device instanceof IGDBJtagConnection) {
       remoteConnectParmsLayout.topControl = remoteConnectionBox;
       remoteConnectionBox.getParent().layout();
     } else {
       remoteConnectParmsLayout.topControl = remoteTcpipBox;
       remoteTcpipBox.getParent().layout();
     }
   }
 }