From 2a9b3e4a2ad774862f455d19e47619fe50405fa2 Mon Sep 17 00:00:00 2001 From: Loredana Liccardo Date: Wed, 22 Oct 2014 17:15:09 +0000 Subject: [PATCH] bug fixed in class GxtBorderLayout in order to manage the copy of grid elements correctly. An element copy has been managed setting a grid property named disbleTextSelection and not through the double click and the edit event. Object EditorGrid changed in Grid in order to display a table name, information of a database and for table details while for the tables list it remains. git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@100895 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/panels/GxtBorderLayoutPanel.java | 71 +++++++++++-------- 1 file changed, 40 insertions(+), 31 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 ce7a659..0d6b073 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 @@ -491,17 +491,21 @@ public class GxtBorderLayoutPanel extends ContentPanel { // create the grid with a result list and the column model final EditorGrid grid = new EditorGrid(result, cm); +// final Grid grid = new Grid(result, cm); // set the double click for row edit grid.setClicksToEdit(ClicksToEdit.TWO); // grid.setStateId("TablesList"); // grid.setStateful(true); grid.setLoadMask(true); grid.setBorders(true); + //to enable text selection + grid.disableTextSelection(false); // grid.setAutoExpandColumn("comments"); // grid.setStyleAttribute("borderTop", "none"); grid.setStripeRows(true); // to manage the table selection in the grid grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); + // add the search functionality // Top toolbar for search table functionality @@ -1858,9 +1862,9 @@ public class GxtBorderLayoutPanel extends ContentPanel { column.setWidth(100); // column.setSortable(false); - TextField textProperty = new TextField(); - // text.setAllowBlank(false); - column.setEditor(new CellEditor(textProperty)); +// TextField textProperty = new TextField(); +// // text.setAllowBlank(false); +// column.setEditor(new CellEditor(textProperty)); configs.add(column); column = new ColumnConfig(); @@ -1869,13 +1873,13 @@ public class GxtBorderLayoutPanel extends ContentPanel { column.setWidth(600); // column.setSortable(false); - TextField textValue = new TextField(); - // text.setAllowBlank(false); - column.setEditor(new CellEditor(textValue)); +// TextField textValue = new TextField(); +// // text.setAllowBlank(false); +// column.setEditor(new CellEditor(textValue)); configs.add(column); - ListStore store = new ListStore(); - store.add(result); +// ListStore store = new ListStore(); +// store.add(result); return new ColumnModel(configs); } @@ -1888,15 +1892,15 @@ public class GxtBorderLayoutPanel extends ContentPanel { // column.setWidth(100); // configs.add(column); - column = new ColumnConfig(); +// column = new ColumnConfig(); column.setId("value"); column.setHeader("Name"); column.setWidth(600); // column.setSortable(false); - TextField textValue = new TextField(); - // text.setAllowBlank(false); - column.setEditor(new CellEditor(textValue)); +// TextField textValue = new TextField(); +// // text.setAllowBlank(false); +// column.setEditor(new CellEditor(textValue)); configs.add(column); // ListStore store = new ListStore(); // store.add(result); @@ -1911,10 +1915,13 @@ public class GxtBorderLayoutPanel extends ContentPanel { rootLogger.log(Level.INFO, "info size: " + dataDB.size()); ListStore store = new ListStore(); store.add(dataDB); - EditorGrid grid = new EditorGrid(store, +// EditorGrid grid = new EditorGrid(store, +// createColumnModelForDBInfo(dataDB)); + Grid grid = new Grid(store, createColumnModelForDBInfo(dataDB)); // grid.setAutoExpandColumn("name"); grid.setBorders(true); + grid.disableTextSelection(false); // grid.setAutoWidth(true); // RowData data = new RowData(.5, 1); // data.setMargins(new Margins(6)); @@ -2072,10 +2079,13 @@ public class GxtBorderLayoutPanel extends ContentPanel { ListStore store = new ListStore(); store.add(tableDetails); - EditorGrid grid = new EditorGrid(store, +// EditorGrid grid = new EditorGrid(store, +// createColumnModelForDBInfo(tableDetails)); + Grid grid = new Grid(store, createColumnModelForDBInfo(tableDetails)); // grid.setAutoExpandColumn("name"); grid.setBorders(true); + grid.disableTextSelection(false); // grid.setAutoWidth(true); // RowData data = new RowData(.5, .1); // data.setMargins(new Margins(6)); @@ -2110,28 +2120,27 @@ public class GxtBorderLayoutPanel extends ContentPanel { column.setHeader("Value"); column.setWidth(600); - TextField textValue = new TextField(); - // text.setAllowBlank(false); - // column.setEditor(new CellEditor(textValue)); - column.setEditor(new CellEditor(textValue) { - // public Object preProcessValue(Object value) { - // System.out.println("value preProcess: " + - // store.getModels().get(0).getValue()); - // return store.getModels().get(0).getValue(); - // } - public Object postProcessValue(Object value) { - // System.out.println("value postProcess: " + - // store.findModel(table).getValue()); - return store.findModel(table).getValue(); - } - - }); +// TextField textValue = new TextField(); +// column.setEditor(new CellEditor(textValue) { +// // public Object preProcessValue(Object value) { +// // System.out.println("value preProcess: " + +// // store.getModels().get(0).getValue()); +// // return store.getModels().get(0).getValue(); +// // } +// public Object postProcessValue(Object value) { +// // System.out.println("value postProcess: " + +// // store.findModel(table).getValue()); +// return store.findModel(table).getValue(); +// } +// }); configs.add(column); ColumnModel cm = new ColumnModel(configs); // grid - EditorGrid grid = new EditorGrid(store, cm); +// EditorGrid grid = new EditorGrid(store, cm); + Grid grid = new Grid(store, cm); + grid.disableTextSelection(false); // display information in the panel centerUpper.removeAll(); centerUpper.add(grid);