1 Commits

Author SHA1 Message Date
355c9d3ce4 first try 2021-11-23 06:42:40 +01:00
76 changed files with 269 additions and 233 deletions

View File

@@ -1,7 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
Copyright (c) 2015-2021 Andreas Billmann <andreas.billmann@javafx.ninja> Copyright (c) 2015-2019 Andreas Billmann <andreas.billmann@javafx.ninja>

View File

@@ -15,7 +15,7 @@ even in a "normal" CSV editor. So I decided to write this simple JavaFX applicat
[Wiki & Documentation](https://github.com/frosch95/SmartCSV.fx/wiki) [Wiki & Documentation](https://github.com/frosch95/SmartCSV.fx/wiki)
binary distribution of the [latest release (1.2.0)](https://github.com/frosch95/SmartCSV.fx/releases/download/1.2.0/SmartCSV.fx-1.2.0.zip) binary distribution of the [latest release (1.0.1)](https://github.com/frosch95/SmartCSV.fx/releases/download/1.0.1/SmartCSV.fx-1.0.1.zip)
## Talks ## Talks
[Introduction](http://javafx.ninja/talks/introduction/) [Introduction](http://javafx.ninja/talks/introduction/)

View File

@@ -3,7 +3,7 @@ plugins {
id 'java' id 'java'
id 'groovy' id 'groovy'
id 'application' id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10' id 'org.openjfx.javafxplugin' version '0.0.8'
} }
repositories { repositories {
@@ -16,31 +16,28 @@ sourceCompatibility = 17
targetCompatibility = 17 targetCompatibility = 17
javafx { javafx {
version = "17"
modules = [ 'javafx.controls', 'javafx.fxml' ] modules = [ 'javafx.controls', 'javafx.fxml' ]
} }
dependencies { dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.2' testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.2'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.2' testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.5.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.2' testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version:'3.1.0' testImplementation group: 'org.mockito', name: 'mockito-core', version:'3.1.0'
implementation group: 'org.apache.groovy', name: 'groovy', version: '4.0.0-rc-1' implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.6'
implementation group: 'org.springframework', name:'spring-context', version: '5.3.13' implementation group: 'org.springframework', name:'spring-context', version: '5.3.10'
implementation group: 'de.siegmar', name: 'fastcsv', version: '2.1.0' implementation group: 'net.sf.supercsv', name: 'super-csv', version: '2.4.0'
implementation group: 'commons-validator', name: 'commons-validator', version: '1.7' implementation group: 'commons-validator', name: 'commons-validator', version: '1.7'
implementation group: 'de.jensd', name: 'fontawesomefx-commons', version: '11.0' implementation group: 'de.jensd', name: 'fontawesomefx-commons', version: '11.0'
implementation group: 'de.jensd', name: 'fontawesomefx-fontawesome', version: '4.7.0-11' implementation group: 'de.jensd', name: 'fontawesomefx-fontawesome', version: '4.7.0-11'
implementation group: 'de.jensd', name: 'fontawesomefx-materialdesignfont', version: '1.7.22-11' implementation group: 'de.jensd', name: 'fontawesomefx-materialdesignfont', version: '1.7.22-11'
implementation group: 'de.jensd', name: 'fontawesomefx-materialicons', version: '2.2.0-11' implementation group: 'de.jensd', name: 'fontawesomefx-materialicons', version: '2.2.0-11'
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.1.0' implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.0.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9' implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.14.1' implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.14.1' implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.7' implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.5'
} }
test { test {
@@ -48,5 +45,5 @@ test {
} }
group 'ninja.javafx' group 'ninja.javafx'
version '1.2.0' version '1.0.1'
mainClassName = 'ninja.javafx.smartcsv.Main' mainClassName = 'ninja.javafx.smartcsv.Main'

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -26,24 +26,22 @@
package ninja.javafx.smartcsv.csv; package ninja.javafx.smartcsv.csv;
import ninja.javafx.smartcsv.preferences.Preferences; import org.supercsv.prefs.CsvPreference;
import static ninja.javafx.smartcsv.preferences.Preferences.defaultPreferences;
/** /**
* *
*/ */
public class CSVConfigurable { public class CSVConfigurable {
protected Preferences csvPreference; protected CsvPreference csvPreference;
protected String fileEncoding; protected String fileEncoding;
public CSVConfigurable() { public CSVConfigurable() {
csvPreference = defaultPreferences(); csvPreference = CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE;
} }
public void setCsvPreference(Preferences csvPreference) { public void setCsvPreference(CsvPreference csvPreference) {
this.csvPreference = csvPreference; this.csvPreference = csvPreference;
} }

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -26,13 +26,17 @@
package ninja.javafx.smartcsv.csv; package ninja.javafx.smartcsv.csv;
import de.siegmar.fastcsv.reader.NamedCsvReader;
import ninja.javafx.smartcsv.FileReader; import ninja.javafx.smartcsv.FileReader;
import ninja.javafx.smartcsv.fx.table.model.CSVModel; import ninja.javafx.smartcsv.fx.table.model.CSVModel;
import ninja.javafx.smartcsv.fx.table.model.CSVRow;
import org.supercsv.exception.SuperCsvException;
import org.supercsv.io.CsvMapReader;
import org.supercsv.io.ICsvMapReader;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Map;
/** /**
* reads the csv file and stores the values in csv model * reads the csv file and stores the values in csv model
@@ -44,38 +48,28 @@ public class CSVFileReader extends CSVConfigurable implements FileReader<CSVMode
@Override @Override
public void read(File file) throws IOException { public void read(File file) throws IOException {
System.out.println(csvPreference); try (ICsvMapReader mapReader = new CsvMapReader(new java.io.FileReader(file.getAbsoluteFile(), Charset.forName(fileEncoding)),
try (var csv = getNamedCsvReader(file)) { csvPreference)) {
model = new CSVModel(); model = new CSVModel();
// the header columns are used as the keys to the Map // the header columns are used as the keys to the Map
var header = csv.getHeader().toArray(new String[csv.getHeader().size()]); String[] header = mapReader.getHeader(true);
model.setHeader(header); model.setHeader(header);
csv.forEach(csvRow -> { Map<String, String> customerMap;
var row = model.addRow(); while ((customerMap = mapReader.read(header)) != null) {
CSVRow row = model.addRow();
for (String column : header) { for (String column : header) {
model.addValue(row, column, csvRow.getField(column)); model.addValue(row, column, customerMap.get(column));
} }
}); }
} catch (IOException | SuperCsvException ex) {
} catch (IOException ex) {
// TODO perhaps a custom NinjaException that can properly identify and localize the exception message // TODO perhaps a custom NinjaException that can properly identify and localize the exception message
// is this a file not found? is this a corrupt csv? etc // is this a file not found? is this a corrupt csv? etc
throw new IOException("Failed to read " + file + ": " + ex.getMessage(), ex); throw new IOException("Failed to read " + file + ": " + ex.getMessage(), ex);
} }
} }
private NamedCsvReader getNamedCsvReader(File file) throws IOException {
var builder = NamedCsvReader.builder()
.fieldSeparator(csvPreference.delimiterChar());
if (csvPreference.quoteChar() != null) {
builder.quoteCharacter(csvPreference.quoteChar());
}
return builder.build(file.toPath(), Charset.forName(fileEncoding));
}
public CSVModel getContent() { public CSVModel getContent() {
return model; return model;
} }

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -26,17 +26,18 @@
package ninja.javafx.smartcsv.csv; package ninja.javafx.smartcsv.csv;
import de.siegmar.fastcsv.writer.CsvWriter;
import de.siegmar.fastcsv.writer.QuoteStrategy;
import ninja.javafx.smartcsv.fx.table.model.CSVModel; import ninja.javafx.smartcsv.fx.table.model.CSVModel;
import ninja.javafx.smartcsv.fx.table.model.CSVRow; import ninja.javafx.smartcsv.fx.table.model.CSVRow;
import org.supercsv.io.CsvMapWriter;
import org.supercsv.io.ICsvMapWriter;
import java.io.File; import java.io.File;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.List; import java.util.Map;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap;
/** /**
* filewriter for the csv * filewriter for the csv
@@ -51,22 +52,22 @@ public class CSVFileWriter extends CSVConfigurable implements ninja.javafx.smart
@Override @Override
public void write(File filename) throws IOException { public void write(File filename) throws IOException {
try (var writer = getCsvWriter(filename)){ ICsvMapWriter mapWriter = null;
writer.writeRow(model.getHeader()); try {
mapWriter = new CsvMapWriter(new FileWriter(filename.getAbsolutePath(), Charset.forName(fileEncoding)),
csvPreference);
mapWriter.writeHeader(model.getHeader());
for(CSVRow row: model.getRows()) { for(CSVRow row: model.getRows()) {
writer.writeRow(convertMapFromModel(row)); Map<String, String> columns = convertMapFromModel(row);
mapWriter.write(columns, model.getHeader());
} }
} }
} finally {
if( mapWriter != null ) {
private CsvWriter getCsvWriter(File filename) throws IOException { mapWriter.close();
var writer = CsvWriter.builder().fieldSeparator(csvPreference.delimiterChar()); }
if (csvPreference.quoteChar() != null) {
writer.quoteCharacter(csvPreference.quoteChar());
writer.quoteStrategy(QuoteStrategy.ALWAYS);
} }
return writer.build(filename.toPath(), Charset.forName(fileEncoding));
} }
/** /**
@@ -74,8 +75,13 @@ public class CSVFileWriter extends CSVConfigurable implements ninja.javafx.smart
* @param row the row to convert * @param row the row to convert
* @return a simple map for the supercvs writer * @return a simple map for the supercvs writer
*/ */
private List<String> convertMapFromModel(CSVRow row) { private Map<String, String> convertMapFromModel(CSVRow row) {
return row.getColumns().values().stream().map(v -> v.get().getValue()) return row.getColumns().entrySet().stream()
.collect(toList()); .collect(
toMap(
Map.Entry::getKey,
e -> e.getValue().getValue().getValue() != null ? e.getValue().getValue().getValue() : ""
)
);
} }
} }

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -85,8 +85,9 @@ public class SmartCSV extends Application {
private void showUI(Stage primaryStage, String name, String version) { private void showUI(Stage primaryStage, String name, String version) {
SmartCSVController smartCVSController = appContext.getBean(SmartCSVController.class); SmartCSVController smartCVSController = appContext.getBean(SmartCSVController.class);
Scene scene = new Scene((Parent) smartCVSController.getView()); Scene scene = new Scene((Parent) smartCVSController.getView());
var defaultThemeCss = getClass().getResource("/ninja/javafx/smartcsv/fx/smartcsv.css").toExternalForm(); var darkThemeCss = scene.getRoot().getStylesheets().get(0);
scene.getRoot().getStylesheets().add(defaultThemeCss); scene.getRoot().getStylesheets().remove(darkThemeCss);
scene.getRoot().getStylesheets().add(darkThemeCss);
primaryStage.setScene(scene); primaryStage.setScene(scene);
primaryStage.setTitle(String.format("%s %s", name, version)); primaryStage.setTitle(String.format("%s %s", name, version));

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -36,8 +36,6 @@ import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.input.Dragboard;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
@@ -66,6 +64,7 @@ import ninja.javafx.smartcsv.validation.configuration.ValidationConfiguration;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.supercsv.prefs.CsvPreference;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -80,7 +79,6 @@ import static javafx.application.Platform.exit;
import static javafx.application.Platform.runLater; import static javafx.application.Platform.runLater;
import static javafx.beans.binding.Bindings.*; import static javafx.beans.binding.Bindings.*;
import static javafx.scene.layout.AnchorPane.*; import static javafx.scene.layout.AnchorPane.*;
import static ninja.javafx.smartcsv.preferences.Preferences.defaultPreferences;
/** /**
* main controller of the application * main controller of the application
@@ -210,9 +208,6 @@ public class SmartCSVController extends FXMLController {
@FXML @FXML
private Label currentLineNumber; private Label currentLineNumber;
@FXML
private Label totalNumberOfLines;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// members // members
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -227,7 +222,7 @@ public class SmartCSVController extends FXMLController {
private FileStorage<CSVModel> currentCsvFile = new FileStorage<>(csvFileReader, csvFileWriter); private FileStorage<CSVModel> currentCsvFile = new FileStorage<>(csvFileReader, csvFileWriter);
private FileStorage<ValidationConfiguration> currentConfigFile = new FileStorage<>(new ValidationFileReader(), new ValidationFileWriter()); private FileStorage<ValidationConfiguration> currentConfigFile = new FileStorage<>(new ValidationFileReader(), new ValidationFileWriter());
private FileStorage<Preferences> csvPreferenceFile = new FileStorage<>(new PreferencesFileReader(), new PreferencesFileWriter()); private FileStorage<CsvPreference> csvPreferenceFile = new FileStorage<>(new PreferencesFileReader(), new PreferencesFileWriter());
private FileStorage<String> fileEncodingFile = new FileStorage<>(new EncodingFileReader(), new EncodingFileWriter()); private FileStorage<String> fileEncodingFile = new FileStorage<>(new EncodingFileReader(), new EncodingFileWriter());
private ListChangeListener<ValidationError> errorListListener = c -> tableView.refresh(); private ListChangeListener<ValidationError> errorListListener = c -> tableView.refresh();
@@ -257,34 +252,6 @@ public class SmartCSVController extends FXMLController {
fileEncodingFile.setFile(ENCODING_FILE); fileEncodingFile.setFile(ENCODING_FILE);
loadCsvPreferencesFromFile(); loadCsvPreferencesFromFile();
initDragAndDrop();
}
private void initDragAndDrop() {
tableWrapper.setOnDragOver(event -> {
Dragboard db = event.getDragboard();
if (event.getGestureSource() != tableWrapper
&& db.hasFiles()
&& db.getFiles().size() == 1
&& db.getFiles().get(0).getName().endsWith(".csv")) {
event.acceptTransferModes(TransferMode.COPY);
}
event.consume();
});
tableWrapper.setOnDragDropped(event -> {
Dragboard db = event.getDragboard();
boolean success = false;
if (db.hasFiles() && db.getFiles().size() == 1) {
File file = db.getFiles().get(0);
openFile(currentCsvFile, file);
success = true;
}
/* let the source know whether the string was successfully
* transferred and used */
event.setDropCompleted(success);
});
} }
private void loadEncodingFromFile() { private void loadEncodingFromFile() {
@@ -401,7 +368,7 @@ public class SmartCSVController extends FXMLController {
Optional<ButtonType> result = alert.showAndWait(); Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK){ if (result.get() == ButtonType.OK){
Preferences csvPreference = preferencesController.getCsvPreference(); CsvPreference csvPreference = preferencesController.getCsvPreference();
setCsvPreference(csvPreference); setCsvPreference(csvPreference);
saveCsvPreferences(csvPreference); saveCsvPreferences(csvPreference);
String fileEncoding = CharsetHelper.getCharsetName(preferencesController.getFileEncoding()); String fileEncoding = CharsetHelper.getCharsetName(preferencesController.getFileEncoding());
@@ -577,12 +544,12 @@ public class SmartCSVController extends FXMLController {
loadEncodingFromFile(); loadEncodingFromFile();
}); });
} else { } else {
setCsvPreference(defaultPreferences()); setCsvPreference(CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE);
loadEncodingFromFile(); loadEncodingFromFile();
} }
} }
private void saveCsvPreferences(Preferences csvPreference) { private void saveCsvPreferences(CsvPreference csvPreference) {
try { try {
createPreferenceFile(); createPreferenceFile();
csvPreferenceFile.setContent(csvPreference); csvPreferenceFile.setContent(csvPreference);
@@ -605,7 +572,7 @@ public class SmartCSVController extends FXMLController {
} }
} }
private void setCsvPreference(Preferences csvPreference) { private void setCsvPreference(CsvPreference csvPreference) {
preferencesController.setCsvPreference(csvPreference); preferencesController.setCsvPreference(csvPreference);
csvFileReader.setCsvPreference(csvPreference); csvFileReader.setCsvPreference(csvPreference);
csvFileWriter.setCsvPreference(csvPreference); csvFileWriter.setCsvPreference(csvPreference);
@@ -629,10 +596,6 @@ public class SmartCSVController extends FXMLController {
//Show open file dialog //Show open file dialog
File file = fileChooser.showOpenDialog(applicationPane.getScene().getWindow()); File file = fileChooser.showOpenDialog(applicationPane.getScene().getWindow());
openFile(storageFile, file);
}
private void openFile(FileStorage storageFile, File file) {
if (file != null) { if (file != null) {
File previousFile = storageFile.getFile(); File previousFile = storageFile.getFile();
storageFile.setFile(file); storageFile.setFile(file);
@@ -711,8 +674,6 @@ public class SmartCSVController extends FXMLController {
tableView.getItems().setAll(currentCsvFile.getContent().getRows()); tableView.getItems().setAll(currentCsvFile.getContent().getRows());
tableView.setEditable(true); tableView.setEditable(true);
totalNumberOfLines.textProperty().setValue("" + currentCsvFile.getContent().getRows().size());
setBottomAnchor(tableView, 0.0); setBottomAnchor(tableView, 0.0);
setTopAnchor(tableView, 0.0); setTopAnchor(tableView, 0.0);
setLeftAnchor(tableView, 0.0); setLeftAnchor(tableView, 0.0);

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -34,15 +34,18 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.control.TextFormatter; import javafx.scene.control.TextFormatter;
import ninja.javafx.smartcsv.fx.FXMLController; import ninja.javafx.smartcsv.fx.FXMLController;
import ninja.javafx.smartcsv.preferences.Preferences;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.supercsv.prefs.CsvPreference;
import java.net.URL; import java.net.URL;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
import static ninja.javafx.smartcsv.preferences.QuoteModeHelper.getQuoteMode;
import static ninja.javafx.smartcsv.preferences.QuoteModeHelper.getQuoteModeName;
/** /**
* controller for preferences * controller for preferences
*/ */
@@ -55,9 +58,15 @@ public class PreferencesController extends FXMLController {
@FXML @FXML
private TextField delimiterChar; private TextField delimiterChar;
@FXML
private CheckBox surroundingSpacesNeedQuotes;
@FXML @FXML
private CheckBox ignoreEmptyLines; private CheckBox ignoreEmptyLines;
@FXML
private ComboBox<String> quoteMode;
@FXML @FXML
private ComboBox<String> fileEncoding; private ComboBox<String> fileEncoding;
@@ -74,6 +83,7 @@ public class PreferencesController extends FXMLController {
@Override @Override
public void initialize(URL location, ResourceBundle resources) { public void initialize(URL location, ResourceBundle resources) {
quoteMode.getItems().addAll("normal", "always", "column");
fileEncoding.getItems().addAll(Charset.availableCharsets().keySet()); fileEncoding.getItems().addAll(Charset.availableCharsets().keySet());
UnaryOperator<TextFormatter.Change> allowOnlyOneCharacter = change -> { UnaryOperator<TextFormatter.Change> allowOnlyOneCharacter = change -> {
@@ -92,23 +102,24 @@ public class PreferencesController extends FXMLController {
} }
private void revalidate() { private void revalidate() {
valid.setValue(quoteChar.getText().length() <= 1 && delimiterChar.getText().length() == 1); valid.setValue(quoteChar.getText().length() == 1 && delimiterChar.getText().length() == 1);
} }
public void setCsvPreference(Preferences csvPreference) { public void setCsvPreference(CsvPreference csvPreference) {
if (csvPreference.quoteChar() != null) { quoteChar.setText(Character.toString(csvPreference.getQuoteChar()));
quoteChar.setText(csvPreference.quoteChar().toString()); delimiterChar.setText(Character.toString((char)csvPreference.getDelimiterChar()));
} else { surroundingSpacesNeedQuotes.setSelected(csvPreference.isSurroundingSpacesNeedQuotes());
quoteChar.setText(""); ignoreEmptyLines.setSelected(csvPreference.isIgnoreEmptyLines());
} quoteMode.getSelectionModel().select(getQuoteModeName(csvPreference.getQuoteMode()));
delimiterChar.setText(Character.toString(csvPreference.delimiterChar())); endOfLineSymbols = csvPreference.getEndOfLineSymbols();
ignoreEmptyLines.setSelected(csvPreference.ignoreEmptyLines());
endOfLineSymbols = csvPreference.endOfLineSymbols();
} }
public Preferences getCsvPreference() { public CsvPreference getCsvPreference() {
var quote = quoteChar.getText().length() == 0 ? null : quoteChar.getText().charAt(0); return new CsvPreference.Builder(quoteChar.getText().charAt(0), delimiterChar.getText().charAt(0), endOfLineSymbols)
return new Preferences(quote, delimiterChar.getText().charAt(0), endOfLineSymbols, ignoreEmptyLines.isSelected()); .useQuoteMode(getQuoteMode(quoteMode.getSelectionModel().getSelectedItem()))
.surroundingSpacesNeedQuotes(surroundingSpacesNeedQuotes.isSelected())
.ignoreEmptyLines(ignoreEmptyLines.isSelected())
.build();
} }
public void setFileEncoding(String fileEncoding) { public void setFileEncoding(String fileEncoding) {

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -28,23 +28,27 @@ package ninja.javafx.smartcsv.preferences;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import ninja.javafx.smartcsv.FileReader; import ninja.javafx.smartcsv.FileReader;
import org.supercsv.prefs.CsvPreference;
import org.supercsv.quote.AlwaysQuoteMode;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static ninja.javafx.smartcsv.preferences.Preferences.defaultPreferences; import static ninja.javafx.smartcsv.preferences.QuoteModeHelper.getQuoteMode;
/** /**
* file reader for the preferences * file reader for the preferences
*/ */
public class PreferencesFileReader implements FileReader<Preferences> { public class PreferencesFileReader implements FileReader<CsvPreference> {
private Preferences csvPreference; private CsvPreference csvPreference;
public PreferencesFileReader() { public PreferencesFileReader() {
csvPreference = defaultPreferences(); csvPreference = new CsvPreference.
Builder(CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE).
useQuoteMode(new AlwaysQuoteMode()).build();
} }
@Override @Override
@@ -52,15 +56,22 @@ public class PreferencesFileReader implements FileReader<Preferences> {
Map config = new GsonBuilder().create().fromJson(new java.io.FileReader(filename), HashMap.class); Map config = new GsonBuilder().create().fromJson(new java.io.FileReader(filename), HashMap.class);
if (config != null) { if (config != null) {
Character quoteChar = config.get("quoteChar") == null ? null : config.get("quoteChar").toString().charAt(0); char quoteChar = config.get("quoteChar").toString().charAt(0);
char delimiterChar = config.get("delimiterChar").toString().charAt(0); char delimiterChar = config.get("delimiterChar").toString().charAt(0);
String endOfLineSymbols = config.get("endOfLineSymbols").toString(); String endOfLineSymbols = config.get("endOfLineSymbols").toString();
boolean surroundingSpacesNeedQuotes = (Boolean) config.get("surroundingSpacesNeedQuotes");
boolean ignoreEmptyLines = (Boolean) config.get("ignoreEmptyLines"); boolean ignoreEmptyLines = (Boolean) config.get("ignoreEmptyLines");
csvPreference = new Preferences(quoteChar, delimiterChar, endOfLineSymbols, ignoreEmptyLines); String quoteMode = config.get("quoteMode").toString();
csvPreference = new CsvPreference.Builder(quoteChar, delimiterChar, endOfLineSymbols)
.useQuoteMode(getQuoteMode(quoteMode))
.surroundingSpacesNeedQuotes(surroundingSpacesNeedQuotes)
.ignoreEmptyLines(ignoreEmptyLines)
.build();
} }
} }
public Preferences getContent() { public CsvPreference getContent() {
return csvPreference; return csvPreference;
} }

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +29,7 @@ package ninja.javafx.smartcsv.preferences;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import ninja.javafx.smartcsv.FileWriter; import ninja.javafx.smartcsv.FileWriter;
import org.supercsv.prefs.CsvPreference;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -39,20 +40,22 @@ import java.util.Map;
/** /**
* Save preferences to configuration file * Save preferences to configuration file
*/ */
public class PreferencesFileWriter implements FileWriter<Preferences> { public class PreferencesFileWriter implements FileWriter<CsvPreference> {
private Preferences csvPreference; private CsvPreference csvPreference;
public void setContent(Preferences csvPreference) { public void setContent(CsvPreference csvPreference) {
this.csvPreference = csvPreference; this.csvPreference = csvPreference;
} }
public void write(File file) throws IOException { public void write(File file) throws IOException {
Map<String, Object> preferences = new HashMap<>(); Map<String, Object> preferences = new HashMap<>();
preferences.put("quoteChar", csvPreference.quoteChar() == null ? null: csvPreference.quoteChar().toString()); preferences.put("quoteChar", Character.toString(csvPreference.getQuoteChar()));
preferences.put("delimiterChar", Character.toString((char)csvPreference.delimiterChar())); preferences.put("delimiterChar", Character.toString((char)csvPreference.getDelimiterChar()));
preferences.put("endOfLineSymbols", csvPreference.endOfLineSymbols()); preferences.put("endOfLineSymbols", csvPreference.getEndOfLineSymbols());
preferences.put("ignoreEmptyLines", csvPreference.ignoreEmptyLines()); preferences.put("surroundingSpacesNeedQuotes", csvPreference.isSurroundingSpacesNeedQuotes());
preferences.put("ignoreEmptyLines", csvPreference.isIgnoreEmptyLines());
preferences.put("quoteMode", QuoteModeHelper.getQuoteModeName(csvPreference.getQuoteMode()));
Gson gson = new GsonBuilder().setPrettyPrinting().create(); Gson gson = new GsonBuilder().setPrettyPrinting().create();
Files.write(file.toPath(), gson.toJson(preferences).getBytes()); Files.write(file.toPath(), gson.toJson(preferences).getBytes());

View File

@@ -2,8 +2,8 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
@@ -21,18 +21,36 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
package ninja.javafx.smartcsv.preferences; package ninja.javafx.smartcsv.preferences;
public record Preferences( import org.supercsv.quote.AlwaysQuoteMode;
Character quoteChar, import org.supercsv.quote.ColumnQuoteMode;
char delimiterChar, import org.supercsv.quote.NormalQuoteMode;
String endOfLineSymbols, import org.supercsv.quote.QuoteMode;
boolean ignoreEmptyLines) {
public static Preferences defaultPreferences() { /**
return new Preferences('\"',',', "\n", true); * Helper class for mapping quote quoteModeName
*/
public class QuoteModeHelper {
public static QuoteMode getQuoteMode(String quoteModeName) {
switch (quoteModeName) {
case "always": return new AlwaysQuoteMode();
case "column": return new ColumnQuoteMode();
default: return new NormalQuoteMode();
}
}
public static String getQuoteModeName(QuoteMode quoteMode) {
if (quoteMode instanceof AlwaysQuoteMode) {
return "always";
} else if (quoteMode instanceof ColumnQuoteMode) {
return "column";
} else {
return "normal";
}
} }
} }

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -61,8 +61,8 @@
<Hyperlink onAction="#openLinkInBrowser" text="http://www.groovy-lang.org/" GridPane.columnIndex="1" GridPane.rowIndex="2" /> <Hyperlink onAction="#openLinkInBrowser" text="http://www.groovy-lang.org/" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="spring framework" GridPane.rowIndex="3" /> <Label text="spring framework" GridPane.rowIndex="3" />
<Hyperlink onAction="#openLinkInBrowser" text="https://spring.io/" GridPane.columnIndex="1" GridPane.rowIndex="3" /> <Hyperlink onAction="#openLinkInBrowser" text="https://spring.io/" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="FastCSV" GridPane.rowIndex="4" /> <Label text="supercsv" GridPane.rowIndex="4" />
<Hyperlink onAction="#openLinkInBrowser" text="https://github.com/osiegmar/FastCSV" GridPane.columnIndex="1" GridPane.rowIndex="4" /> <Hyperlink onAction="#openLinkInBrowser" text="http://super-csv.github.io/super-csv/" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="Gson" GridPane.rowIndex="5" /> <Label text="Gson" GridPane.rowIndex="5" />
<Hyperlink onAction="#openLinkInBrowser" text="https://github.com/google/gson/" GridPane.columnIndex="1" GridPane.rowIndex="5" /> <Hyperlink onAction="#openLinkInBrowser" text="https://github.com/google/gson/" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label text="commons-validator" GridPane.rowIndex="6" /> <Label text="commons-validator" GridPane.rowIndex="6" />

View File

@@ -1,5 +1,5 @@
application.name = SmartCSV.fx application.name = SmartCSV.fx
application.version = 1.2.0 application.version = 1.0.0
# fxml views # fxml views
fxml.smartcvs.view = /ninja/javafx/smartcsv/fx/smartcsv.fxml fxml.smartcvs.view = /ninja/javafx/smartcsv/fx/smartcsv.fxml

View File

@@ -0,0 +1,34 @@
.root {
-fx-base: rgb(39, 40, 40);
-fx-accent: rgb(80, 80, 80);
-fx-default-button: rgb(39, 40, 40);
-fx-focus-color: rgb(80, 80, 80);
-fx-faint-focus-color: #efefef22;
-fx-focused-text-base-color : ladder(
-fx-selection-bar,
-fx-light-text-color 45%,
-fx-dark-text-color 46%,
-fx-dark-text-color 59%,
-fx-mid-text-color 60%
);
-fx-focused-mark-color : -fx-focused-text-base-color ;
-fx-control-inner-background: rgb(39, 40, 40);
-fx-control-inner-background-alt: rgb(20, 20, 20);
}
.table-row-cell:selected {
-fx-background-color: rgb(80, 80, 80);
}
.table-row-cell {
-fx-background-color: #81c483;
}
.text-input:focused {
-fx-highlight-text-fill: ladder(
-fx-highlight-fill,
-fx-light-text-color 45%,
-fx-dark-text-color 46%,
-fx-dark-text-color 59%,
-fx-mid-text-color 60%
);
}

View File

@@ -12,17 +12,23 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="NEVER" />
</rowConstraints> </rowConstraints>
<children> <children>
<Label text="%preferences.quoteChar" /> <Label text="%preferences.quoteChar" />
<TextField fx:id="quoteChar" GridPane.columnIndex="1" /> <TextField fx:id="quoteChar" GridPane.columnIndex="1" />
<Label text="%preferences.delimiterChar" GridPane.rowIndex="1" /> <Label text="%preferences.delimiterChar" GridPane.rowIndex="1" />
<TextField fx:id="delimiterChar" GridPane.columnIndex="1" GridPane.rowIndex="1" /> <TextField fx:id="delimiterChar" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="%preferences.ignoreEmptyLines" GridPane.rowIndex="2" /> <Label text="%preferences.surroundingSpacesNeedQuotes" GridPane.rowIndex="2" />
<CheckBox fx:id="ignoreEmptyLines" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" /> <CheckBox fx:id="surroundingSpacesNeedQuotes" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="%preferences.fileEncoding" GridPane.rowIndex="3" /> <Label text="%preferences.ignoreEmptyLines" GridPane.rowIndex="3" />
<ComboBox fx:id="fileEncoding" editable="true" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="3" /> <CheckBox fx:id="ignoreEmptyLines" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="%preferences.quoteMode" GridPane.rowIndex="4" />
<ComboBox fx:id="quoteMode" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="%preferences.fileEncoding" GridPane.rowIndex="5" />
<ComboBox fx:id="fileEncoding" editable="true" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
</children> </children>
<padding> <padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" /> <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />

View File

@@ -5,6 +5,7 @@
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import java.net.URL?>
<BorderPane fx:id="applicationPane" maxHeight="-Infinity" maxWidth="1000.0" minHeight="700.0" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.101" xmlns:fx="http://javafx.com/fxml/1"> <BorderPane fx:id="applicationPane" maxHeight="-Infinity" maxWidth="1000.0" minHeight="700.0" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.101" xmlns:fx="http://javafx.com/fxml/1">
<top> <top>
<VBox id="background" prefWidth="100.0" BorderPane.alignment="CENTER"> <VBox id="background" prefWidth="100.0" BorderPane.alignment="CENTER">
@@ -264,6 +265,10 @@
</center> </center>
<left> <left>
</left> </left>
<stylesheets>
<URL value="@/ninja/javafx/smartcsv/fx/dark-theme.css" />
<URL value="@/ninja/javafx/smartcsv/fx/smartcsv.css" />
</stylesheets>
<bottom> <bottom>
<GridPane hgap="8.0" BorderPane.alignment="CENTER"> <GridPane hgap="8.0" BorderPane.alignment="CENTER">
<columnConstraints> <columnConstraints>
@@ -275,9 +280,7 @@
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" /> <ColumnConstraints hgrow="ALWAYS" minWidth="10.0" />
<ColumnConstraints hgrow="NEVER" minWidth="10.0" /> <ColumnConstraints hgrow="NEVER" minWidth="10.0" />
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
@@ -291,8 +294,6 @@
<Label fx:id="configurationName" GridPane.columnIndex="5" GridPane.hgrow="ALWAYS" /> <Label fx:id="configurationName" GridPane.columnIndex="5" GridPane.hgrow="ALWAYS" />
<Label text="%lineNumber" GridPane.columnIndex="7" /> <Label text="%lineNumber" GridPane.columnIndex="7" />
<Label fx:id="currentLineNumber" text="" GridPane.columnIndex="8" /> <Label fx:id="currentLineNumber" text="" GridPane.columnIndex="8" />
<Label text="%totalNumberOfLines" GridPane.columnIndex="9" />
<Label fx:id="totalNumberOfLines" text="0" GridPane.columnIndex="10" />
</children> </children>
<BorderPane.margin> <BorderPane.margin>
<Insets bottom="4.0" left="8.0" right="8.0" top="4.0" /> <Insets bottom="4.0" left="8.0" right="8.0" top="4.0" />

View File

@@ -87,7 +87,6 @@ dialog.validation.rules.header = Validation rules of column "{0}"
context.menu.edit.column.rules = Edit rules context.menu.edit.column.rules = Edit rules
lineNumber = Selected line: lineNumber = Selected line:
totalNumberOfLines = Lines:
log.header.message = {0} has {1} errors log.header.message = {0} has {1} errors
log.message = row {0} column {1} : {2} log.message = row {0} column {1} : {2}

View File

@@ -97,7 +97,6 @@ dialog.validation.rules.header = Pr\u00fcfregeln f\u00fcr die Spalte "{0}"
context.menu.edit.column.rules = Pr\u00fcfregeln bearbeiten context.menu.edit.column.rules = Pr\u00fcfregeln bearbeiten
lineNumber = Ausgew\u00e4hlte Zeile: lineNumber = Ausgew\u00e4hlte Zeile:
totalNumberOfLines = Zeilen:
log.header.message = {0} hat {1} Fehler log.header.message = {0} hat {1} Fehler
log.message = Zeile {0} Spalte {1} : {2} log.message = Zeile {0} Spalte {1} : {2}

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -28,9 +28,8 @@ package ninja.javafx.smartcsv.fx.table.model;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
/** /**
* unit test for the csv model * unit test for the csv model

View File

@@ -2,10 +2,9 @@ package ninja.javafx.smartcsv.fx.table.model;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
/** /**
* unit test for row class * unit test for row class

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -2,7 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Copyright (c) 2015-2021 javafx.ninja <info@javafx.ninja> Copyright (c) 2015-2019 javafx.ninja <info@javafx.ninja>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -38,10 +38,9 @@ import java.util.stream.Stream;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/** /**
* unit test for header validator * unit test for header validator

View File

@@ -12,9 +12,9 @@ import java.util.stream.Stream;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.joining;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
/** /**
* unit test for validator * unit test for validator