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
This commit is contained in:
Loredana Liccardo 2014-10-22 17:15:09 +00:00
parent 359bd053b4
commit 2a9b3e4a2a
1 changed files with 40 additions and 31 deletions

View File

@ -491,17 +491,21 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// create the grid with a result list and the column model // create the grid with a result list and the column model
final EditorGrid<Result> grid = new EditorGrid<Result>(result, cm); final EditorGrid<Result> grid = new EditorGrid<Result>(result, cm);
// final Grid<Result> grid = new Grid<Result>(result, cm);
// set the double click for row edit // set the double click for row edit
grid.setClicksToEdit(ClicksToEdit.TWO); grid.setClicksToEdit(ClicksToEdit.TWO);
// grid.setStateId("TablesList"); // grid.setStateId("TablesList");
// grid.setStateful(true); // grid.setStateful(true);
grid.setLoadMask(true); grid.setLoadMask(true);
grid.setBorders(true); grid.setBorders(true);
//to enable text selection
grid.disableTextSelection(false);
// grid.setAutoExpandColumn("comments"); // grid.setAutoExpandColumn("comments");
// grid.setStyleAttribute("borderTop", "none"); // grid.setStyleAttribute("borderTop", "none");
grid.setStripeRows(true); grid.setStripeRows(true);
// to manage the table selection in the grid // to manage the table selection in the grid
grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
// add the search functionality // add the search functionality
// Top toolbar for search table functionality // Top toolbar for search table functionality
@ -1858,9 +1862,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
column.setWidth(100); column.setWidth(100);
// column.setSortable(false); // column.setSortable(false);
TextField<String> textProperty = new TextField<String>(); // TextField<String> textProperty = new TextField<String>();
// text.setAllowBlank(false); // // text.setAllowBlank(false);
column.setEditor(new CellEditor(textProperty)); // column.setEditor(new CellEditor(textProperty));
configs.add(column); configs.add(column);
column = new ColumnConfig(); column = new ColumnConfig();
@ -1869,13 +1873,13 @@ public class GxtBorderLayoutPanel extends ContentPanel {
column.setWidth(600); column.setWidth(600);
// column.setSortable(false); // column.setSortable(false);
TextField<String> textValue = new TextField<String>(); // TextField<String> textValue = new TextField<String>();
// text.setAllowBlank(false); // // text.setAllowBlank(false);
column.setEditor(new CellEditor(textValue)); // column.setEditor(new CellEditor(textValue));
configs.add(column); configs.add(column);
ListStore<Result> store = new ListStore<Result>(); // ListStore<Result> store = new ListStore<Result>();
store.add(result); // store.add(result);
return new ColumnModel(configs); return new ColumnModel(configs);
} }
@ -1888,15 +1892,15 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// column.setWidth(100); // column.setWidth(100);
// configs.add(column); // configs.add(column);
column = new ColumnConfig(); // column = new ColumnConfig();
column.setId("value"); column.setId("value");
column.setHeader("Name"); column.setHeader("Name");
column.setWidth(600); column.setWidth(600);
// column.setSortable(false); // column.setSortable(false);
TextField<String> textValue = new TextField<String>(); // TextField<String> textValue = new TextField<String>();
// text.setAllowBlank(false); // // text.setAllowBlank(false);
column.setEditor(new CellEditor(textValue)); // column.setEditor(new CellEditor(textValue));
configs.add(column); configs.add(column);
// ListStore<Result> store = new ListStore<Result>(); // ListStore<Result> store = new ListStore<Result>();
// store.add(result); // store.add(result);
@ -1911,10 +1915,13 @@ public class GxtBorderLayoutPanel extends ContentPanel {
rootLogger.log(Level.INFO, "info size: " + dataDB.size()); rootLogger.log(Level.INFO, "info size: " + dataDB.size());
ListStore<Result> store = new ListStore<Result>(); ListStore<Result> store = new ListStore<Result>();
store.add(dataDB); store.add(dataDB);
EditorGrid<Result> grid = new EditorGrid<Result>(store, // EditorGrid<Result> grid = new EditorGrid<Result>(store,
// createColumnModelForDBInfo(dataDB));
Grid<Result> grid = new Grid<Result>(store,
createColumnModelForDBInfo(dataDB)); createColumnModelForDBInfo(dataDB));
// grid.setAutoExpandColumn("name"); // grid.setAutoExpandColumn("name");
grid.setBorders(true); grid.setBorders(true);
grid.disableTextSelection(false);
// grid.setAutoWidth(true); // grid.setAutoWidth(true);
// RowData data = new RowData(.5, 1); // RowData data = new RowData(.5, 1);
// data.setMargins(new Margins(6)); // data.setMargins(new Margins(6));
@ -2072,10 +2079,13 @@ public class GxtBorderLayoutPanel extends ContentPanel {
ListStore<Result> store = new ListStore<Result>(); ListStore<Result> store = new ListStore<Result>();
store.add(tableDetails); store.add(tableDetails);
EditorGrid<Result> grid = new EditorGrid<Result>(store, // EditorGrid<Result> grid = new EditorGrid<Result>(store,
// createColumnModelForDBInfo(tableDetails));
Grid<Result> grid = new Grid<Result>(store,
createColumnModelForDBInfo(tableDetails)); createColumnModelForDBInfo(tableDetails));
// grid.setAutoExpandColumn("name"); // grid.setAutoExpandColumn("name");
grid.setBorders(true); grid.setBorders(true);
grid.disableTextSelection(false);
// grid.setAutoWidth(true); // grid.setAutoWidth(true);
// RowData data = new RowData(.5, .1); // RowData data = new RowData(.5, .1);
// data.setMargins(new Margins(6)); // data.setMargins(new Margins(6));
@ -2110,28 +2120,27 @@ public class GxtBorderLayoutPanel extends ContentPanel {
column.setHeader("Value"); column.setHeader("Value");
column.setWidth(600); column.setWidth(600);
TextField<String> textValue = new TextField<String>(); // TextField<String> textValue = new TextField<String>();
// text.setAllowBlank(false); // column.setEditor(new CellEditor(textValue) {
// column.setEditor(new CellEditor(textValue)); // // public Object preProcessValue(Object value) {
column.setEditor(new CellEditor(textValue) { // // System.out.println("value preProcess: " +
// public Object preProcessValue(Object value) { // // store.getModels().get(0).getValue());
// System.out.println("value preProcess: " + // // return store.getModels().get(0).getValue();
// store.getModels().get(0).getValue()); // // }
// return store.getModels().get(0).getValue(); // public Object postProcessValue(Object value) {
// } // // System.out.println("value postProcess: " +
public Object postProcessValue(Object value) { // // store.findModel(table).getValue());
// System.out.println("value postProcess: " + // return store.findModel(table).getValue();
// store.findModel(table).getValue()); // }
return store.findModel(table).getValue(); // });
}
});
configs.add(column); configs.add(column);
ColumnModel cm = new ColumnModel(configs); ColumnModel cm = new ColumnModel(configs);
// grid // grid
EditorGrid<Result> grid = new EditorGrid<Result>(store, cm); // EditorGrid<Result> grid = new EditorGrid<Result>(store, cm);
Grid<Result> grid = new Grid<Result>(store, cm);
grid.disableTextSelection(false);
// display information in the panel // display information in the panel
centerUpper.removeAll(); centerUpper.removeAll();
centerUpper.add(grid); centerUpper.add(grid);