Updated to JAVA 7

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@86994 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-12-16 17:51:54 +00:00
parent 8a273a0e65
commit 09a5ded189
36 changed files with 204 additions and 69 deletions

37
.classpath Normal file
View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/tabular-data-csv-import-widget-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-csv-import-widget-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/tabular-data-csv-import-widget-2.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

36
.project Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tabular-data-csv-import-widget</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="tabular-data-csv-import-widget">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.5"/>
</faceted-project>

29
config/profile.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource>
<ID></ID>
<Type>Service</Type>
<Profile>
<Description>tabular-data-csv-import-widget allows csv import from file and workspace</Description>
<Class>PortletsUser</Class>
<Name>tabular-data-csv-import-widget</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Description>tabular-data-csv-import-widget allows csv import from file and workspace</Description>
<Name>tabular-data-csv-import-widget</Name>
<Version>2.0.0-SNAPSHOT</Version>
<MavenCoordinates>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-csv-import-widget</artifactId>
<version>2.0.0-SNAPSHOT</version>
</MavenCoordinates>
<Type>library</Type>
<Files>
<File>tabular-data-csv-import-widget-2.0.0-SNAPSHOT.jar</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

0
distro/INSTALL Normal file
View File

6
distro/LICENSE Normal file
View File

@ -0,0 +1,6 @@
gCube System - License
------------------------------------------------------------
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
The software and documentation is provided by its authors/distributors "as is" and no expressed or
implied warranty is given for its use, quality or fitness for a particular case.

1
distro/MAINTAINERS Normal file
View File

@ -0,0 +1 @@
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"

40
distro/README Normal file
View File

@ -0,0 +1,40 @@
The gCube System - tabular-data-csv-import-widget
------------------------------------------------------------
This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2)
Authors
-------
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
Version and Release Date
------------------------
v. 2.0.0-SNAPSHOT (2013-10-18)
Description
-----------
tabular-data-csv-import-widget allows csv import from file and workspace
Download information
--------------------
Source code URL: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget
Documentation
-------------
tabular-data-csv-import-widget allows csv import from file and workspace
Licensing
---------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

6
distro/changelog.xml Normal file
View File

@ -0,0 +1,6 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.tabular-data-csv-import-widget.1-0-0"
date="2013-10-18">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

1
distro/svnpath.txt Normal file
View File

@ -0,0 +1 @@
https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget

View File

