Skip to content

Commit

Permalink
keep csv column names order in field mapping dlg
Browse files Browse the repository at this point in the history
Field mapping dialog - show csv column names in the same order as listed in the csv file and let the user sort them if want to.
  • Loading branch information
ashitsalesforce committed Jan 20, 2024
1 parent 9e1139a commit 17db0c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/salesforce/dataloader/ui/MappingDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ private void initializeMappingViewer(Shell shell) {
mappingTblViewer = new TableViewer(shell, SWT.FULL_SELECTION);
mappingTblViewer.setContentProvider(new MappingContentProvider());
mappingTblViewer.setLabelProvider(new MappingLabelProvider());
mappingTblViewer.setComparator(new MappingViewerComparator());

data = new GridData(GridData.FILL_BOTH);

Expand Down Expand Up @@ -384,6 +383,9 @@ public void keyReleased(KeyEvent event) {}
csvFieldsCol.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (mappingTblViewer.getComparator() == null) {
mappingTblViewer.setComparator(new MappingViewerComparator());
}
((MappingViewerComparator)mappingTblViewer.getComparator()).doSort(MAPPING_DAO);
mappingTblViewer.refresh();
}
Expand All @@ -395,6 +397,9 @@ public void widgetSelected(SelectionEvent event) {
sforceFieldNamesCol.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (mappingTblViewer.getComparator() == null) {
mappingTblViewer.setComparator(new MappingViewerComparator());
}
((MappingViewerComparator)mappingTblViewer.getComparator()).doSort(MAPPING_SFORCE);
mappingTblViewer.refresh();
}
Expand All @@ -413,7 +418,6 @@ public void widgetSelected(SelectionEvent event) {
if (mappingTable.getItemCount() > 0) {
mappingTable.showItem(mappingTable.getItem(0));
}

}

private void initializeSforceViewer(Shell shell, Text sforceFieldsSearch) {
Expand Down

0 comments on commit 17db0c1

Please sign in to comment.