From 0b616d803c4472e628f744df5231e549f47688eb Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Fri, 4 Mar 2016 14:15:44 +0100 Subject: [PATCH] Updtate the query textArea when selecting a new service. --- src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java | 1 + src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java | 7 +++++++ src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java b/src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java index bfbb909..e791014 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/controller/EpnTapController.java @@ -95,6 +95,7 @@ public class EpnTapController { if (!tableName.equals(selectedTableName)) { selectedTableServiceURL = serviceURL; selectedTableName = tableName; + view.getRequestView().updateQueryArea(); logger.info("Selected table: " + selectedTableName + " - service: " + selectedTableServiceURL); } diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java index 38322e8..cff47dd 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java @@ -107,6 +107,13 @@ public class EpnTapMainView extends JPanel { } /** + * @return The JPanel where the GUI elements to make the request are displayed. + */ + public RequestView getRequestView() { + return requestView; + } + + /** * @return The JPanel where the list of services is displayed. */ public VOTableView getServicesView() { diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java index 97c8cd8..8613f4e 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java @@ -189,7 +189,7 @@ public class RequestView extends JPanel implements ActionListener { /** * Update the query JTextArea according to the parameters values. */ - private void updateQueryArea() { + public void updateQueryArea() { String tableName = mainView.getController().getSelectedTable(); queryArea.setText(Queries.getQuery(tableName, params, 10)); } -- libgit2 0.21.2