CheckIn: Fix Bugzilla Bug 217222 XML Element Selection issues for xml dataset
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/META-INF/MANIFEST.MF
index 9d4c1bd..397499f 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.name
 Bundle-SymbolicName: org.eclipse.datatools.enablement.oda.xml.ui;singleton:=true
-Bundle-Version: 1.0.3.200802181
+Bundle-Version: 1.0.3.200802211
 Bundle-ClassPath: .
 Bundle-Activator: org.eclipse.datatools.enablement.oda.xml.ui.UiPlugin
 Bundle-Vendor: Eclipse.org
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
index 39e5a95..5ddf2fd 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/XPathChoosePage.java
@@ -372,7 +372,7 @@
 				absolutePathButton.setSelection( true );	
 				anyLocationButton.setSelection( false );
 				customButton.setSelection( false );
-				xmlPathField.setVisible( false );
+				doSelectAbsolutePathButton( );
 			}			
 		});
 		anyLocationLabel.addListener( SWT.MouseDown, new Listener(){
@@ -382,7 +382,7 @@
 				anyLocationButton.setSelection( true );
 				absolutePathButton.setSelection( false );	
 				customButton.setSelection( false );
-				xmlPathField.setVisible( false );
+				doSelectAnyLocationButton( );
 			}			
 		});
 		customPathLabel.addListener( SWT.MouseDown, new Listener(){
@@ -402,25 +402,14 @@
 
 			public void widgetSelected( SelectionEvent e )
 			{
-				if ( absolutePathButton.getSelection( )
-						&& ( xpathList != null && xpathList.size( ) > 0 ) )
-
-				{
-					rootPath = xpathList.get( 0 ).toString( );
-					xmlPathField.setVisible( false );
-				}
+				doSelectAbsolutePathButton( );
 			}
 		} );
 		anyLocationButton.addSelectionListener( new SelectionAdapter( ) {
 
 			public void widgetSelected( SelectionEvent e )
 			{
-				if ( anyLocationButton.getSelection( )
-						&& ( xpathList != null && xpathList.size( ) > 1 ) )
-				{
-					rootPath = xpathList.get( 1 ).toString( );
-					xmlPathField.setVisible( false );
-				}
+				doSelectAnyLocationButton( );
 			}
 		} );
 		customButton.addSelectionListener( new SelectionAdapter( ) {
@@ -440,6 +429,35 @@
 	}
 
 	/**
+	 * Reset the rootPath value after selecting the "Absolute Path" button
+	 * 
+	 */
+	private void doSelectAbsolutePathButton( )
+	{
+		if ( absolutePathButton.getSelection( )
+				&& ( xpathList != null && xpathList.size( ) > 0 ) )
+
+		{
+			rootPath = xpathList.get( 0 ).toString( );
+			xmlPathField.setVisible( false );
+		}
+	}
+
+	/**
+	 * Reset the rootPath value after selecting the "Any Location Path" button
+	 * 
+	 */
+	private void doSelectAnyLocationButton( )
+	{
+		if ( anyLocationButton.getSelection( )
+				&& ( xpathList != null && xpathList.size( ) > 1 ) )
+		{
+			rootPath = xpathList.get( 1 ).toString( );
+			xmlPathField.setVisible( false );
+		}
+	}
+	
+	/**
 	 * 
 	 */
 	private void resetButtonsAndLabels( boolean visible )