diff --git a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java index 2b5acd0..1c47f63 100644 --- a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java @@ -20,7 +20,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; * */ public class EditRowDialog extends Window { - protected String WIDTH = "600px"; + protected String WIDTH = "690px"; protected String HEIGHT = "456px"; protected TRId trId; protected EventBus eventBus; diff --git a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowPanel.java b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowPanel.java index 12e580f..96560d5 100644 --- a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowPanel.java @@ -51,6 +51,7 @@ import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutD import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; +import com.sencha.gxt.widget.core.client.container.MarginData; import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; @@ -77,10 +78,11 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { private static final String GEOMETRY_REGEXPR = "(\\s*POINT\\s*\\(\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*\\)\\s*$)" + "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)"; - private static final String WIDTH = "510px"; + private static final String WIDTH = "600px"; private static final String HEIGHT = "370px"; - private static final String FIELDSHEIGHT = "370px"; + private static final String CONTAINERHEIGHT = "370px"; private static final int LABELSIZE = 120; + private static final String FIELDSETWIDTH = "640px"; private EditRowDialog parent; private TRId trId; @@ -90,9 +92,9 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { private boolean editRow; private VerticalLayoutContainer v; - + private ArrayList rowsId; - + private TextButton btnSave; private TextButton btnClose; @@ -153,11 +155,11 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { protected void create() { SimpleContainer container = new SimpleContainer(); - container.setHeight(FIELDSHEIGHT); + container.setHeight(CONTAINERHEIGHT); v = new VerticalLayoutContainer(); v.setScrollMode(ScrollMode.AUTO); - container.add(v); + v.setAdjustForScroll(true); btnSave = new TextButton("Save"); btnSave.setIcon(ResourceBundle.INSTANCE.save()); @@ -196,22 +198,24 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4))); flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4))); - rowsId=new ArrayList(); - if (editRow) { + rowsId = new ArrayList(); + if (editRow) { for (RowRaw rowRaw : rowsRaw) { FieldSet fieldSet = new FieldSet(); fieldSet.setCollapsible(false); fieldSet.setItemId(rowRaw.getRowId()); + fieldSet.setHeadingText(rowRaw.getRowId()); + fieldSet.setWidth(FIELDSETWIDTH); rowsId.add(rowRaw.getRowId()); - + VerticalLayoutContainer fieldSetLayout = new VerticalLayoutContainer(); - fieldSetLayout.setScrollMode(ScrollMode.AUTO); - fieldSet.add(fieldSetLayout); + // fieldSetLayout.setScrollMode(ScrollMode.AUTO); + fieldSet.add(fieldSetLayout, new MarginData(0)); ArrayList fields = generateFields(rowRaw); for (FieldLabel fl : fields) { fieldSetLayout.add(fl, new VerticalLayoutData(1, -1, - new Margins(1))); + new Margins(0))); } v.add(fieldSet, new VerticalLayoutData(1, -1, new Margins(1))); @@ -222,21 +226,25 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { FieldSet fieldSet = new FieldSet(); fieldSet.setCollapsible(false); fieldSet.setItemId(ITEM_CREATE_ROW); + fieldSet.setHeadingText("New"); + fieldSet.setWidth(FIELDSETWIDTH); rowsId.add(ITEM_CREATE_ROW); - + VerticalLayoutContainer fieldSetLayout = new VerticalLayoutContainer(); - fieldSetLayout.setScrollMode(ScrollMode.AUTO); + // fieldSetLayout.setScrollMode(ScrollMode.AUTO); fieldSet.add(fieldSetLayout); ArrayList fields = generateFields(null); for (FieldLabel fl : fields) { fieldSetLayout.add(fl, new VerticalLayoutData(1, -1, - new Margins(1))); + new Margins(0))); } + v.add(fieldSet, new VerticalLayoutData(1, -1, new Margins(1))); } - + + container.add(v, new MarginData(0)); container.forceLayout(); VerticalLayoutContainer vPanel = new VerticalLayoutContainer(); @@ -546,7 +554,7 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { int lenght = v.getWidgetCount(); HashMap> rowsMaps = new HashMap>(); - + for (; i < lenght; i++) { FieldSet fieldSet = (FieldSet) v.getWidget(i); VerticalLayoutContainer fieldSetLayout = (VerticalLayoutContainer) fieldSet @@ -709,15 +717,14 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener { } } } - + rowsMaps.put(fieldSet.getItemId(), maps); - + } EditRowSession editRowSession; if (editRow) { - editRowSession = new EditRowSession(trId, columns, rowsMaps, - rowsId); + editRowSession = new EditRowSession(trId, columns, rowsMaps, rowsId); } else { editRowSession = new EditRowSession(trId, columns, rowsMaps); }