You should be able to roll your own progress bar widget using that as
a base. You can even employ background-image: whatever; background-
repeat: repeat-y; to create a progress bar that has a shinier look! -
by letting the style for the div itself be defined by a class name,
anyone using the widget can just change it to whatever they think
looks good.
Or.. there's probably at least one GWT extension library out there
that has some sort of progressbar or other.
http://code.google.com/p/google-web-toolkit-incubator/wiki/ProgressBar
I highly recommend using the GWT Widget Library written by Robert
Hanson:
http://gwt-widget.sourceforge.net/
Here is a brief example. I use a timer to progress the bar but you
could easily extend this widget to be moved forward by another
external widget:
import org.gwtwidgets.client.ui.ProgressBar;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
public class SplashDialogBox extends DialogBox{
private void closeDialog(){
this.hide();
}
public void setWidget(Widget w){
final ProgressBar progressBar = new ProgressBar(73);
final Label statusText = new Label("Loading...");
Timer t = new Timer() {
public void run() {
int progress = progressBar.getProgress()+16;
if (progress>100){
cancel(); closeDialog();
}else if(progress>80){
statusText.setText("Initializing...");
}
progressBar.setProgress(progress);
}
};
t.scheduleRepeating(1000);
AbsolutePanel holder = new AbsolutePanel();
holder.addStyleName("Loader");
HorizontalPanel progressBarHolder = new HorizontalPanel();
progressBarHolder.add(progressBar);
progressBarHolder.addStyleName("ProgressBar");
statusText.addStyleName("LoaderText");
progressBarHolder.setCellHorizontalAlignment(progressBar,HasHorizontalAlignment.ALIGN_CENTER);
holder.add(w,-1,-1);
holder.add(progressBarHolder,-1,-1);
holder.add(statusText,275,300);
super.setWidget(holder);
}
public SplashDialogBox(){
super();
this.addStyleName("Loader");
}
public SplashDialogBox(boolean autoShow){
super(autoShow);
this.addStyleName("Loader");
}
}
Hope this helps.