From c3c80d643ebdbd0ecddba245350f6890fa2e70a1 Mon Sep 17 00:00:00 2001 From: Rohit Awate Date: Mon, 30 Jul 2018 18:31:29 +0530 Subject: [PATCH] Fix issue where the only KeyValue field in the tab would display its deleteButton --- .../everest/controllers/DashboardController.java | 3 ++- .../everest/controllers/FormDataTabController.java | 8 ++++++-- .../everest/controllers/HeaderTabController.java | 3 ++- .../rohitawate/everest/controllers/URLTabController.java | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java index 4d57714..aeaf040 100644 --- a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java +++ b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java @@ -147,7 +147,7 @@ public class DashboardController implements Initializable { httpMethodBox.getSelectionModel().select("GET"); paramsControllers = new ArrayList<>(); - paramsCountProperty = new SimpleIntegerProperty(paramsControllers.size()); + paramsCountProperty = new SimpleIntegerProperty(0); appendedParams = new ArrayList<>(); addParamField(); // Adds a blank param field @@ -811,6 +811,7 @@ public class DashboardController implements Initializable { paramsControllers.clear(); paramsBox.getChildren().clear(); + paramsCountProperty.set(0); addParamField(); } } diff --git a/src/main/java/com/rohitawate/everest/controllers/FormDataTabController.java b/src/main/java/com/rohitawate/everest/controllers/FormDataTabController.java index 60a9077..de9256b 100644 --- a/src/main/java/com/rohitawate/everest/controllers/FormDataTabController.java +++ b/src/main/java/com/rohitawate/everest/controllers/FormDataTabController.java @@ -51,10 +51,10 @@ public class FormDataTabController implements Initializable { @Override public void initialize(URL location, ResourceBundle resources) { stringControllers = new ArrayList<>(); - stringControllersCount = new SimpleIntegerProperty(stringControllers.size()); + stringControllersCount = new SimpleIntegerProperty(0); fileControllers = new ArrayList<>(); - fileControllersCount = new SimpleIntegerProperty(fileControllers.size()); + fileControllersCount = new SimpleIntegerProperty(0); addFileField(); addStringField(); @@ -236,6 +236,10 @@ public class FormDataTabController implements Initializable { fileControllers.clear(); fieldsBox.getChildren().clear(); + + stringControllersCount.set(0); + fileControllersCount.set(0); + addStringField(); addFileField(); } diff --git a/src/main/java/com/rohitawate/everest/controllers/HeaderTabController.java b/src/main/java/com/rohitawate/everest/controllers/HeaderTabController.java index 24df3b7..6c604f3 100644 --- a/src/main/java/com/rohitawate/everest/controllers/HeaderTabController.java +++ b/src/main/java/com/rohitawate/everest/controllers/HeaderTabController.java @@ -49,7 +49,7 @@ public class HeaderTabController implements Initializable { @Override public void initialize(URL location, ResourceBundle resources) { controllers = new ArrayList<>(); - controllersCount = new SimpleIntegerProperty(controllers.size()); + controllersCount = new SimpleIntegerProperty(0); addHeader(); } @@ -141,6 +141,7 @@ public class HeaderTabController implements Initializable { controllers.clear(); headersBox.getChildren().clear(); + controllersCount.set(0); addHeader(); } } \ No newline at end of file diff --git a/src/main/java/com/rohitawate/everest/controllers/URLTabController.java b/src/main/java/com/rohitawate/everest/controllers/URLTabController.java index 6683606..7364eff 100644 --- a/src/main/java/com/rohitawate/everest/controllers/URLTabController.java +++ b/src/main/java/com/rohitawate/everest/controllers/URLTabController.java @@ -142,6 +142,7 @@ public class URLTabController implements Initializable { controllers.clear(); fieldsBox.getChildren().clear(); + controllersCount.set(0); addField(); } }