Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep csv column names order in field mapping dlg #953

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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