Revision c3d9289b
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
98 | 98 |
import com.google.gwt.user.client.Cookies; |
99 | 99 |
import com.google.gwt.user.client.Event; |
100 | 100 |
import com.google.gwt.user.client.History; |
101 |
import com.google.gwt.user.client.Timer; |
|
101 | 102 |
import com.google.gwt.user.client.Window; |
102 | 103 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
103 | 104 |
import com.google.gwt.user.client.ui.Button; |
... | ... | |
900 | 901 |
} |
901 | 902 |
|
902 | 903 |
public void deleteFolder(final Folder folder, final Command callback) { |
904 |
final PleaseWaitPopup pwp = new PleaseWaitPopup(); |
|
905 |
pwp.center(); |
|
903 | 906 |
String path = "/" + folder.getContainer() + "/" + folder.getPrefix() + "?delimiter=/" + "&t=" + System.currentTimeMillis(); |
904 | 907 |
DeleteRequest deleteFolder = new DeleteRequest(getApiPath(), folder.getOwner(), path) { |
905 | 908 |
|
906 | 909 |
@Override |
907 | 910 |
protected void onUnauthorized(Response response) { |
911 |
pwp.hide(); |
|
908 | 912 |
sessionExpired(); |
909 | 913 |
} |
910 | 914 |
|
... | ... | |
918 | 922 |
updateStatistics(); |
919 | 923 |
if (callback != null) |
920 | 924 |
callback.execute(); |
925 |
Timer t = new Timer() { |
|
926 |
|
|
927 |
@Override |
|
928 |
public void run() { |
|
929 |
pwp.hide(); |
|
930 |
} |
|
931 |
}; |
|
932 |
t.schedule(5000); |
|
921 | 933 |
} |
922 | 934 |
}, true); |
923 | 935 |
} |
... | ... | |
934 | 946 |
} |
935 | 947 |
else |
936 | 948 |
displayError("System error unable to delete folder: " + t.getMessage()); |
949 |
pwp.hide(); |
|
937 | 950 |
} |
938 | 951 |
}; |
939 | 952 |
deleteFolder.setHeader("X-Auth-Token", getToken()); |
b/src/gr/grnet/pithos/web/client/PleaseWaitPopup.java | ||
---|---|---|
1 |
package gr.grnet.pithos.web.client; |
|
2 |
|
|
3 |
import com.google.gwt.user.client.ui.Label; |
|
4 |
import com.google.gwt.user.client.ui.PopupPanel; |
|
5 |
|
|
6 |
public class PleaseWaitPopup extends PopupPanel { |
|
7 |
|
|
8 |
public PleaseWaitPopup() { |
|
9 |
setAnimationEnabled(true); |
|
10 |
setGlassEnabled(true); |
|
11 |
setModal(true); |
|
12 |
add(new Label("Please wait ...")); |
|
13 |
} |
|
14 |
} |
Also available in: Unified diff