Updated to JAVA 7
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@86993 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
987fa8f2b1
commit
3d750e50e8
|
@ -86,7 +86,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
encodings.setTriggerAction(TriggerAction.ALL);
|
encodings.setTriggerAction(TriggerAction.ALL);
|
||||||
encodings.addSelectionHandler(new SelectionHandler<String>() {
|
encodings.addSelectionHandler(new SelectionHandler<String>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<String> event) {
|
public void onSelection(SelectionEvent<String> event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -97,7 +96,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getAvailableCharset(new AsyncCallback<AvailableCharsetList>() {
|
.getAvailableCharset(new AsyncCallback<AvailableCharsetList>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(AvailableCharsetList result) {
|
public void onSuccess(AvailableCharsetList result) {
|
||||||
GWT.log("CharsetInfo: "
|
GWT.log("CharsetInfo: "
|
||||||
+ result.getCharsetList().size()
|
+ result.getCharsetList().size()
|
||||||
|
@ -114,7 +112,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("Error loading charset list", caught);
|
GWT.log("Error loading charset list", caught);
|
||||||
showErrorAndHide("Error loading charset list",
|
showErrorAndHide("Error loading charset list",
|
||||||
|
@ -156,7 +153,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
delimitersGroup
|
delimitersGroup
|
||||||
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onValueChange(
|
public void onValueChange(
|
||||||
ValueChangeEvent<HasValue<Boolean>> event) {
|
ValueChangeEvent<HasValue<Boolean>> event) {
|
||||||
|
|
||||||
|
@ -191,7 +187,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
csvColumnGridPanel
|
csvColumnGridPanel
|
||||||
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<ColumnData> event) {
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -222,7 +217,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
Log.debug("CSVExportConfigCard Setup");
|
Log.debug("CSVExportConfigCard Setup");
|
||||||
Command sayNextCard = new Command() {
|
Command sayNextCard = new Command() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Log.debug("CSVExportConfigCard Call sayNextCard");
|
Log.debug("CSVExportConfigCard Call sayNextCard");
|
||||||
checkData();
|
checkData();
|
||||||
|
@ -241,7 +235,6 @@ public class CSVExportConfigCard extends WizardCard {
|
||||||
AlertMessageBox d;
|
AlertMessageBox d;
|
||||||
HideHandler hideHandler = new HideHandler() {
|
HideHandler hideHandler = new HideHandler() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
getWizardWindow().setEnableBackButton(false);
|
getWizardWindow().setEnableBackButton(false);
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.google.gwt.core.client.EntryPoint;
|
||||||
|
|
||||||
public class CSVExportWizardTDEntry implements EntryPoint {
|
public class CSVExportWizardTDEntry implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onModuleLoad() {
|
public void onModuleLoad() {
|
||||||
CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport");
|
CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport");
|
||||||
Log.info(exportWizard.getId());
|
Log.info(exportWizard.getId());
|
||||||
|
|
|
@ -89,12 +89,11 @@ CSVExportProgressListener {
|
||||||
public void exportCSV() {
|
public void exportCSV() {
|
||||||
TDGWTServiceAsync.INSTANCE.startCSVExport(exportSession, new AsyncCallback<Void>() {
|
TDGWTServiceAsync.INSTANCE.startCSVExport(exportSession, new AsyncCallback<Void>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
showErrorAndHide("Error in exportCSV",
|
showErrorAndHide("Error in exportCSV",
|
||||||
"An error occured in exportCSV: "+caught.getLocalizedMessage(), caught.getStackTrace().toString(), caught);
|
"An error occured in exportCSV: "+caught.getLocalizedMessage(), caught.getStackTrace().toString(), caught);
|
||||||
|
@ -112,17 +111,14 @@ CSVExportProgressListener {
|
||||||
exportCSV();
|
exportCSV();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationInitializing() {
|
public void operationInitializing() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationUpdate(float elaborated) {
|
public void operationUpdate(float elaborated) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationComplete() {
|
public void operationComplete() {
|
||||||
// final String tableId,final String tableResourceId) {
|
// final String tableId,final String tableResourceId) {
|
||||||
|
|
||||||
|
@ -146,7 +142,6 @@ CSVExportProgressListener {
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationFailed(Throwable caught, String reason,
|
public void operationFailed(Throwable caught, String reason,
|
||||||
String failureDetails) {
|
String failureDetails) {
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
wpanel.setSelectableTypes(lItemType);
|
wpanel.setSelectableTypes(lItemType);
|
||||||
wpanel.addSelectionHandler(new ItemSelectionHandler() {
|
wpanel.addSelectionHandler(new ItemSelectionHandler() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(ItemSelectionEvent event) {
|
public void onSelection(ItemSelectionEvent event) {
|
||||||
item = event.getSelectedItem();
|
item = event.getSelectedItem();
|
||||||
Log.debug("Selected Item:" + item);
|
Log.debug("Selected Item:" + item);
|
||||||
|
@ -108,7 +108,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
AlertMessageBox d;
|
AlertMessageBox d;
|
||||||
HideHandler hideHandler = new HideHandler() {
|
HideHandler hideHandler = new HideHandler() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
wpanel.enable();
|
wpanel.enable();
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
|
@ -156,7 +155,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
Log.debug("CSVWorkSpaceSelectionCard Call Setup ");
|
Log.debug("CSVWorkSpaceSelectionCard Call Setup ");
|
||||||
Command sayNextCard = new Command() {
|
Command sayNextCard = new Command() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Log.debug("CSVWorkSpaceSelectionCard Call sayNextCard wpanel:"
|
Log.debug("CSVWorkSpaceSelectionCard Call sayNextCard wpanel:"
|
||||||
+ wpanel);
|
+ wpanel);
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class DestinationSelectionCard extends WizardCard {
|
||||||
|
|
||||||
toggle.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
toggle.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
|
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
|
||||||
try {
|
try {
|
||||||
ToggleGroup group = (ToggleGroup) event.getSource();
|
ToggleGroup group = (ToggleGroup) event.getSource();
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class DownloadFileCard extends WizardCard {
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
Command sayNextCard = new Command() {
|
Command sayNextCard = new Command() {
|
||||||
@Override
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
protected void onAfterFirstAttach() {
|
protected void onAfterFirstAttach() {
|
||||||
super.onAfterFirstAttach();
|
super.onAfterFirstAttach();
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
@Override
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
loader.load();
|
loader.load();
|
||||||
}
|
}
|
||||||
|
@ -125,14 +125,13 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getColumns(new AsyncCallback<ArrayList<ColumnData>>() {
|
.getColumns(new AsyncCallback<ArrayList<ColumnData>>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("No load columns: "
|
Log.error("No load columns: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<ColumnData> result) {
|
public void onSuccess(ArrayList<ColumnData> result) {
|
||||||
Log.trace("loaded " + result.size() + " columns");
|
Log.trace("loaded " + result.size() + " columns");
|
||||||
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
||||||
|
@ -149,7 +148,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HandlerRegistration addSelectionHandler(
|
public HandlerRegistration addSelectionHandler(
|
||||||
SelectionHandler<ColumnData> handler) {
|
SelectionHandler<ColumnData> handler) {
|
||||||
return grid.getSelectionModel().addSelectionHandler(handler);
|
return grid.getSelectionModel().addSelectionHandler(handler);
|
||||||
|
|
|
@ -33,7 +33,6 @@ public class CSVExportProgressBarUpdater implements CSVExportProgressListener {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void operationComplete() {
|
public void operationComplete() {
|
||||||
Log.info("Export completed");
|
Log.info("Export completed");
|
||||||
progressBar.updateProgress(1, "Export completed.");
|
progressBar.updateProgress(1, "Export completed.");
|
||||||
|
@ -43,19 +42,17 @@ public class CSVExportProgressBarUpdater implements CSVExportProgressListener {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void operationFailed(Throwable caught, String reason, String failureDetails) {
|
public void operationFailed(Throwable caught, String reason, String failureDetails) {
|
||||||
Log.info("Export failed");
|
Log.info("Export failed");
|
||||||
progressBar.updateText("Export failed.");
|
progressBar.updateText("Export failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationInitializing() {
|
public void operationInitializing() {
|
||||||
Log.info("Export Inizializing");
|
Log.info("Export Inizializing");
|
||||||
progressBar.updateProgress(0, "Initializing...");
|
progressBar.updateProgress(0, "Initializing...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationUpdate(float elaborated) {
|
public void operationUpdate(float elaborated) {
|
||||||
Log.info("Export elaborated: "+elaborated);
|
Log.info("Export elaborated: "+elaborated);
|
||||||
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getCSVExportMonitor(new AsyncCallback<CSVExportMonitor>() {
|
.getCSVExportMonitor(new AsyncCallback<CSVExportMonitor>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
cancel();
|
cancel();
|
||||||
Log.error("Error retrieving the operation state",
|
Log.error("Error retrieving the operation state",
|
||||||
|
@ -45,7 +45,6 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
"Failed getting operation updates", message);
|
"Failed getting operation updates", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CSVExportMonitor result) {
|
public void onSuccess(CSVExportMonitor result) {
|
||||||
Log.info("retrieved CSVImportMonitor: "
|
Log.info("retrieved CSVImportMonitor: "
|
||||||
+ result.getStatus());
|
+ result.getStatus());
|
||||||
|
@ -102,7 +101,7 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
AlertMessageBox d = new AlertMessageBox("Error in CSV Export", details);
|
AlertMessageBox d = new AlertMessageBox("Error in CSV Export", details);
|
||||||
d.addHideHandler(new HideHandler() {
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,14 +48,14 @@ public class GwtTestCSVExportWizardTD extends GWTTestCase {
|
||||||
// Send a request to the server.
|
// Send a request to the server.
|
||||||
tdGWTService.getTabularResources(new AsyncCallback<ArrayList<TabResource>>() {
|
tdGWTService.getTabularResources(new AsyncCallback<ArrayList<TabResource>>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
// The request resulted in an unexpected error.
|
// The request resulted in an unexpected error.
|
||||||
fail("Request failure: " + caught.getMessage());
|
fail("Request failure: " + caught.getMessage());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<TabResource> result) {
|
public void onSuccess(ArrayList<TabResource> result) {
|
||||||
// Shows the first three resources.
|
// Shows the first three resources.
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
Loading…
Reference in New Issue