mirror of
https://github.com/frosch95/SmartCSV.fx.git
synced 2026-04-11 13:38:23 +02:00
added toolbar
This commit is contained in:
@@ -141,6 +141,12 @@ public class SmartCSVController extends FXMLController {
|
|||||||
@FXML
|
@FXML
|
||||||
private MenuItem saveAsMenuItem;
|
private MenuItem saveAsMenuItem;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button saveButton;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button saveAsButton;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// members
|
// members
|
||||||
@@ -290,6 +296,8 @@ public class SmartCSVController extends FXMLController {
|
|||||||
if (currentCsvFile != null) {
|
if (currentCsvFile != null) {
|
||||||
saveMenuItem.setDisable(false);
|
saveMenuItem.setDisable(false);
|
||||||
saveAsMenuItem.setDisable(false);
|
saveAsMenuItem.setDisable(false);
|
||||||
|
saveButton.setDisable(false);
|
||||||
|
saveAsButton.setDisable(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,81 @@
|
|||||||
-glyph-name: "COG";
|
-glyph-name: "COG";
|
||||||
-glyph-size: 14px;
|
-glyph-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* toolbar customization based on http://fxexperience.com/2012/02/customized-segmented-toolbar-buttons/ */
|
||||||
|
|
||||||
|
#background {
|
||||||
|
-light-black: rgb(74, 75, 78);
|
||||||
|
-dark-highlight: rgb(87, 89, 92);
|
||||||
|
-dark-black: rgb(39, 40, 40);
|
||||||
|
-darkest-black: rgb(5, 5, 5);
|
||||||
|
-mid-gray: rgb(216, 222, 227);
|
||||||
|
-fx-background-color: -mid-gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar {
|
||||||
|
-fx-base: -dark-black;
|
||||||
|
-fx-font-size: 12px;
|
||||||
|
-fx-background-color:
|
||||||
|
linear-gradient(to bottom, derive(-fx-base,-30%), derive(-fx-base,-60%)),
|
||||||
|
linear-gradient(to bottom, -light-black 2%, -dark-black 98%);
|
||||||
|
-fx-background-insets: 0, 0 0 1 0;
|
||||||
|
-fx-padding: .6em 0.416667em .6em 0.416667em;
|
||||||
|
-fx-effect: dropshadow(two-pass-box,black,5,.2,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar .open-icon {
|
||||||
|
-glyph-size: 16px;
|
||||||
|
-fx-fill: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar .config-icon {
|
||||||
|
-glyph-size: 16px;
|
||||||
|
-fx-fill: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar .save-icon {
|
||||||
|
-glyph-size: 16px;
|
||||||
|
-fx-fill: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar .preferences-icon {
|
||||||
|
-glyph-size: 16px;
|
||||||
|
-fx-fill: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-bar .exit-icon {
|
||||||
|
-glyph-size: 16px;
|
||||||
|
-fx-fill: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmented-button-bar .button {
|
||||||
|
-fx-background-color:
|
||||||
|
-darkest-black,
|
||||||
|
-dark-highlight,
|
||||||
|
linear-gradient(to bottom, -light-black 2%, -dark-black 98%);
|
||||||
|
-fx-background-insets: 0, 1 1 1 0, 2 1 1 1;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-padding: 0.4em 1.833333em 0.4em 1.833333em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmented-button-bar .button.first {
|
||||||
|
-fx-background-insets: 0, 1, 2 1 1 1;
|
||||||
|
-fx-background-radius: 3 0 0 3, 2 0 0 2, 2 0 0 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmented-button-bar .button.last {
|
||||||
|
-fx-background-insets: 0, 1 1 1 0, 2 1 1 1;
|
||||||
|
-fx-background-radius: 0 3 3 0, 0 2 2 0, 0 2 2 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmented-button-bar .button:pressed {
|
||||||
|
-fx-background-color:
|
||||||
|
-darkest-black,
|
||||||
|
rgb(55, 57, 58),
|
||||||
|
linear-gradient(to top, -light-black 2%, -dark-black 98%);
|
||||||
|
}
|
||||||
|
.tool-bar .spacer {
|
||||||
|
-fx-padding: 0 5.417em 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,72 +1,123 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import java.net.*?>
|
||||||
|
<?import javafx.geometry.*?>
|
||||||
<?import de.jensd.fx.glyphs.fontawesome.*?>
|
<?import de.jensd.fx.glyphs.fontawesome.*?>
|
||||||
<?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?>
|
<?import java.net.URL?>
|
||||||
<BorderPane fx:id="applicationPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
|
|
||||||
minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.66"
|
<BorderPane fx:id="applicationPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.66" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
xmlns:fx="http://javafx.com/fxml/1">
|
|
||||||
<top>
|
<top>
|
||||||
<VBox prefWidth="100.0" BorderPane.alignment="CENTER">
|
<VBox prefWidth="100.0" BorderPane.alignment="CENTER" id="background">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar>
|
<MenuBar>
|
||||||
<menus>
|
<menus>
|
||||||
<Menu mnemonicParsing="false" text="%menu.file">
|
<Menu mnemonicParsing="false" text="%menu.file">
|
||||||
<graphic>
|
|
||||||
<FontAwesomeIconView styleClass="save-icon"/>
|
|
||||||
</graphic>
|
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#openCsv" text="%menu.open.csv">
|
<MenuItem mnemonicParsing="false" onAction="#openCsv" text="%menu.open.csv">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="open-icon"/>
|
<FontAwesomeIconView styleClass="open-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#openConfig" text="%menu.open.config">
|
<MenuItem mnemonicParsing="false" onAction="#openConfig" text="%menu.open.config">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="config-icon"/>
|
<FontAwesomeIconView styleClass="config-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<SeparatorMenuItem mnemonicParsing="false"/>
|
<SeparatorMenuItem mnemonicParsing="false" />
|
||||||
<MenuItem fx:id="saveMenuItem" mnemonicParsing="false" onAction="#saveCsv" text="%menu.save" disable="true">
|
<MenuItem fx:id="saveMenuItem" disable="true" mnemonicParsing="false" onAction="#saveCsv" text="%menu.save">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="save-icon"/>
|
<FontAwesomeIconView styleClass="save-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem fx:id="saveAsMenuItem" mnemonicParsing="false" onAction="#saveAsCsv" text="%menu.save.as" disable="true">
|
<MenuItem fx:id="saveAsMenuItem" disable="true" mnemonicParsing="false" onAction="#saveAsCsv" text="%menu.save.as">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="save-icon"/>
|
<FontAwesomeIconView styleClass="save-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<SeparatorMenuItem mnemonicParsing="false"/>
|
<SeparatorMenuItem mnemonicParsing="false" />
|
||||||
<MenuItem mnemonicParsing="false" onAction="#preferences" text="%menu.preferences">
|
<MenuItem mnemonicParsing="false" onAction="#preferences" text="%menu.preferences">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="preferences-icon"/>
|
<FontAwesomeIconView styleClass="preferences-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<SeparatorMenuItem mnemonicParsing="false"/>
|
<SeparatorMenuItem mnemonicParsing="false" />
|
||||||
<MenuItem mnemonicParsing="false" onAction="#close" text="%menu.close">
|
<MenuItem mnemonicParsing="false" onAction="#close" text="%menu.close">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="exit-icon"/>
|
<FontAwesomeIconView styleClass="exit-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="%menu.help">
|
<Menu mnemonicParsing="false" text="%menu.help">
|
||||||
<graphic>
|
|
||||||
<FontAwesomeIconView styleClass="info-icon"/>
|
|
||||||
</graphic>
|
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#about" text="%menu.about">
|
<MenuItem mnemonicParsing="false" onAction="#about" text="%menu.about">
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="info-icon"/>
|
<FontAwesomeIconView styleClass="info-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
</menus>
|
</menus>
|
||||||
</MenuBar>
|
</MenuBar>
|
||||||
|
<ToolBar prefHeight="40.0" prefWidth="200.0">
|
||||||
|
<HBox styleClass="segmented-button-bar">
|
||||||
|
<Button mnemonicParsing="false" onAction="#openCsv" styleClass="first">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.open.csv" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="open-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
<Button mnemonicParsing="false" onAction="#openConfig">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.open.config" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="config-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
<Button fx:id="saveButton" disable="true" mnemonicParsing="false" onAction="#saveCsv">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.save" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="save-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
<Button fx:id="saveAsButton" disable="true" mnemonicParsing="false" onAction="#saveAsCsv" text="..." styleClass="last">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.save.as" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="save-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
</HBox>
|
||||||
|
<Region styleClass="spacer" />
|
||||||
|
<HBox styleClass="segmented-button-bar">
|
||||||
|
<Button mnemonicParsing="false" onAction="#preferences" styleClass="first">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.preferences" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="preferences-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
<Button mnemonicParsing="false" onAction="#close" styleClass="last">
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="%menu.close" />
|
||||||
|
</tooltip>
|
||||||
|
<graphic>
|
||||||
|
<FontAwesomeIconView styleClass="exit-icon" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
</HBox>
|
||||||
|
</ToolBar>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</top>
|
</top>
|
||||||
@@ -74,9 +125,7 @@
|
|||||||
<SplitPane dividerPositions="0.8" prefHeight="160.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
<SplitPane dividerPositions="0.8" prefHeight="160.0" prefWidth="200.0" BorderPane.alignment="CENTER">
|
||||||
<items>
|
<items>
|
||||||
<AnchorPane fx:id="tableWrapper">
|
<AnchorPane fx:id="tableWrapper">
|
||||||
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0"
|
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" BorderPane.alignment="CENTER">
|
||||||
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
|
|
||||||
BorderPane.alignment="CENTER">
|
|
||||||
<columns>
|
<columns>
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
@@ -85,13 +134,13 @@
|
|||||||
<children>
|
<children>
|
||||||
<Label text="%title.validation.errors">
|
<Label text="%title.validation.errors">
|
||||||
<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" />
|
||||||
</padding>
|
</padding>
|
||||||
<graphic>
|
<graphic>
|
||||||
<FontAwesomeIconView styleClass="error-title-icon"/>
|
<FontAwesomeIconView styleClass="error-title-icon" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</Label>
|
</Label>
|
||||||
<ListView fx:id="errorList" minWidth="10.0" prefWidth="200.0" VBox.vgrow="ALWAYS"/>
|
<ListView fx:id="errorList" minWidth="10.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</items>
|
</items>
|
||||||
@@ -100,35 +149,35 @@
|
|||||||
<left>
|
<left>
|
||||||
</left>
|
</left>
|
||||||
<stylesheets>
|
<stylesheets>
|
||||||
<URL value="@/ninja/javafx/smartcsv/fx/smartcsv.css"/>
|
<URL value="@/ninja/javafx/smartcsv/fx/smartcsv.css" />
|
||||||
</stylesheets>
|
</stylesheets>
|
||||||
<bottom>
|
<bottom>
|
||||||
<GridPane hgap="8.0" BorderPane.alignment="CENTER">
|
<GridPane hgap="8.0" BorderPane.alignment="CENTER">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="NEVER" minWidth="10.0"/>
|
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
|
||||||
<ColumnConstraints hgrow="NEVER" minWidth="10.0"/>
|
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0"/>
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
|
||||||
<ColumnConstraints hgrow="NEVER" minWidth="10.0"/>
|
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0"/>
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
|
||||||
<ColumnConstraints hgrow="NEVER" minWidth="10.0"/>
|
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
|
||||||
<ColumnConstraints hgrow="NEVER" minWidth="10.0"/>
|
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" 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" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<FontAwesomeIconView styleClass="open-icon" GridPane.hgrow="NEVER"/>
|
<FontAwesomeIconView styleClass="open-icon" GridPane.hgrow="NEVER" />
|
||||||
<Label text="%stateline.csv" GridPane.columnIndex="1" GridPane.hgrow="NEVER"/>
|
<Label text="%stateline.csv" GridPane.columnIndex="1" GridPane.hgrow="NEVER" />
|
||||||
<Label fx:id="csvName" GridPane.columnIndex="2" GridPane.hgrow="ALWAYS"/>
|
<Label fx:id="csvName" GridPane.columnIndex="2" GridPane.hgrow="ALWAYS" />
|
||||||
<Label text="%stateline.state" GridPane.columnIndex="3" GridPane.hgrow="NEVER"/>
|
<Label text="%stateline.state" GridPane.columnIndex="3" GridPane.hgrow="NEVER" />
|
||||||
<Label fx:id="stateName" GridPane.columnIndex="4" GridPane.hgrow="ALWAYS"/>
|
<Label fx:id="stateName" GridPane.columnIndex="4" GridPane.hgrow="ALWAYS" />
|
||||||
<FontAwesomeIconView styleClass="open-icon" GridPane.columnIndex="5" GridPane.hgrow="NEVER"/>
|
<FontAwesomeIconView styleClass="open-icon" GridPane.columnIndex="5" GridPane.hgrow="NEVER" />
|
||||||
<Label text="%stateline.configuration" GridPane.columnIndex="6" GridPane.hgrow="NEVER"/>
|
<Label text="%stateline.configuration" GridPane.columnIndex="6" GridPane.hgrow="NEVER" />
|
||||||
<Label fx:id="configurationName" GridPane.columnIndex="7" GridPane.hgrow="ALWAYS"/>
|
<Label fx:id="configurationName" GridPane.columnIndex="7" GridPane.hgrow="ALWAYS" />
|
||||||
</children>
|
</children>
|
||||||
<BorderPane.margin>
|
<BorderPane.margin>
|
||||||
<Insets top="4.0" left="8.0" bottom="4.0" right="8.0"/>
|
<Insets bottom="4.0" left="8.0" right="8.0" top="4.0" />
|
||||||
</BorderPane.margin>
|
</BorderPane.margin>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</bottom>
|
</bottom>
|
||||||
|
|||||||
Reference in New Issue
Block a user