From fee11d218380c09929b94b3319ff3d69cd3ee178 Mon Sep 17 00:00:00 2001 From: Loredana Liccardo Date: Mon, 14 Jul 2014 12:59:12 +0000 Subject: [PATCH] bug fixed for operation related to the get tables list. git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98597 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/panels/GxtBorderLayoutPanel.java | 177 +++++++++++++----- 1 file changed, 127 insertions(+), 50 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java index 74f39f3..134d82d 100644 --- a/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java +++ b/src/main/java/org/gcube/portlets/user/databasesmanager/client/panels/GxtBorderLayoutPanel.java @@ -456,6 +456,18 @@ public class GxtBorderLayoutPanel extends ContentPanel { private void loadTables() { // System.out.println("Start RPC - loadTables"); + + + //clean variable + selectedTable = null; + + // disable table details and sampling buttons + toolbar.disableButtonsOperationsOnTable(); + + + //clean the panel + centerBottom.removeAll(); + centerBottom.layout(true); rootLogger.log(Level.SEVERE, "Start RPC - loadTables"); @@ -982,63 +994,128 @@ public class GxtBorderLayoutPanel extends ContentPanel { // listener to manage the table selection in the grid - tablesLoaded.getButtonById(Dialog.OK).addSelectionListener( - new SelectionListener() { + Button ok = (Button) tablesLoaded.getButtonBar().getWidget(0); + rootLogger.log(Level.INFO, "button: " + ok.getText()); + + Button cancel = (Button) tablesLoaded.getButtonBar().getWidget(1); + rootLogger.log(Level.INFO, "button: " + cancel.getText()); + + ok.addSelectionListener(new SelectionListener() { + + @Override + public void componentSelected(ButtonEvent ce) { + // TODO Auto-generated method stub + + Listener l = new Listener() { @Override - public void componentSelected(ButtonEvent ce) { + public void handleEvent(MessageBoxEvent be) { + // TODO Auto-generated method stub - // selectedTable = be.getValue().toString(); +// rootLogger.log(Level.INFO, "button clicked"); - Listener l = new Listener() { - - @Override - public void handleEvent(MessageBoxEvent be) { - // TODO Auto-generated method stub - - rootLogger.log(Level.INFO, "button clicked"); - - eventBus.fireEvent(new SelectedTableEvent()); - - } - }; - - if (selectedTable != null) { - - // MessageBox.alert("Information", - // "The table "+selectedTable+ " was selected", - // null); - - MessageBox.info("Information", "The table " - + selectedTable + " was selected", l); - - // eventBus.fireEvent(new SelectedTableEvent()); - - } else { - - // MessageBox.alert("Warning", - // "No table "+selectedTable+ " was selected", - // null); - - MessageBox.info("Information", - "No table was selected", null); - - } + eventBus.fireEvent(new SelectedTableEvent()); } - }); + }; -// tablesLoaded.getButtonById("CANCEL").addSelectionListener( -// new SelectionListener() { -// -// @Override -// public void componentSelected(ButtonEvent ce) { -// // TODO Auto-generated method stub -// -// tablesLoaded.hide(); -// -// } -// }); + if (selectedTable != null) { + + // MessageBox.alert("Information", + // "The table "+selectedTable+ " was selected", + // null); + + MessageBox.info("Information", "The table " + selectedTable + + " was selected", l); + + // eventBus.fireEvent(new SelectedTableEvent()); + + } else { + + // MessageBox.alert("Warning", + // "No table "+selectedTable+ " was selected", + // null); + + MessageBox.info("Information", "No table was selected", + null); + + } + + } + }); + + cancel.addSelectionListener(new SelectionListener() { + + @Override + public void componentSelected(ButtonEvent ce) { + // TODO Auto-generated method stub + +// selectedTable = null; + + tablesLoaded.hide(); + + + + } + }); + + // tablesLoaded.getButtonById(Dialog.OK).addSelectionListener( + // new SelectionListener() { + // + // @Override + // public void componentSelected(ButtonEvent ce) { + // + // // selectedTable = be.getValue().toString(); + // + // Listener l = new Listener() { + // + // @Override + // public void handleEvent(MessageBoxEvent be) { + // // TODO Auto-generated method stub + // + // rootLogger.log(Level.INFO, "button clicked"); + // + // eventBus.fireEvent(new SelectedTableEvent()); + // + // } + // }; + // + // if (selectedTable != null) { + // + // // MessageBox.alert("Information", + // // "The table "+selectedTable+ " was selected", + // // null); + // + // MessageBox.info("Information", "The table " + // + selectedTable + " was selected", l); + // + // // eventBus.fireEvent(new SelectedTableEvent()); + // + // } else { + // + // // MessageBox.alert("Warning", + // // "No table "+selectedTable+ " was selected", + // // null); + // + // MessageBox.info("Information", + // "No table was selected", null); + // + // } + // + // } + // }); + + // tablesLoaded.getButtonById("CANCEL").addSelectionListener( + // new SelectionListener() { + // + // @Override + // public void componentSelected(ButtonEvent ce) { + // // TODO Auto-generated method stub + // + // tablesLoaded.hide(); + // + // } + // }); tablesLoaded.show();