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:
parent
359bd053b4
commit
2a9b3e4a2a
|
@ -491,17 +491,21 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
|
||||
// create the grid with a result list and the column model
|
||||
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
|
||||
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<String> textProperty = new TextField<String>();
|
||||
// text.setAllowBlank(false);
|
||||
column.setEditor(new CellEditor(textProperty));
|
||||
// TextField<String> textProperty = new TextField<String>();
|
||||
// // 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<String> textValue = new TextField<String>();
|
||||
// text.setAllowBlank(false);
|
||||
column.setEditor(new CellEditor(textValue));
|
||||
// TextField<String> textValue = new TextField<String>();
|
||||
// // text.setAllowBlank(false);
|
||||
// column.setEditor(new CellEditor(textValue));
|
||||
configs.add(column);
|
||||
|
||||
ListStore<Result> store = new ListStore<Result>();
|
||||
store.add(result);
|
||||
// ListStore<Result> store = new ListStore<Result>();
|
||||
// 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<String> textValue = new TextField<String>();
|
||||
// text.setAllowBlank(false);
|
||||
column.setEditor(new CellEditor(textValue));
|
||||
// TextField<String> textValue = new TextField<String>();
|
||||
// // text.setAllowBlank(false);
|
||||
// column.setEditor(new CellEditor(textValue));
|
||||
configs.add(column);
|
||||
// ListStore<Result> store = new ListStore<Result>();
|
||||
// store.add(result);
|
||||
|
@ -1911,10 +1915,13 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
rootLogger.log(Level.INFO, "info size: " + dataDB.size());
|
||||
ListStore<Result> store = new ListStore<Result>();
|
||||
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));
|
||||
// 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<Result> store = new ListStore<Result>();
|
||||
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));
|
||||
// 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<String> textValue = new TextField<String>();
|
||||
// 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<String> textValue = new TextField<String>();
|
||||
// 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<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
|
||||
centerUpper.removeAll();
|
||||
centerUpper.add(grid);
|
||||
|
|
Loading…
Reference in New Issue