@ -96,7 +96,7 @@ public class CSVConfigCard extends WizardCard {
encodings.setTriggerAction(TriggerAction.ALL);
encodings.addSelectionHandler(new SelectionHandler<String>() {
@Override
public void onSelection(SelectionEvent<String> event) {
updateGrid();
}
@ -106,7 +106,6 @@ public class CSVConfigCard extends WizardCard {
LabelProvider<HeaderPresence> labelProvider = new LabelProvider<HeaderPresence>() {
@Override
public String getLabel(HeaderPresence item) {
return item.getLabel();
}
@ -123,7 +122,6 @@ public class CSVConfigCard extends WizardCard {
header.setValue(HeaderPresence.NONE);
header.addSelectionHandler(new SelectionHandler<HeaderPresence>() {
@Override
public void onSelection(SelectionEvent<HeaderPresence> event) {
updateGrid();
}
@ -163,7 +161,6 @@ public class CSVConfigCard extends WizardCard {
delimitersGroup
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
@Override
public void onValueChange(
ValueChangeEvent<HasValue<Boolean>> event) {
@ -203,7 +200,6 @@ public class CSVConfigCard extends WizardCard {
commentField.setWidth(20);
commentField.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
if (commentField.isValid())
updateGrid();
@ -223,7 +219,6 @@ public class CSVConfigCard extends WizardCard {
csvCheckPanel.getCheckConfiguration().addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
checkConfiguration();
}
@ -232,7 +227,6 @@ public class CSVConfigCard extends WizardCard {
csvCheckPanel.getSkipInvalidCheckBox().addValueChangeHandler(
new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
boolean skip = csvCheckPanel.getSkipInvalidCheckBox()
.getValue();
@ -253,7 +247,6 @@ public class CSVConfigCard extends WizardCard {
TDGWTServiceAsync.INSTANCE.checkCSV(100,
new AsyncCallback<ArrayList<CSVRowError>>() {
@Override
public void onFailure(Throwable caught) {
ErrorMessageBox
.showError(
@ -262,7 +255,6 @@ public class CSVConfigCard extends WizardCard {
"");
}
@Override
public void onSuccess(ArrayList<CSVRowError> errors) {
csvCheckPanel.getCheckConfiguration().setEnabled(true);
@ -294,7 +286,6 @@ public class CSVConfigCard extends WizardCard {
TDGWTServiceAsync.INSTANCE.configureCSVParser(encoding, headerPresence,
delimiter, commentChar, new AsyncCallback<ArrayList<String>>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Failed updating CSV config", caught);
setEnableNextButton(false);
@ -306,7 +297,6 @@ public class CSVConfigCard extends WizardCard {
}
@Override
public void onSuccess(ArrayList<String> result) {
Log.info("CSV header getted");
@ -349,7 +339,6 @@ public class CSVConfigCard extends WizardCard {
TDGWTServiceAsync.INSTANCE
.getAvailableCharset(new AsyncCallback<AvailableCharsetList>() {
@Override
public void onSuccess(AvailableCharsetList result) {
GWT.log("CharsetInfo: "
+ result.getCharsetList().size()
@ -367,7 +356,6 @@ public class CSVConfigCard extends WizardCard {
/**
* {@inheritDoc}
*/
@Override
public void onFailure(Throwable caught) {
GWT.log("Error loading charset list", caught);
showErrorAndHide("Error loading charset list",
@ -379,7 +367,6 @@ public class CSVConfigCard extends WizardCard {
Command sayNextCard = new Command() {
@Override
public void execute() {
CSVTableDetailCard csvTableDetailCard = new CSVTableDetailCard(
csvImportSession);

View File

@ -47,7 +47,7 @@ public class CSVErrorWindow extends Window {
TextButton close = new TextButton("Close");
close.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
hide();
}

View File

@ -5,7 +5,7 @@ import com.google.gwt.core.client.EntryPoint;
public class CSVImportWizardTDEntry implements EntryPoint {
@Override
public void onModuleLoad() {
CSVImportWizardTD importWizard= new CSVImportWizardTD("CSVImport");
Log.info(importWizard.getId());

View File

@ -91,12 +91,11 @@ CSVImportProgressListener {
public void importCSV() {
TDGWTServiceAsync.INSTANCE.startCSVImport(importSession, new AsyncCallback<Void>() {
@Override
public void onSuccess(Void result) {
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
}
@Override
public void onFailure(Throwable caught) {
showErrorAndHide("Error in importCSV",
"An error occured in importCSV: "+caught.getLocalizedMessage(), caught.getStackTrace().toString(), caught);
@ -114,17 +113,15 @@ CSVImportProgressListener {
importCSV();
}
@Override
public void operationInitializing() {
}
@Override
public void operationUpdate(float elaborated) {
}
@Override
public void operationComplete(final TRId trId) {
// final String tableId,final String tableResourceId) {
@ -149,7 +146,7 @@ CSVImportProgressListener {
getWizardWindow().setEnableNextButton(true);
}
@Override
public void operationFailed(Throwable caught, String reason,
String failureDetails) {

View File

@ -100,7 +100,7 @@ public class CSVTableDetailCard extends WizardCard {
public void setup() {
Command sayNextCard = new Command() {
@Override
public void execute() {
checkData();
}
@ -132,7 +132,6 @@ public class CSVTableDetailCard extends WizardCard {
AlertMessageBox d;
HideHandler hideHandler = new HideHandler() {
@Override
public void onHide(HideEvent event) {
getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(false);

View File

@ -34,7 +34,7 @@ public class CSVUploadFileCard extends WizardCard {
@Override
public void setup() {
Command sayNextCard = new Command() {
@Override
public void execute() {
CSVConfigCard csvConfigCard = new CSVConfigCard(importSession);
getWizardWindow().addCard(csvConfigCard);

View File

@ -52,7 +52,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
wpanel.setAllowedMimeTypes("text/csv", "application/zip", "application/x-zip", "application/x-zip-compressed", "application/octet","application/octet-stream");
wpanel.addSelectionHandler(new ItemSelectionHandler() {
@Override
public void onSelection(ItemSelectionEvent event) {
item=event.getSelectedItem();
Log.debug("Selected Item:"+item);
@ -90,7 +90,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
Log.debug("CSVWorkSpaceSelectionCard Call Setup ");
Command sayNextCard = new Command() {
@Override
public void execute() {
Log.debug("CSVWorkSpaceSelectionCard Call sayNextCard wpanel:"+wpanel);
wpanel.disable();
@ -125,7 +124,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
TDGWTServiceAsync tdGwtServiceAsync=TDGWTServiceAsync.INSTANCE;
tdGwtServiceAsync.getFileFromWorkspace(importSession, new AsyncCallback<Void>(){
@Override
public void onFailure(Throwable caught) {
wpanel.endWaiting();
thisCard.showErrorAndHide("Error", "Error retrieving the file from the workspace: "+caught.getLocalizedMessage(),
@ -133,7 +131,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
}
@Override
public void onSuccess(Void result) {
wpanel.endWaiting();
goForward();

View File

@ -168,7 +168,7 @@ public class CsvCheckPanel extends VerticalPanel {
errorAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
errorWindow.show();
}

View File

@ -60,7 +60,7 @@ public class FileUploadPanel extends FormPanel {
addShowHandler(new ShowHandler() {
@Override
public void onShow(ShowEvent event) {
doLayout();
@ -90,7 +90,6 @@ public class FileUploadPanel extends FormPanel {
fileUploadField.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
uploadButton.setEnabled(fileUploadField.isValid());
String path = fileUploadField.getValue();
@ -128,7 +127,6 @@ public class FileUploadPanel extends FormPanel {
uploadButton.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
Log.info("request upload");
@ -153,25 +151,21 @@ public class FileUploadPanel extends FormPanel {
progressUpdater.addListener(new FileUploadProgressListener() {
@Override
public void operationUpdate(float elaborated) {
//
}
@Override
public void operationInitializing() {
}
@Override
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
card.showErrorAndHide("Error uploading the csv file", reason,
failureDetails, caught);
}
@Override
public void operationComplete() {
card.setEnableNextButton(true);
cancelButton.disable();

View File

@ -70,7 +70,7 @@ public class SourceSelectionCard extends WizardCard {
toggle.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
@Override
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
try {
ToggleGroup group = (ToggleGroup) event.getSource();

View File

@ -31,12 +31,11 @@ public class CSVGridView extends GridView<CSVRow> {
{
setViewConfig(new GridViewConfig<CSVRow>() {
@Override
public String getRowStyle(CSVRow model, int rowIndex) {
return "";
}
@Override
public String getColStyle(CSVRow model, ValueProvider<? super CSVRow, ?> valueProvider, int rowIndex, int colIndex) {
return excludedColumns.contains(colIndex)?ResourceBundle.INSTANCE.importCss().getColumnExcluded():"";
}
@ -54,7 +53,7 @@ public class CSVGridView extends GridView<CSVRow> {
includeMenu.addSelectionHandler(new SelectionHandler<Item>() {
@Override
public void onSelection(SelectionEvent<Item> event) {
excludedColumns.remove(new Integer(colIndex));
refresh(false);
@ -69,7 +68,6 @@ public class CSVGridView extends GridView<CSVRow> {
excludeMenu.addSelectionHandler(new SelectionHandler<Item>() {
@Override
public void onSelection(SelectionEvent<Item> event) {
excludedColumns.add(colIndex);
refresh(false);

View File

@ -21,7 +21,6 @@ public class CSVJsonReader implements DataReader<ListLoadResult<CSVRow>, String>
/**
* {@inheritDoc}
*/
@Override
public ListLoadResult<CSVRow> read(Object loadConfig, String json) {
CSVData data = CSVData.getCSVData(json);
return new ListLoadResultBean<CSVRow>(data.getRows());

View File

@ -14,7 +14,6 @@ public class CSVRowKeyProvider implements ModelKeyProvider<CSVRow> {
/**
* {@inheritDoc}
*/
@Override
public String getKey(CSVRow item) {
return item.getId();
}

View File

@ -23,7 +23,6 @@ public class CSVRowValueProvider implements ValueProvider<CSVRow, String> {
/**
* {@inheritDoc}
*/
@Override
public String getValue(CSVRow row) {
return row.getField(column);
}
@ -31,7 +30,6 @@ public class CSVRowValueProvider implements ValueProvider<CSVRow, String> {
/**
* {@inheritDoc}
*/
@Override
public void setValue(CSVRow object, String value) {
}
@ -39,7 +37,6 @@ public class CSVRowValueProvider implements ValueProvider<CSVRow, String> {
/**
* {@inheritDoc}
*/
@Override
public String getPath() {
return column;
}

View File

@ -35,7 +35,6 @@ public class CSVImportProgressBarUpdater implements CSVImportProgressListener {
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {
Log.info("Import completed");
progressBar.updateProgress(1, "Import completed.");
@ -45,19 +44,16 @@ public class CSVImportProgressBarUpdater implements CSVImportProgressListener {
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Import failed");
progressBar.updateText("Import failed.");
}
@Override
public void operationInitializing() {
Log.info("Inport Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Import elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");

View File

@ -38,7 +38,7 @@ public class CSVImportProgressUpdater extends Timer {
TDGWTServiceAsync.INSTANCE
.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
@Override
public void onFailure(Throwable caught) {
cancel();
Log.error("Error retrieving the operation state",
@ -48,7 +48,6 @@ public class CSVImportProgressUpdater extends Timer {
"Failed getting operation updates", message);
}
@Override
public void onSuccess(CSVImportMonitor result) {
Log.info("retrieved CSVImportMonitor: "
+ result.getStatus());
@ -105,7 +104,6 @@ public class CSVImportProgressUpdater extends Timer {
AlertMessageBox d = new AlertMessageBox("Error in CSV Import", details);
d.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent event) {
//
}

View File

@ -30,7 +30,6 @@ public class FileUploadProgressBarUpdater implements FileUploadProgressListener
/**
* {@inheritDoc}
*/
@Override
public void operationComplete() {
Log.info("File upload complete");
progressBar.updateProgress(1, "File upload completed.");
@ -40,19 +39,16 @@ public class FileUploadProgressBarUpdater implements FileUploadProgressListener
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("File upload failed");
progressBar.updateText("File upload failed.");
}
@Override
public void operationInitializing() {
Log.info("File upload inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("File upload elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");

View File

@ -21,7 +21,7 @@ public class FileUploadProgressCardUpdater implements FileUploadProgressListener
public FileUploadProgressCardUpdater() {
}
@Override
public void operationComplete() {
Log.info("File upload completed");
@ -30,17 +30,14 @@ public class FileUploadProgressCardUpdater implements FileUploadProgressListener
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("File upload failed");
}
@Override
public void operationInitializing() {
Log.info("File upload inizializing");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("File uploading: "+elaborated);
}

View File

@ -33,7 +33,7 @@ public class FileUploadProgressUpdater extends Timer {
Log.debug("requesting operation progress");
TDGWTServiceAsync.INSTANCE.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
@Override
public void onFailure(Throwable caught) {
cancel();
Log.error("Error retrieving the operation state", caught);
@ -41,7 +41,6 @@ public class FileUploadProgressUpdater extends Timer {
fireOperationFailed(caught, "Failed getting operation updates", message);
}
@Override
public void onSuccess(FileUploadMonitor result) {
Log.info("retrieved FileUploadMonitor: "+result.getState());
switch (result.getState()) {

View File

@ -34,7 +34,6 @@ public class ErrorMessageBox {
box.setMessage(failureReason);
box.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent event) {
Dialog dialog = (Dialog) event.getSource();

View File

@ -15,10 +15,8 @@ import com.google.gwt.core.client.Callback;
*/
public class NOPCallBack<T,F> implements Callback<T, F> {
@Override
public void onFailure(F reason) {}
@Override
public void onSuccess(T result) {}
}

View File

@ -48,14 +48,13 @@ public class GwtTestCSVImportWizardTD extends GWTTestCase {
// Send a request to the server.
tdGWTService.getTabularResources(new AsyncCallback<ArrayList<TabResource>>() {
@Override
public void onFailure(Throwable caught) {
// The request resulted in an unexpected error.
fail("Request failure: " + caught.getMessage());
}
@Override
public void onSuccess(ArrayList<TabResource> result) {
// Shows the first three resources.
int i=0;