Author: coheigea
Date: Tue Jan 29 11:26:31 2013
New Revision: 1439839

URL: http://svn.apache.org/viewvc?rev=1439839&view=rev
Log:
Select a single Connector version by default

Modified:
    
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java

Modified: 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java?rev=1439839&r1=1439838&r2=1439839&view=diff
==============================================================================
--- 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java
 (original)
+++ 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java
 Tue Jan 29 11:26:31 2013
@@ -278,7 +278,15 @@ public class ConnectorModalPage extends 
                 properties.clear();
                 version.setEnabled(connectorTO.getBundleName() != null);
                 version.getField().setModelValue(null);
-                version.setChoices(new 
ArrayList<String>(mapConnBundleTO.get(connectorTO.getBundleName()).keySet()));
+                List<String> choices = new 
ArrayList<String>(mapConnBundleTO.get(connectorTO.getBundleName()).keySet());
+                version.setChoices(choices);
+                if (choices.size() == 1) {
+                    connectorTO.setVersion(choices.get(0));
+                    version.getField().setModelObject(choices.get(0));
+                    connectorTO.setDisplayName(displayName.getModelObject());
+                    bundleTO = getSelectedBundleTO(mapConnBundleTO, 
connectorTO);
+                    properties = fillProperties(bundleTO, connectorTO);
+                }
                 target.add(bundleName);
                 target.add(version);
                 target.add(propertiesContainer);


Reply via email to