Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@98856 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
17e289dc61
commit
44e9a8afa0
|
@ -14,6 +14,7 @@ import org.gcube.portlets.user.td.unionwizardwidget.client.utils.UtilsGXT3;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -76,7 +77,6 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
this.parent = parent;
|
||||
thisPanel = this;
|
||||
|
||||
|
||||
Log.debug("ColumnMappingPanel");
|
||||
init();
|
||||
retrieveSourceColumns();
|
||||
|
@ -102,18 +102,22 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
|
||||
setColumnMap();
|
||||
|
||||
/*FieldLabel columnLabel = new FieldLabel(null, "Column Label");
|
||||
columnLabel.getElement().applyStyles("font-weight:bold");
|
||||
columnLabel.setWidth(COLUMNLABELWIDTH);
|
||||
columnLabel.setLabelSeparator("");*/
|
||||
/*
|
||||
* FieldLabel columnLabel = new FieldLabel(null, "Column Label");
|
||||
* columnLabel.getElement().applyStyles("font-weight:bold");
|
||||
* columnLabel.setWidth(COLUMNLABELWIDTH);
|
||||
* columnLabel.setLabelSeparator("");
|
||||
*/
|
||||
|
||||
String currentTRLabel=parent.unionSession.getCurrentTabularResource().getName();
|
||||
String currentTRLabel = parent.unionSession.getCurrentTabularResource()
|
||||
.getName();
|
||||
FieldLabel sourceColumnLabel = new FieldLabel(null, currentTRLabel);
|
||||
sourceColumnLabel.getElement().applyStyles("font-weight:bold");
|
||||
sourceColumnLabel.setWidth(COMBOWIDTH);
|
||||
sourceColumnLabel.setLabelSeparator("");
|
||||
|
||||
String unionTRLabel=parent.unionSession.getUnionTabularResource().getName();
|
||||
String unionTRLabel = parent.unionSession.getUnionTabularResource()
|
||||
.getName();
|
||||
FieldLabel unionColumnLabel = new FieldLabel(null, unionTRLabel);
|
||||
unionColumnLabel.getElement().applyStyles("font-weight:bold");
|
||||
unionColumnLabel.setWidth(COMBOWIDTH);
|
||||
|
@ -127,16 +131,14 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
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.setScrollMode(ScrollMode.AUTO);
|
||||
vPanel.setAdjustForScroll(true);
|
||||
|
||||
|
||||
vPanel.add(horiz, new VerticalLayoutData(1, -1, new Margins(1,1,1,10)));
|
||||
vPanel.add(container, new VerticalLayoutData(1, -1, new Margins(1,1,1,10)));
|
||||
|
||||
vPanel.add(horiz, new VerticalLayoutData(1, -1,
|
||||
new Margins(1, 1, 1, 10)));
|
||||
vPanel.add(container, new VerticalLayoutData(1, -1, new Margins(1, 1,
|
||||
1, 10)));
|
||||
|
||||
add(vPanel);
|
||||
forceLayout();
|
||||
|
@ -210,10 +212,12 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
|
||||
// Column Label
|
||||
/*TextField columnLabel = new TextField();
|
||||
columnLabel.setItemId(itemIdLabelColumn);
|
||||
columnLabel.setAllowBlank(false);
|
||||
columnLabel.setWidth(COLUMNLABELWIDTH);*/
|
||||
/*
|
||||
* TextField columnLabel = new TextField();
|
||||
* columnLabel.setItemId(itemIdLabelColumn);
|
||||
* columnLabel.setAllowBlank(false);
|
||||
* columnLabel.setWidth(COLUMNLABELWIDTH);
|
||||
*/
|
||||
|
||||
// Source Combo
|
||||
ColumnDataProperties propsSourceColumn = GWT
|
||||
|
@ -298,11 +302,32 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
.getSelectedItem();
|
||||
storeComboUnionColumn.clear();
|
||||
for (ColumnData col : unionColumns) {
|
||||
if (col.getDataTypeName() == selectedSourceColumn
|
||||
.getDataTypeName()
|
||||
&& col.getTypeCode() == selectedSourceColumn
|
||||
.getTypeCode()) {
|
||||
if (selectedSourceColumn.getDataTypeName()
|
||||
.compareTo(ColumnDataType.Text.toString()) == 0
|
||||
|| col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Text.toString()) == 0) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
if ((col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Integer.toString()) == 0 && selectedSourceColumn
|
||||
.getDataTypeName().compareTo(
|
||||
ColumnDataType.Numeric
|
||||
.toString()) == 0)
|
||||
|| (col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Numeric
|
||||
.toString()) == 0 && selectedSourceColumn
|
||||
.getDataTypeName().compareTo(
|
||||
ColumnDataType.Integer
|
||||
.toString()) == 0)) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
if (col.getDataTypeName().compareTo(selectedSourceColumn
|
||||
.getDataTypeName())==0) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
storeComboUnionColumn.commitChanges();
|
||||
|
@ -328,10 +353,12 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
|
||||
// Column Label
|
||||
/*TextField columnLabel = new TextField();
|
||||
columnLabel.setItemId(itemIdLabelColumn);
|
||||
columnLabel.setAllowBlank(false);
|
||||
columnLabel.setWidth(COLUMNLABELWIDTH);*/
|
||||
/*
|
||||
* TextField columnLabel = new TextField();
|
||||
* columnLabel.setItemId(itemIdLabelColumn);
|
||||
* columnLabel.setAllowBlank(false);
|
||||
* columnLabel.setWidth(COLUMNLABELWIDTH);
|
||||
*/
|
||||
|
||||
// Source Combo
|
||||
ColumnDataProperties propsSourceColumn = GWT
|
||||
|
@ -416,11 +443,32 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
.getSelectedItem();
|
||||
storeComboUnionColumn.clear();
|
||||
for (ColumnData col : unionColumns) {
|
||||
if (col.getDataTypeName() == selectedSourceColumn
|
||||
.getDataTypeName()
|
||||
&& col.getTypeCode() == selectedSourceColumn
|
||||
.getTypeCode()) {
|
||||
if (selectedSourceColumn.getDataTypeName()
|
||||
.compareTo(ColumnDataType.Text.toString()) == 0
|
||||
|| col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Text.toString()) == 0) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
if ((col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Integer.toString()) == 0 && selectedSourceColumn
|
||||
.getDataTypeName().compareTo(
|
||||
ColumnDataType.Numeric
|
||||
.toString()) == 0)
|
||||
|| (col.getDataTypeName().compareTo(
|
||||
ColumnDataType.Numeric
|
||||
.toString()) == 0 && selectedSourceColumn
|
||||
.getDataTypeName().compareTo(
|
||||
ColumnDataType.Integer
|
||||
.toString()) == 0)) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
if (col.getDataTypeName().compareTo(selectedSourceColumn
|
||||
.getDataTypeName())==0) {
|
||||
storeComboUnionColumn.add(col);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
storeComboUnionColumn.commitChanges();
|
||||
|
@ -453,23 +501,22 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
for (; i < lenght; i++) {
|
||||
HBoxLayoutContainer h = (HBoxLayoutContainer) vert.getWidget(i);
|
||||
if (h != null) {
|
||||
/*TextField columnLabelField = (TextField) h
|
||||
.getItemByItemId(itemIdLabelColumn);
|
||||
if (columnLabelField != null) {
|
||||
String columnLabel = columnLabelField.getCurrentValue();
|
||||
if (columnLabel != null && !columnLabel.isEmpty()) {
|
||||
/*
|
||||
* 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);
|
||||
ColumnData sourceColumn = comboSourceColumn
|
||||
.getCurrentValue();
|
||||
ColumnData sourceColumn = comboSourceColumn.getCurrentValue();
|
||||
if (sourceColumn != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
ComboBox<ColumnData> comboUnionColumn = (ComboBox<ColumnData>) h
|
||||
.getItemByItemId(itemIdUnionColumn);
|
||||
ColumnData unionColumn = comboUnionColumn
|
||||
.getCurrentValue();
|
||||
ColumnData unionColumn = comboUnionColumn.getCurrentValue();
|
||||
if (unionColumn != null) {
|
||||
UnionColumnsMapping colMatch = new UnionColumnsMapping(
|
||||
"default", sourceColumn, unionColumn);
|
||||
|
@ -481,12 +528,9 @@ public class ColumnMappingPanel extends ContentPanel {
|
|||
Log.debug("Source Column is null");
|
||||
}
|
||||
/*
|
||||
} else {
|
||||
Log.debug("Column Label is null");
|
||||
}
|
||||
} else {
|
||||
Log.debug("Column Label Field is null");
|
||||
}*/
|
||||
* } else { Log.debug("Column Label is null"); } } else {
|
||||
* Log.debug("Column Label Field is null"); }
|
||||
*/
|
||||
} else {
|
||||
Log.debug("HorizontalContainer is null");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue