import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.http.client.URL;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
/**
* Display the 'loading' indicator.
*/
- public void showLoadingIndicator() {
- topPanel.getLoading().setVisible(true);
+ public void showLoadingIndicator(String message, String path) {
+ if(path!=null){
+ String[] split = path.split("/");
+ message = message +" "+URL.decode(split[split.length-1]);
+ }
+ topPanel.getLoading().show(message);
}
/**
* Hide the 'loading' indicator.
*/
public void hideLoadingIndicator() {
- topPanel.getLoading().setVisible(false);
+ topPanel.getLoading().hide();
}
/**
import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
import com.google.gwt.user.client.ui.Composite;\r
import com.google.gwt.user.client.ui.HTML;\r
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
+import com.google.gwt.user.client.ui.VerticalPanel;\r
\r
/**\r
* The 'loading' indicator widget implementation.\r
*/\r
public class LoadingIndicator extends Composite {\r
-\r
+ public static final String DEFAULT_MESSAGE="Please Wait";\r
+ \r
+ HTML messageLabel;\r
/**\r
* An image bundle for this widgets images.\r
*/\r
* The widget's constructor that creates a spinning indicator image.\r
*/\r
public LoadingIndicator(Images images) {\r
+ VerticalPanel vp = new VerticalPanel();\r
+ //vp.setHorizontalAlignment(HorizontalAlignmentConstant.CENTER);\r
HTML inner = new HTML(AbstractImagePrototype.create(images.loading()).getHTML());\r
- initWidget(inner);\r
+ vp.add(inner);\r
+ vp.add(messageLabel = new HTML(DEFAULT_MESSAGE) );\r
+ vp.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER);\r
+ vp.setCellHorizontalAlignment(messageLabel, HasHorizontalAlignment.ALIGN_CENTER);\r
+ initWidget(vp);\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Modify the message.\r
+ *\r
+ * @param message the message to set\r
+ */\r
+ public void setMessage(String message) {\r
+ messageLabel.setHTML(message);\r
+ }\r
+ \r
+ public void clearMessage(){\r
+ setMessage(DEFAULT_MESSAGE);\r
+ }\r
+ \r
+ public void show(String msg){\r
+ if(msg==null)\r
+ setMessage(DEFAULT_MESSAGE);\r
+ else\r
+ setMessage(msg);\r
+ this.setVisible(true);\r
+ }\r
+ \r
+ public void hide(){\r
+ setMessage(DEFAULT_MESSAGE);\r
+ this.setVisible(false);\r
}\r
}\r
clearSelectedRows();
//clearLabels();
startIndex = 0;
- app.showLoadingIndicator();
+ app.showLoadingIndicator("Getting Search Results",null);
if (query == null || query.trim().equals("")) {
searchResults.setHTML("You must specify a query.");
setFiles(new ArrayList());
public DeleteCommand(String pathToDelete, boolean showLoading){
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Deleting ",pathToDelete);
final String path;
if(pathToDelete.endsWith("/"))
path = pathToDelete;
public GetCommand(Class<T> theclass, String pathToGet, boolean showLoading, T theCached){
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Getting ",pathToGet);
this.aclass = theclass;
if(pathToGet.indexOf("?") != -1)
path = pathToGet;
public GetCommand(Class<T> theclass, String aUsername , String pathToGet, boolean showLoading, T theCached){
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Getting ",pathToGet);
this.aclass = theclass;
path = fixPath(pathToGet);
this.username = aUsername;
setShowLoadingIndicator(showLoading);
this.aclass = theClass;
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Getting ",pathToGet);
if(theClass.equals(FileResource.class))
path = pathToGet;
public MultipleDeleteCommand(String[] pathToDelete, boolean showLoading){
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Deleting "+pathToDelete.length+" items",null);
paths = pathToDelete;
for (final String pathg : pathToDelete) {
GWT.log("[DEL]"+pathg, null);
public MultipleGetCommand(Class<T> aNewClass, String[] pathToGet, boolean showLoading, Cached[] theCached) {
setShowLoadingIndicator(showLoading);
if (isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
aclass = aNewClass;
paths = pathToGet;
this.cached = theCached;
public MultipleHeadCommand(Class<T> theClass, String[] pathToGet, boolean showLoading, Cached[] theCached) {
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Getting "+pathToGet.length+" items", null);
paths = pathToGet;
this.aclass = theClass;
this.cached = theCached;
public MultiplePostCommand(String[] pathToDelete, String data, final int okStatusCode, boolean showLoading){
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Updating "+pathToDelete.length+" items", null);
paths = pathToDelete;
for (final String pathg : pathToDelete) {
GWT.log("[DEL]"+pathg, null);
public PostCommand(final String path, String data, final int okStatusCode, boolean showLoading) {
setShowLoadingIndicator(showLoading);
if(isShowLoadingIndicator())
- GSS.get().showLoadingIndicator();
+ GSS.get().showLoadingIndicator("Updating ",path);
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, path);