1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-06-23 11:17:06 -07:00

Add the apply warnings when switching tabs.

This commit is contained in:
Danila Fedorin 2017-08-03 18:16:48 -07:00
parent 0bade4a7df
commit 8ae28f2dab
2 changed files with 12 additions and 3 deletions

View File

@ -46,6 +46,12 @@ public class AbacusController implements PluginListener {
*/
private static final String ERR_EVAL = "Evaluation Error";
@FXML
private TabPane coreTabPane;
@FXML
private Tab calculateTab;
@FXML
private Tab settingsTab;
@FXML
private TableView<HistoryModel> historyTable;
@FXML
@ -143,6 +149,9 @@ public class AbacusController implements PluginListener {
parsedColumn.setCellValueFactory(cell -> cell.getValue().parsedProperty());
outputColumn.setCellFactory(cellFactory);
outputColumn.setCellValueFactory(cell -> cell.getValue().outputProperty());
coreTabPane.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if(oldValue.equals(settingsTab)) alertIfApplyNeeded(true);
});
abacus = new Abacus();
abacus.getPluginManager().addListener(this);

View File

@ -11,8 +11,8 @@
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.nwapw.abacus.fx.AbacusController">
<center>
<TabPane>
<Tab text="Calculator" closable="false">
<TabPane fx:id="coreTabPane">
<Tab fx:id="calculateTab" text="Calculator" closable="false">
<BorderPane>
<center>
<TableView fx:id="historyTable">
@ -41,7 +41,7 @@
</bottom>
</BorderPane>
</Tab>
<Tab text="Settings" closable="false">
<Tab fx:id="settingsTab" text="Settings" closable="false">
<GridPane hgap="10" vgap="10">
<padding><Insets left="10" right="10" top="10" bottom="10"/></padding>
<Label text="Number Implementation" GridPane.columnIndex="0" GridPane.rowIndex="0"/>