Revision c9592525
b/src/gr/ebs/gss/web/client/GSS.java | ||
---|---|---|
44 | 44 |
import com.google.gwt.event.logical.shared.SelectionHandler; |
45 | 45 |
import com.google.gwt.event.logical.shared.ValueChangeEvent; |
46 | 46 |
import com.google.gwt.event.logical.shared.ValueChangeHandler; |
47 |
import com.google.gwt.http.client.URL; |
|
47 | 48 |
import com.google.gwt.i18n.client.DateTimeFormat; |
48 | 49 |
import com.google.gwt.resources.client.ClientBundle; |
49 | 50 |
import com.google.gwt.resources.client.ImageResource; |
... | ... | |
568 | 569 |
/** |
569 | 570 |
* Display the 'loading' indicator. |
570 | 571 |
*/ |
571 |
public void showLoadingIndicator() { |
|
572 |
topPanel.getLoading().setVisible(true); |
|
572 |
public void showLoadingIndicator(String message, String path) { |
|
573 |
if(path!=null){ |
|
574 |
String[] split = path.split("/"); |
|
575 |
message = message +" "+URL.decode(split[split.length-1]); |
|
576 |
} |
|
577 |
topPanel.getLoading().show(message); |
|
573 | 578 |
} |
574 | 579 |
|
575 | 580 |
/** |
576 | 581 |
* Hide the 'loading' indicator. |
577 | 582 |
*/ |
578 | 583 |
public void hideLoadingIndicator() { |
579 |
topPanel.getLoading().setVisible(false);
|
|
584 |
topPanel.getLoading().hide();
|
|
580 | 585 |
} |
581 | 586 |
|
582 | 587 |
/** |
b/src/gr/ebs/gss/web/client/LoadingIndicator.java | ||
---|---|---|
23 | 23 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
24 | 24 |
import com.google.gwt.user.client.ui.Composite; |
25 | 25 |
import com.google.gwt.user.client.ui.HTML; |
26 |
import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
|
27 |
import com.google.gwt.user.client.ui.VerticalPanel; |
|
26 | 28 |
|
27 | 29 |
/** |
28 | 30 |
* The 'loading' indicator widget implementation. |
29 | 31 |
*/ |
30 | 32 |
public class LoadingIndicator extends Composite { |
31 |
|
|
33 |
public static final String DEFAULT_MESSAGE="Please Wait"; |
|
34 |
|
|
35 |
HTML messageLabel; |
|
32 | 36 |
/** |
33 | 37 |
* An image bundle for this widgets images. |
34 | 38 |
*/ |
... | ... | |
41 | 45 |
* The widget's constructor that creates a spinning indicator image. |
42 | 46 |
*/ |
43 | 47 |
public LoadingIndicator(Images images) { |
48 |
VerticalPanel vp = new VerticalPanel(); |
|
49 |
//vp.setHorizontalAlignment(HorizontalAlignmentConstant.CENTER); |
|
44 | 50 |
HTML inner = new HTML(AbstractImagePrototype.create(images.loading()).getHTML()); |
45 |
initWidget(inner); |
|
51 |
vp.add(inner); |
|
52 |
vp.add(messageLabel = new HTML(DEFAULT_MESSAGE) ); |
|
53 |
vp.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER); |
|
54 |
vp.setCellHorizontalAlignment(messageLabel, HasHorizontalAlignment.ALIGN_CENTER); |
|
55 |
initWidget(vp); |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
/** |
|
60 |
* Modify the message. |
|
61 |
* |
|
62 |
* @param message the message to set |
|
63 |
*/ |
|
64 |
public void setMessage(String message) { |
|
65 |
messageLabel.setHTML(message); |
|
66 |
} |
|
67 |
|
|
68 |
public void clearMessage(){ |
|
69 |
setMessage(DEFAULT_MESSAGE); |
|
70 |
} |
|
71 |
|
|
72 |
public void show(String msg){ |
|
73 |
if(msg==null) |
|
74 |
setMessage(DEFAULT_MESSAGE); |
|
75 |
else |
|
76 |
setMessage(msg); |
|
77 |
this.setVisible(true); |
|
78 |
} |
|
79 |
|
|
80 |
public void hide(){ |
|
81 |
setMessage(DEFAULT_MESSAGE); |
|
82 |
this.setVisible(false); |
|
46 | 83 |
} |
47 | 84 |
} |
b/src/gr/ebs/gss/web/client/SearchResults.java | ||
---|---|---|
576 | 576 |
clearSelectedRows(); |
577 | 577 |
//clearLabels(); |
578 | 578 |
startIndex = 0; |
579 |
app.showLoadingIndicator(); |
|
579 |
app.showLoadingIndicator("Getting Search Results",null);
|
|
580 | 580 |
if (query == null || query.trim().equals("")) { |
581 | 581 |
searchResults.setHTML("You must specify a query."); |
582 | 582 |
setFiles(new ArrayList()); |
b/src/gr/ebs/gss/web/client/rest/DeleteCommand.java | ||
---|---|---|
43 | 43 |
public DeleteCommand(String pathToDelete, boolean showLoading){ |
44 | 44 |
setShowLoadingIndicator(showLoading); |
45 | 45 |
if(isShowLoadingIndicator()) |
46 |
GSS.get().showLoadingIndicator(); |
|
46 |
GSS.get().showLoadingIndicator("Deleting ",pathToDelete);
|
|
47 | 47 |
final String path; |
48 | 48 |
if(pathToDelete.endsWith("/")) |
49 | 49 |
path = pathToDelete; |
b/src/gr/ebs/gss/web/client/rest/GetCommand.java | ||
---|---|---|
119 | 119 |
public GetCommand(Class<T> theclass, String pathToGet, boolean showLoading, T theCached){ |
120 | 120 |
setShowLoadingIndicator(showLoading); |
121 | 121 |
if(isShowLoadingIndicator()) |
122 |
GSS.get().showLoadingIndicator(); |
|
122 |
GSS.get().showLoadingIndicator("Getting ",pathToGet);
|
|
123 | 123 |
this.aclass = theclass; |
124 | 124 |
if(pathToGet.indexOf("?") != -1) |
125 | 125 |
path = pathToGet; |
... | ... | |
135 | 135 |
public GetCommand(Class<T> theclass, String aUsername , String pathToGet, boolean showLoading, T theCached){ |
136 | 136 |
setShowLoadingIndicator(showLoading); |
137 | 137 |
if(isShowLoadingIndicator()) |
138 |
GSS.get().showLoadingIndicator(); |
|
138 |
GSS.get().showLoadingIndicator("Getting ",pathToGet);
|
|
139 | 139 |
this.aclass = theclass; |
140 | 140 |
path = fixPath(pathToGet); |
141 | 141 |
this.username = aUsername; |
b/src/gr/ebs/gss/web/client/rest/HeadCommand.java | ||
---|---|---|
57 | 57 |
setShowLoadingIndicator(showLoading); |
58 | 58 |
this.aclass = theClass; |
59 | 59 |
if(isShowLoadingIndicator()) |
60 |
GSS.get().showLoadingIndicator(); |
|
60 |
GSS.get().showLoadingIndicator("Getting ",pathToGet);
|
|
61 | 61 |
|
62 | 62 |
if(theClass.equals(FileResource.class)) |
63 | 63 |
path = pathToGet; |
b/src/gr/ebs/gss/web/client/rest/MultipleDeleteCommand.java | ||
---|---|---|
51 | 51 |
public MultipleDeleteCommand(String[] pathToDelete, boolean showLoading){ |
52 | 52 |
setShowLoadingIndicator(showLoading); |
53 | 53 |
if(isShowLoadingIndicator()) |
54 |
GSS.get().showLoadingIndicator(); |
|
54 |
GSS.get().showLoadingIndicator("Deleting "+pathToDelete.length+" items",null);
|
|
55 | 55 |
paths = pathToDelete; |
56 | 56 |
for (final String pathg : pathToDelete) { |
57 | 57 |
GWT.log("[DEL]"+pathg, null); |
b/src/gr/ebs/gss/web/client/rest/MultipleGetCommand.java | ||
---|---|---|
61 | 61 |
public MultipleGetCommand(Class<T> aNewClass, String[] pathToGet, boolean showLoading, Cached[] theCached) { |
62 | 62 |
setShowLoadingIndicator(showLoading); |
63 | 63 |
if (isShowLoadingIndicator()) |
64 |
GSS.get().showLoadingIndicator(); |
|
64 |
GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
|
|
65 | 65 |
aclass = aNewClass; |
66 | 66 |
paths = pathToGet; |
67 | 67 |
this.cached = theCached; |
b/src/gr/ebs/gss/web/client/rest/MultipleHeadCommand.java | ||
---|---|---|
59 | 59 |
public MultipleHeadCommand(Class<T> theClass, String[] pathToGet, boolean showLoading, Cached[] theCached) { |
60 | 60 |
setShowLoadingIndicator(showLoading); |
61 | 61 |
if(isShowLoadingIndicator()) |
62 |
GSS.get().showLoadingIndicator(); |
|
62 |
GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
|
|
63 | 63 |
paths = pathToGet; |
64 | 64 |
this.aclass = theClass; |
65 | 65 |
this.cached = theCached; |
b/src/gr/ebs/gss/web/client/rest/MultiplePostCommand.java | ||
---|---|---|
61 | 61 |
public MultiplePostCommand(String[] pathToDelete, String data, final int okStatusCode, boolean showLoading){ |
62 | 62 |
setShowLoadingIndicator(showLoading); |
63 | 63 |
if(isShowLoadingIndicator()) |
64 |
GSS.get().showLoadingIndicator(); |
|
64 |
GSS.get().showLoadingIndicator("Updating "+pathToDelete.length+" items", null);
|
|
65 | 65 |
paths = pathToDelete; |
66 | 66 |
for (final String pathg : pathToDelete) { |
67 | 67 |
GWT.log("[DEL]"+pathg, null); |
b/src/gr/ebs/gss/web/client/rest/PostCommand.java | ||
---|---|---|
41 | 41 |
public PostCommand(final String path, String data, final int okStatusCode, boolean showLoading) { |
42 | 42 |
setShowLoadingIndicator(showLoading); |
43 | 43 |
if(isShowLoadingIndicator()) |
44 |
GSS.get().showLoadingIndicator(); |
|
44 |
GSS.get().showLoadingIndicator("Updating ",path);
|
|
45 | 45 |
|
46 | 46 |
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, path); |
47 | 47 |
|
Also available in: Unified diff