1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-12-23 00:43:32 +01:00

Fixed Save menuItem bug

This commit is contained in:
Carlos Galindo 2016-06-12 00:40:59 +02:00
parent ebe97fa49a
commit 9c80a1d722
Signed by: kauron
GPG key ID: 83E68706DEE119A3

View file

@ -40,10 +40,9 @@ public class Controller implements Initializable {
@Override @Override
public void initialize(URL url, ResourceBundle resourceBundle) { public void initialize(URL url, ResourceBundle resourceBundle) {
tabPane.getSelectionModel().selectedItemProperty().addListener((change, o, n) -> { tabPane.getSelectionModel().selectedItemProperty().addListener((change, o, n) -> {
if (n.getContent().getId() != null) { if (tabMap.get(n) != null) {
table.set(true); table.set(true);
root.getTop().autosize(); } else table.set(false);
}
}); });
saveMenu.disableProperty().bind(table.not()); saveMenu.disableProperty().bind(table.not());
} }
@ -81,7 +80,6 @@ public class Controller implements Initializable {
private Tab createTableTab(String name, List<TestItem> list) { private Tab createTableTab(String name, List<TestItem> list) {
try { try {
Tab tab = new Tab(name); Tab tab = new Tab(name);
tab.setId("table" + tab.hashCode());
FXMLLoader loader = new FXMLLoader(Main.class.getResource("view/table.fxml")); FXMLLoader loader = new FXMLLoader(Main.class.getResource("view/table.fxml"));
Parent tableRoot = loader.load(); Parent tableRoot = loader.load();