Updated ProgressBar set Progress 0
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@98797 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
696c7af409
commit
24edd569eb
|
@ -68,18 +68,20 @@ public class ColumnMappingCard extends WizardCard {
|
||||||
getWizardWindow().setEnableNextButton(false);
|
getWizardWindow().setEnableNextButton(false);
|
||||||
getWizardWindow().setEnableBackButton(false);
|
getWizardWindow().setEnableBackButton(false);
|
||||||
|
|
||||||
ArrayList<UnionColumnsMapping> mapMatch=columnMappingPanel.getSelectedMap();
|
ArrayList<UnionColumnsMapping> columnsMatch=columnMappingPanel.getSelectedMap();
|
||||||
if(mapMatch==null){
|
if(columnsMatch==null){
|
||||||
Log.debug("No column match created: "
|
Log.debug("No columns match created: "
|
||||||
+mapMatch);
|
+columnsMatch);
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.info("Attentions",
|
.info("Attentions",
|
||||||
"Creates a valid map");
|
"Creates a valid column map");
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
getWizardWindow().setEnableBackButton(true);
|
getWizardWindow().setEnableBackButton(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Log.debug("ColumnsMatch created: "+columnsMatch);
|
||||||
|
unionSession.setColumnsMatch(columnsMatch);
|
||||||
|
goNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +97,7 @@ public class ColumnMappingCard extends WizardCard {
|
||||||
getWizardWindow().nextCard();
|
getWizardWindow().nextCard();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.error("goNext: " + e.getLocalizedMessage());
|
Log.error("goNext: " + e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||||
|
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
|
@ -205,9 +207,8 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
// Union Combo
|
// Union Combo
|
||||||
ColumnDataProperties propsUnionColumn = GWT
|
ColumnDataProperties propsUnionColumn = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataProperties.class);
|
||||||
ListStore<ColumnData> storeComboUnionColumn = new ListStore<ColumnData>(
|
final ListStore<ColumnData> storeComboUnionColumn = new ListStore<ColumnData>(
|
||||||
propsUnionColumn.id());
|
propsUnionColumn.id());
|
||||||
storeComboUnionColumn.addAll(unionColumns);
|
|
||||||
|
|
||||||
final ComboBox<ColumnData> comboUnionColumn = new ComboBox<ColumnData>(
|
final ComboBox<ColumnData> comboUnionColumn = new ComboBox<ColumnData>(
|
||||||
storeComboUnionColumn, propsUnionColumn.label());
|
storeComboUnionColumn, propsUnionColumn.label());
|
||||||
|
@ -215,6 +216,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
|
|
||||||
Log.debug("ComboUnionColumn created");
|
Log.debug("ComboUnionColumn created");
|
||||||
|
|
||||||
|
comboUnionColumn.disable();
|
||||||
comboUnionColumn.setEmptyText("Select a column...");
|
comboUnionColumn.setEmptyText("Select a column...");
|
||||||
comboUnionColumn.setWidth(COMBOWIDTH);
|
comboUnionColumn.setWidth(COMBOWIDTH);
|
||||||
comboUnionColumn.setEditable(false);
|
comboUnionColumn.setEditable(false);
|
||||||
|
@ -255,6 +257,30 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
});
|
});
|
||||||
btnDel.setVisible(false);
|
btnDel.setVisible(false);
|
||||||
|
|
||||||
|
comboSourceColumn
|
||||||
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
|
comboUnionColumn.reset();
|
||||||
|
storeComboUnionColumn.clear();
|
||||||
|
|
||||||
|
ColumnData selectedSourceColumn = event
|
||||||
|
.getSelectedItem();
|
||||||
|
storeComboUnionColumn.clear();
|
||||||
|
for (ColumnData col : unionColumns) {
|
||||||
|
if (col.getDataTypeName() == selectedSourceColumn
|
||||||
|
.getDataTypeName()
|
||||||
|
&& col.getTypeCode() == selectedSourceColumn
|
||||||
|
.getTypeCode()) {
|
||||||
|
storeComboUnionColumn.add(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeComboUnionColumn.commitChanges();
|
||||||
|
comboUnionColumn.redraw();
|
||||||
|
comboUnionColumn.enable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
horiz.setPack(BoxLayoutPack.START);
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
@ -268,7 +294,6 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
vert.add(horiz);
|
vert.add(horiz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void addColumnMap() {
|
protected void addColumnMap() {
|
||||||
|
|
||||||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||||
|
@ -284,7 +309,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataProperties.class);
|
||||||
ListStore<ColumnData> storeComboSourceColumn = new ListStore<ColumnData>(
|
ListStore<ColumnData> storeComboSourceColumn = new ListStore<ColumnData>(
|
||||||
propsSourceColumn.id());
|
propsSourceColumn.id());
|
||||||
storeComboSourceColumn.addAll(unionColumns);
|
storeComboSourceColumn.addAll(sourceColumns);
|
||||||
|
|
||||||
final ComboBox<ColumnData> comboSourceColumn = new ComboBox<ColumnData>(
|
final ComboBox<ColumnData> comboSourceColumn = new ComboBox<ColumnData>(
|
||||||
storeComboSourceColumn, propsSourceColumn.label());
|
storeComboSourceColumn, propsSourceColumn.label());
|
||||||
|
@ -300,9 +325,8 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
// Union Combo
|
// Union Combo
|
||||||
ColumnDataProperties propsUnionColumn = GWT
|
ColumnDataProperties propsUnionColumn = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataProperties.class);
|
||||||
ListStore<ColumnData> storeComboUnionColumn = new ListStore<ColumnData>(
|
final ListStore<ColumnData> storeComboUnionColumn = new ListStore<ColumnData>(
|
||||||
propsUnionColumn.id());
|
propsUnionColumn.id());
|
||||||
storeComboUnionColumn.addAll(unionColumns);
|
|
||||||
|
|
||||||
final ComboBox<ColumnData> comboUnionColumn = new ComboBox<ColumnData>(
|
final ComboBox<ColumnData> comboUnionColumn = new ComboBox<ColumnData>(
|
||||||
storeComboUnionColumn, propsUnionColumn.label());
|
storeComboUnionColumn, propsUnionColumn.label());
|
||||||
|
@ -310,6 +334,7 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
|
|
||||||
Log.debug("ComboUnionColumn created");
|
Log.debug("ComboUnionColumn created");
|
||||||
|
|
||||||
|
comboUnionColumn.disable();
|
||||||
comboUnionColumn.setEmptyText("Select a column...");
|
comboUnionColumn.setEmptyText("Select a column...");
|
||||||
comboUnionColumn.setWidth(COMBOWIDTH);
|
comboUnionColumn.setWidth(COMBOWIDTH);
|
||||||
comboUnionColumn.setEditable(false);
|
comboUnionColumn.setEditable(false);
|
||||||
|
@ -350,6 +375,31 @@ public class ColumnMappingPanel extends ContentPanel {
|
||||||
});
|
});
|
||||||
btnDel.setVisible(false);
|
btnDel.setVisible(false);
|
||||||
|
|
||||||
|
comboSourceColumn
|
||||||
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
|
comboUnionColumn.reset();
|
||||||
|
storeComboUnionColumn.clear();
|
||||||
|
|
||||||
|
ColumnData selectedSourceColumn = event
|
||||||
|
.getSelectedItem();
|
||||||
|
storeComboUnionColumn.clear();
|
||||||
|
for (ColumnData col : unionColumns) {
|
||||||
|
if (col.getDataTypeName() == selectedSourceColumn
|
||||||
|
.getDataTypeName()
|
||||||
|
&& col.getTypeCode() == selectedSourceColumn
|
||||||
|
.getTypeCode()) {
|
||||||
|
storeComboUnionColumn.add(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeComboUnionColumn.commitChanges();
|
||||||
|
comboUnionColumn.redraw();
|
||||||
|
comboUnionColumn.enable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
horiz.setPack(BoxLayoutPack.START);
|
horiz.setPack(BoxLayoutPack.START);
|
||||||
|
|
||||||
|
@ -374,22 +424,40 @@ 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
|
||||||
|
.getItemByItemId(itemIdLabelColumn);
|
||||||
|
if (columnLabelField != null) {
|
||||||
|
String columnLabel = columnLabelField.getCurrentValue();
|
||||||
|
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);
|
||||||
ColumnData sourceColumn = comboSourceColumn.getCurrentValue();
|
ColumnData sourceColumn = comboSourceColumn
|
||||||
|
.getCurrentValue();
|
||||||
if (sourceColumn != null) {
|
if (sourceColumn != null) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<ColumnData> comboUnionColumn = (ComboBox<ColumnData>) h
|
ComboBox<ColumnData> comboUnionColumn = (ComboBox<ColumnData>) h
|
||||||
.getItemByItemId(itemIdUnionColumn);
|
.getItemByItemId(itemIdUnionColumn);
|
||||||
ColumnData unionColumn = comboUnionColumn.getCurrentValue();
|
ColumnData unionColumn = comboUnionColumn
|
||||||
|
.getCurrentValue();
|
||||||
if (unionColumn != null) {
|
if (unionColumn != null) {
|
||||||
UnionColumnsMapping colMatch= new UnionColumnsMapping(sourceColumn, unionColumn);
|
UnionColumnsMapping colMatch = new UnionColumnsMapping(
|
||||||
|
columnLabel, sourceColumn, unionColumn);
|
||||||
listUnionColumnsMapping.add(colMatch);
|
listUnionColumnsMapping.add(colMatch);
|
||||||
}
|
} else {
|
||||||
|
Log.debug("Union Column is null");
|
||||||
}
|
}
|
||||||
} else {
|
} 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,7 @@ public class UnionProgressBarUpdater implements UnionProgressListener {
|
||||||
@Override
|
@Override
|
||||||
public void operationUpdate(float elaborated) {
|
public void operationUpdate(float elaborated) {
|
||||||
Log.info("Elaborated: "+elaborated);
|
Log.info("Elaborated: "+elaborated);
|
||||||
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
if (elaborated>=0 && elaborated<1) {
|
||||||
if (elaborated>0 && elaborated<1) {
|
|
||||||
Log.trace("progress "+elaborated);
|
Log.trace("progress "+elaborated);
|
||||||
int elab=new Float(elaborated*100).intValue();
|
int elab=new Float(elaborated*100).intValue();
|
||||||
progressBar.updateProgress(elaborated,elab+"% Progress...");
|
progressBar.updateProgress(elaborated,elab+"% Progress...");
|
||||||
|
|
Loading…
Reference in New Issue