read and edit csv preferences

This commit is contained in:
Andreas Billmann
2016-01-11 09:03:22 +01:00
parent 5762354d19
commit 789c5012a4
14 changed files with 391 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ application.version = 0.2
# fxml views
fxml.smartcvs.view = /ninja/javafx/smartcsv/fx/smartcsv.fxml
fxml.smartcvs.about.view = /ninja/javafx/smartcsv/fx/about/about.fxml
fxml.smartcvs.preferences.view = /ninja/javafx/smartcsv/fx/preferences/preferences.fxml
# resources
resource.main = ninja.javafx.smartcsv.fx.smartcsv

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<GridPane hgap="8.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" vgap="8.0" xmlns="http://javafx.com/javafx/8.0.66" xmlns:fx="http://javafx.com/fxml/1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<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>
<children>
<Label text="%preferences.quoteChar" />
<TextField fx:id="quoteChar" GridPane.columnIndex="1" />
<Label text="%preferences.delimiterChar" GridPane.rowIndex="1" />
<TextField fx:id="delimiterChar" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="%preferences.surroundingSpacesNeedQuotes" GridPane.rowIndex="2" />
<CheckBox fx:id="surroundingSpacesNeedQuotes" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="%preferences.ignoreEmptyLines" 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" />
</children>
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</padding>
</GridPane>

View File

@@ -0,0 +1,8 @@
{
"quoteChar" : "\"",
"delimiterChar" : ";",
"endOfLineSymbols" : "\n",
"surroundingSpacesNeedQuotes" : true,
"ignoreEmptyLines" : true,
"quoteMode" : "always"
}

View File

@@ -44,4 +44,7 @@
-glyph-size: 14px;
}
.preferences-icon {
-glyph-name: "COG";
-glyph-size: 14px;
}

View File

@@ -40,6 +40,12 @@
</graphic>
</MenuItem>
<SeparatorMenuItem mnemonicParsing="false"/>
<MenuItem mnemonicParsing="false" onAction="#preferences" text="%menu.preferences">
<graphic>
<FontAwesomeIconView styleClass="preferences-icon"/>
</graphic>
</MenuItem>
<SeparatorMenuItem mnemonicParsing="false"/>
<MenuItem mnemonicParsing="false" onAction="#close" text="%menu.close">
<graphic>
<FontAwesomeIconView styleClass="exit-icon"/>

View File

@@ -7,6 +7,7 @@ menu.about = About
menu.file = File
menu.edit = Edit
menu.help = Help
menu.preferences = Preferences
title.validation.errors = Validation Errors:
stateline.csv = CSV:
@@ -20,6 +21,12 @@ dialog.exit.title = Close Application
dialog.exit.header.text = Do you want to close application?
dialog.exit.text = There are changes made to the csv file. If you close now, the changes are lost!
preferences.quoteChar = Quote character:
preferences.delimiterChar = Delimiter character:
preferences.ignoreEmptyLines = Ignore empty lines:
preferences.surroundingSpacesNeedQuotes = Surrounding spaces need quotes:
preferences.quoteMode = Quote mode:
# validaton messages
validation.message.not.empty = should not be empty
validation.message.integer = should be an integer

View File

@@ -15,6 +15,7 @@ menu.about = \u00dcber ...
menu.file = Datei
menu.edit = Bearbeiten
menu.help = Hilfe
menu.preferences = Einstellungen
title.validation.errors = Fehler in der Datei:
stateline.csv = CSV: