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:
parent
24edd569eb
commit
55fdb548b7
|
@ -16,7 +16,7 @@ public class ColumnMappingCard extends WizardCard {
|
||||||
protected ColumnMappingPanel columnMappingPanel;
|
protected ColumnMappingPanel columnMappingPanel;
|
||||||
|
|
||||||
public ColumnMappingCard(final UnionSession unionSession) {
|
public ColumnMappingCard(final UnionSession unionSession) {
|
||||||
super("Column Mapping", "");
|
super("Mapping beetween Tabular Resources", "");
|
||||||
Log.debug("ColumnMappingCard");
|
Log.debug("ColumnMappingCard");
|
||||||
this.unionSession = unionSession;
|
this.unionSession = unionSession;
|
||||||
thisCard = this;
|
thisCard = this;
|
||||||
|
|
|
@ -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.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
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.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 {
|
public class ColumnMappingPanel extends ContentPanel {
|
||||||
|
|
||||||
private static final String COMBOWIDTH = "120px";
|
private static final String COMBOWIDTH = "120px";
|
||||||
private static final String COLUMNLABELWIDTH = "120px";
|
//private static final String COLUMNLABELWIDTH = "120px";
|
||||||
protected ResourceBundle res;
|
protected ResourceBundle res;
|
||||||
protected ColumnMappingCard parent;
|
protected ColumnMappingCard parent;
|
||||||
protected VerticalLayoutContainer vert;
|
protected VerticalLayoutContainer vert;
|
||||||
|
@ -77,7 +76,8 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
this.res = res;
|
this.res = res;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
thisPanel = this;
|
thisPanel = this;
|
||||||
parent.unionSession.getColumnsMatch();
|
|
||||||
|
|
||||||
Log.debug("ColumnMappingPanel");
|
Log.debug("ColumnMappingPanel");
|
||||||
init();
|
init();
|
||||||
retrieveSourceColumns();
|
retrieveSourceColumns();
|
||||||
|
@ -98,15 +98,36 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
vert.setAdjustForScroll(true);
|
vert.setAdjustForScroll(true);
|
||||||
|
|
||||||
setColumnMap();
|
setColumnMap();
|
||||||
|
|
||||||
container.add(vert);
|
container.add(vert);
|
||||||
container.forceLayout();
|
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");
|
//horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1)));
|
||||||
rowsLabel.getElement().applyStyles("font-weight:bold");
|
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();
|
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));
|
vPanel.add(container, new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
add(vPanel);
|
add(vPanel);
|
||||||
|
@ -181,10 +202,10 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
|
||||||
// Column Label
|
// Column Label
|
||||||
TextField columnLabel = new TextField();
|
/*TextField columnLabel = new TextField();
|
||||||
columnLabel.setItemId(itemIdLabelColumn);
|
columnLabel.setItemId(itemIdLabelColumn);
|
||||||
columnLabel.setAllowBlank(false);
|
columnLabel.setAllowBlank(false);
|
||||||
columnLabel.setWidth(COLUMNLABELWIDTH);
|
columnLabel.setWidth(COLUMNLABELWIDTH);*/
|
||||||
|
|
||||||
// Source Combo
|
// Source Combo
|
||||||
ColumnDataProperties propsSourceColumn = GWT
|
ColumnDataProperties propsSourceColumn = GWT
|
||||||
|
@ -285,7 +306,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
horiz.setPack(BoxLayoutPack.START);
|
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(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1)));
|
||||||
horiz.add(comboUnionColumn, 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)));
|
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();
|
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
|
||||||
// Column Label
|
// Column Label
|
||||||
TextField columnLabel = new TextField();
|
/*TextField columnLabel = new TextField();
|
||||||
columnLabel.setItemId(itemIdLabelColumn);
|
columnLabel.setItemId(itemIdLabelColumn);
|
||||||
columnLabel.setAllowBlank(false);
|
columnLabel.setAllowBlank(false);
|
||||||
columnLabel.setWidth(COLUMNLABELWIDTH);
|
columnLabel.setWidth(COLUMNLABELWIDTH);*/
|
||||||
|
|
||||||
// Source Combo
|
// Source Combo
|
||||||
ColumnDataProperties propsSourceColumn = GWT
|
ColumnDataProperties propsSourceColumn = GWT
|
||||||
|
@ -403,7 +424,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
horiz.setPack(BoxLayoutPack.START);
|
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(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1)));
|
||||||
horiz.add(comboUnionColumn, 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)));
|
horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 1, 2, 1)));
|
||||||
|
@ -424,11 +445,12 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
for (; i < lenght; i++) {
|
for (; i < lenght; i++) {
|
||||||
HBoxLayoutContainer h = (HBoxLayoutContainer) vert.getWidget(i);
|
HBoxLayoutContainer h = (HBoxLayoutContainer) vert.getWidget(i);
|
||||||
if (h != null) {
|
if (h != null) {
|
||||||
TextField columnLabelField = (TextField) h
|
/*TextField columnLabelField = (TextField) h
|
||||||
.getItemByItemId(itemIdLabelColumn);
|
.getItemByItemId(itemIdLabelColumn);
|
||||||
if (columnLabelField != null) {
|
if (columnLabelField != null) {
|
||||||
String columnLabel = columnLabelField.getCurrentValue();
|
String columnLabel = columnLabelField.getCurrentValue();
|
||||||
if (columnLabel != null && !columnLabel.isEmpty()) {
|
if (columnLabel != null && !columnLabel.isEmpty()) {
|
||||||
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<ColumnData> comboSourceColumn = (ComboBox<ColumnData>) h
|
ComboBox<ColumnData> comboSourceColumn = (ComboBox<ColumnData>) h
|
||||||
.getItemByItemId(itemIdSourceColumn);
|
.getItemByItemId(itemIdSourceColumn);
|
||||||
|
@ -442,7 +464,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
.getCurrentValue();
|
.getCurrentValue();
|
||||||
if (unionColumn != null) {
|
if (unionColumn != null) {
|
||||||
UnionColumnsMapping colMatch = new UnionColumnsMapping(
|
UnionColumnsMapping colMatch = new UnionColumnsMapping(
|
||||||
columnLabel, sourceColumn, unionColumn);
|
"default", sourceColumn, unionColumn);
|
||||||
listUnionColumnsMapping.add(colMatch);
|
listUnionColumnsMapping.add(colMatch);
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Union Column is null");
|
Log.debug("Union Column is null");
|
||||||
|
@ -450,12 +472,13 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Source Column is null");
|
Log.debug("Source Column is null");
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Column Label is null");
|
Log.debug("Column Label is null");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Column Label Field is null");
|
Log.debug("Column Label Field is null");
|
||||||
}
|
}*/
|
||||||
} else {
|
} else {
|
||||||
Log.debug("HorizontalContainer is null");
|
Log.debug("HorizontalContainer is null");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue