summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxwu2013-05-23 12:30:50 (EDT)
committer mwu2013-05-23 12:30:50 (EDT)
commit562a23838610602b6189e01b83f8b8723da846ba (patch)
treed5be568e1c6c4f0fc2d2dd6fe9f5638410ab8069
parentb756d5092ceeef33a025cf7686baa63f92e37f4c (diff)
downloadorg.eclipse.datatools.enablement.oda-562a23838610602b6189e01b83f8b8723da846ba.zip
org.eclipse.datatools.enablement.oda-562a23838610602b6189e01b83f8b8723da846ba.tar.gz
org.eclipse.datatools.enablement.oda-562a23838610602b6189e01b83f8b8723da846ba.tar.bz2
Fix bugzilla bug [408836] - Can't remove column mapping continuously forv201305240030
XML/Web Service data set.
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/ColumnMappingPage.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/ColumnMappingPage.java b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/ColumnMappingPage.java
index 04db9b6..5cad034 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/ColumnMappingPage.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml.ui/src/org/eclipse/datatools/enablement/oda/xml/ui/wizards/ColumnMappingPage.java
@@ -788,7 +788,11 @@ public class ColumnMappingPage extends DataSetWizardPage
{
if ( e.keyCode == SWT.DEL )
{
+ int index = columnMappingTable.getViewer( )
+ .getTable( )
+ .getSelectionIndex( );
removeSelectedItems( );
+ updateSelectedItemsSelection( index );
setPageProperties( );
}
}
@@ -844,7 +848,11 @@ public class ColumnMappingPage extends DataSetWizardPage
public void widgetSelected( SelectionEvent e )
{
+ int index = columnMappingTable.getViewer( )
+ .getTable( )
+ .getSelectionIndex( );
removeSelectedItems( );
+ updateSelectedItemsSelection( index );
setPageProperties( );
}
@@ -861,7 +869,11 @@ public class ColumnMappingPage extends DataSetWizardPage
public void widgetSelected( SelectionEvent e )
{
+ int index = columnMappingTable.getViewer( )
+ .getTable( )
+ .getSelectionIndex( );
removeSelectedItems( );
+ updateSelectedItemsSelection( index );
setPageProperties( );
}
@@ -877,6 +889,7 @@ public class ColumnMappingPage extends DataSetWizardPage
public void widgetSelected( SelectionEvent e )
{
removeAllItem( );
+ updateSelectedItemsSelection( 0 );
setPageProperties( );
}
@@ -978,6 +991,23 @@ public class ColumnMappingPage extends DataSetWizardPage
.setEnabled( enabled );
}
+ private void updateSelectedItemsSelection( int nextIndex )
+ {
+ int itemCount = columnMappingTable.getViewer( ).getTable( ).getItemCount( );
+
+ availableXmlTree.getTree( ).deselectAll( );
+ columnMappingTable.getViewer( ).getTable( ).deselectAll( );
+
+ if ( itemCount > nextIndex )
+ {
+ columnMappingTable.getViewer( ).getTable( ).select( nextIndex );
+ }
+ else if ( itemCount > 0 )
+ {
+ columnMappingTable.getViewer( ).getTable( ).select( itemCount - 1 );
+ }
+ }
+
/**
* Edit the single table viewer element
*