Evaldas Taroza
unread,Feb 6, 2008, 6:01:12 AM2/6/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I have my own GlassPanel, apparently it was quite easy to implement:
/**
* This panel is positioned absolutely and covers the whole client
area of the browser.
* It can be used to disable everything underneath it with appropriate
z-index.
* <p>
* For instance a dialog can attach it to the root panel during
opening, and remove it during closing.
* <p>
* CSS:<br>
* .yanel-GlassPanel
*
* <p>
* Example:<br>
* Add and remove this widget whenever you want, and style it as
follows:
* <pre>
* .yanel-GlassPanel{
* background-color: black;
* filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;
* }
* </pre>
* */
public class GlassPanel extends Composite implements
WindowResizeListener{
public static final String STYLE = "yanel-GlassPanel";
private SimplePanel panel = new SimplePanel();
public GlassPanel(){
initWidget(panel);
panel.setStylePrimaryName(STYLE);
Window.addWindowResizeListener(this);
resize(Window.getClientWidth(), Window.getClientHeight());
}
public void onWindowResized(int width, int height) {
resize(width, height);
}
public void show(){
// Override the styles explicitly, because it's needed every
time the widget is detached
DOM.setStyleAttribute(panel.getElement(), "left", "0");
DOM.setStyleAttribute(panel.getElement(), "top", "0");
DOM.setStyleAttribute(panel.getElement(), "position",
"absolute");
RootPanel.get().add(this);
}
public void hide(){
RootPanel.get().remove(this);
}
private void resize(int width, int height){
panel.setSize(width+"px", height+"px");
}
}
This is how I avoided using external libraries ;)
Evaldas