From 55fdb548b78f5c5b8490f0e1439cf61fdc033411 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 18 Jul 2014 13:42:17 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@98799 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ColumnMappingCard.java | 2 +- .../client/ColumnMappingPanel.java | 57 +++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java index 9995994..5685af7 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java @@ -16,7 +16,7 @@ public class ColumnMappingCard extends WizardCard { protected ColumnMappingPanel columnMappingPanel; public ColumnMappingCard(final UnionSession unionSession) { - super("Column Mapping", ""); + super("Mapping beetween Tabular Resources", ""); Log.debug("ColumnMappingCard"); this.unionSession = unionSession; thisCard = this; diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java index f9162af..bc6fe92 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java @@ -40,7 +40,6 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; import com.sencha.gxt.widget.core.client.form.ComboBox; import com.sencha.gxt.widget.core.client.form.FieldLabel; -import com.sencha.gxt.widget.core.client.form.TextField; /** * @@ -51,7 +50,7 @@ import com.sencha.gxt.widget.core.client.form.TextField; public class ColumnMappingPanel extends ContentPanel { private static final String COMBOWIDTH = "120px"; - private static final String COLUMNLABELWIDTH = "120px"; + //private static final String COLUMNLABELWIDTH = "120px"; protected ResourceBundle res; protected ColumnMappingCard parent; protected VerticalLayoutContainer vert; @@ -77,7 +76,8 @@ public class ColumnMappingPanel extends ContentPanel { this.res = res; this.parent = parent; thisPanel = this; - parent.unionSession.getColumnsMatch(); + + Log.debug("ColumnMappingPanel"); init(); retrieveSourceColumns(); @@ -98,15 +98,36 @@ public class ColumnMappingPanel extends ContentPanel { vert.setAdjustForScroll(true); setColumnMap(); - + container.add(vert); container.forceLayout(); + + /*FieldLabel columnLabel = new FieldLabel(null, "Column Label"); + columnLabel.getElement().applyStyles("font-weight:bold"); + columnLabel.setWidth(COLUMNLABELWIDTH);*/ + + FieldLabel sourceColumnLabel = new FieldLabel(null, "Column"); + sourceColumnLabel.getElement().applyStyles("font-weight:bold"); + sourceColumnLabel.setWidth(COMBOWIDTH); + + String unionTRLabel=parent.unionSession.getUnionTabularResource().getName(); + FieldLabel unionColumnLabel = new FieldLabel(null, unionTRLabel); + unionColumnLabel.getElement().applyStyles("font-weight:bold"); + unionColumnLabel.setWidth(COMBOWIDTH); + + + final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); + horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); + horiz.setPack(BoxLayoutPack.START); - FieldLabel rowsLabel = new FieldLabel(null, "Select columns"); - rowsLabel.getElement().applyStyles("font-weight:bold"); - + //horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(sourceColumnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(unionColumnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + + + VerticalLayoutContainer vPanel = new VerticalLayoutContainer(); - vPanel.add(rowsLabel, new VerticalLayoutData(1, -1, new Margins(1))); + vPanel.add(horiz, new VerticalLayoutData(1, -1, new Margins(1))); vPanel.add(container, new VerticalLayoutData(1, -1)); add(vPanel); @@ -181,10 +202,10 @@ public class ColumnMappingPanel extends ContentPanel { final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); // Column Label - TextField columnLabel = new TextField(); + /*TextField columnLabel = new TextField(); columnLabel.setItemId(itemIdLabelColumn); columnLabel.setAllowBlank(false); - columnLabel.setWidth(COLUMNLABELWIDTH); + columnLabel.setWidth(COLUMNLABELWIDTH);*/ // Source Combo ColumnDataProperties propsSourceColumn = GWT @@ -285,7 +306,7 @@ public class ColumnMappingPanel extends ContentPanel { horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); horiz.setPack(BoxLayoutPack.START); - horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + //horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(comboUnionColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 1, 2, 1))); @@ -299,10 +320,10 @@ public class ColumnMappingPanel extends ContentPanel { final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); // Column Label - TextField columnLabel = new TextField(); + /*TextField columnLabel = new TextField(); columnLabel.setItemId(itemIdLabelColumn); columnLabel.setAllowBlank(false); - columnLabel.setWidth(COLUMNLABELWIDTH); + columnLabel.setWidth(COLUMNLABELWIDTH);*/ // Source Combo ColumnDataProperties propsSourceColumn = GWT @@ -403,7 +424,7 @@ public class ColumnMappingPanel extends ContentPanel { horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); horiz.setPack(BoxLayoutPack.START); - horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + //horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(comboUnionColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 1, 2, 1))); @@ -424,11 +445,12 @@ public class ColumnMappingPanel extends ContentPanel { for (; i < lenght; i++) { HBoxLayoutContainer h = (HBoxLayoutContainer) vert.getWidget(i); if (h != null) { - TextField columnLabelField = (TextField) h + /*TextField columnLabelField = (TextField) h .getItemByItemId(itemIdLabelColumn); if (columnLabelField != null) { String columnLabel = columnLabelField.getCurrentValue(); if (columnLabel != null && !columnLabel.isEmpty()) { + */ @SuppressWarnings("unchecked") ComboBox comboSourceColumn = (ComboBox) h .getItemByItemId(itemIdSourceColumn); @@ -442,7 +464,7 @@ public class ColumnMappingPanel extends ContentPanel { .getCurrentValue(); if (unionColumn != null) { UnionColumnsMapping colMatch = new UnionColumnsMapping( - columnLabel, sourceColumn, unionColumn); + "default", sourceColumn, unionColumn); listUnionColumnsMapping.add(colMatch); } else { Log.debug("Union Column is null"); @@ -450,12 +472,13 @@ public class ColumnMappingPanel extends ContentPanel { } else { Log.debug("Source Column is null"); } + /* } else { Log.debug("Column Label is null"); } } else { Log.debug("Column Label Field is null"); - } + }*/ } else { Log.debug("HorizontalContainer is null"); }