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
This commit is contained in:
Giancarlo Panichi 2014-07-18 13:42:17 +00:00 committed by Giancarlo Panichi
parent 24edd569eb
commit 55fdb548b7
2 changed files with 41 additions and 18 deletions

View File

@ -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;

View File

@ -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<ColumnData> comboSourceColumn = (ComboBox<ColumnData>) 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");
}