|
a |
|
b/Workbench/src/de/kuei/metafora/gwt/smack/client/documents/DocumentCallBack.java |
|
|
1 |
package de.kuei.metafora.gwt.smack.client.documents;
|
|
|
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
6 |
import com.google.gwt.user.client.ui.Anchor;
|
|
|
7 |
|
|
|
8 |
import de.kuei.metafora.gwt.smack.shared.ThinDocStructure;
|
|
|
9 |
|
|
|
10 |
public class DocumentCallBack implements AsyncCallback<List<ThinDocStructure>> {
|
|
|
11 |
|
|
|
12 |
/**
|
|
|
13 |
* This class represents the AsyncCallback for getting the List of
|
|
|
14 |
* ThinDocStructures from the server on client-startup
|
|
|
15 |
*/
|
|
|
16 |
private Documents doctable;
|
|
|
17 |
|
|
|
18 |
public DocumentCallBack(Documents doctable) {
|
|
|
19 |
this.doctable = doctable;
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
@Override
|
|
|
23 |
public void onFailure(Throwable caught) {
|
|
|
24 |
// TODO Auto-generated method stub
|
|
|
25 |
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
@Override
|
|
|
29 |
public void onSuccess(List<ThinDocStructure> result) {
|
|
|
30 |
for (ThinDocStructure doc : result) {
|
|
|
31 |
// Create the entry in the Documents-section of the Workbench
|
|
|
32 |
|
|
|
33 |
String time = doc.getTime();
|
|
|
34 |
Anchor anchor = new Anchor(doc.getDocId());
|
|
|
35 |
anchor.setTarget("_parent");
|
|
|
36 |
doctable.add(doc.getDocname(), anchor, time);
|
|
|
37 |
}
|
|
|
38 |
}
|
|
|
39 |
}
|