Skip to content

Commit

Permalink
Fix issues with csv import on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
buchen committed May 17, 2012
1 parent 4d211dc commit a9ba6a7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException

FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
fileDialog.setFilterNames(new String[] { Messages.CSVImportLabelFileCSV, Messages.CSVImportLabelFileAll });
fileDialog.setFilterExtensions(new String[] { "csv", "*" }); //$NON-NLS-1$ //$NON-NLS-2$
fileDialog.setFilterExtensions(new String[] { "*.csv", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
String fileName = fileDialog.open();

if (fileName == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CSVImportLabelEditMapping = Spaltenzuordnung

CSVImportLabelEncoding = Enkodierung:

CSVImportLabelExpectedValue = Wert
CSVImportLabelExpectedValue = Schl\u00fcssel

CSVImportLabelFileAll = Alle Dateien (*.*)

Expand All @@ -39,7 +39,7 @@ CSVImportLabelFirstLineIsHeader = Erste Zeile enth\u00E4lt Spalten\u00FCberschri

CSVImportLabelFormat = Format

CSVImportLabelProvidedValue = Quellwert
CSVImportLabelProvidedValue = Wert in CSV

CSVImportLabelSkipLines = Import beginnt in Zeile:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,19 @@ private static class ColumnConfigDialog extends Dialog implements ISelectionChan
protected ColumnConfigDialog(Shell parentShell, CSVImportDefinition definition, Column column)
{
super(parentShell);
this.setShellStyle(getShellStyle() | SWT.SHEET);
setShellStyle(getShellStyle() | SWT.SHEET);

this.definition = definition;
this.column = column;
}

@Override
protected void configureShell(Shell shell)
{
super.configureShell(shell);
shell.setText(Messages.CSVImportLabelEditMapping);
}

@Override
protected Control createDialogArea(Composite parent)
{
Expand All @@ -592,8 +599,10 @@ protected Control createDialogArea(Composite parent)

final Composite emptyArea = new Composite(details, SWT.NONE);

GridLayoutFactory glf = GridLayoutFactory.fillDefaults().margins(0, 0);

final Composite dateArea = new Composite(details, SWT.NONE);
GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(dateArea);
glf.applyTo(dateArea);
label = new Label(dateArea, SWT.NONE);
label.setText(Messages.CSVImportLabelFormat);
final ComboViewer dateFormats = new ComboViewer(dateArea, SWT.READ_ONLY);
Expand All @@ -603,16 +612,18 @@ protected Control createDialogArea(Composite parent)
dateFormats.addSelectionChangedListener(this);

final Composite valueArea = new Composite(details, SWT.NONE);
GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(valueArea);
glf.applyTo(valueArea);
label = new Label(valueArea, SWT.NONE);
label.setText(Messages.CSVImportLabelFormat);
final ComboViewer valueFormats = new ComboViewer(valueArea, SWT.READ_ONLY);
valueFormats.setContentProvider(ArrayContentProvider.getInstance());
valueFormats.setInput(AmountField.FORMATS);
valueFormats.getCombo().select(0);
valueFormats.addSelectionChangedListener(this);

final Composite keyArea = new Composite(details, SWT.NONE);
GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(keyArea);
final TableViewer tableViewer = new TableViewer(keyArea);
glf.applyTo(keyArea);
final TableViewer tableViewer = new TableViewer(keyArea, SWT.FULL_SELECTION);
tableViewer.setContentProvider(new KeyMappingContentProvider());
tableViewer.setLabelProvider(new KeyMappingLabelProvider());
tableViewer.getTable().setLinesVisible(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ImportWizard extends Wizard

public ImportWizard(Client client, File inputFile)
{
setWindowTitle(Messages.CSVImportWizardTitle);
this.importer = new CSVImporter(client, inputFile);
}

Expand Down

0 comments on commit a9ba6a7

Please sign in to comment.