Child: [85c2d9] (diff)

Download this file

DocumentCallBack.java    40 lines (29 with data), 1.0 kB

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