package org.fedorahosted.flies.webtrans.editor;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.widgetideas.client.ProgressBar;

public class StatusBar extends Composite implements ClickHandler,HasClickHandlers {
	private static class PopupWindow extends DecoratedPopupPanel {
		    public PopupWindow() {
		      super(true);
		      setWidget(new Label("Click outside of this popup to close it"));
		    }
	}

	
	public StatusBar() {
		HorizontalPanel panel = new HorizontalPanel();
		initWidget(panel);
		
		ProgressBar bar = new ProgressBar(0.0, 100.0,0.0);
		bar.setProgress(75.0);
		bar.setWidth("200px");
		
		panel.add(bar);
		addClickHandler(this);
	}
	
	@Override
	public void onClick(ClickEvent event) {
		// TODO Auto-generated method stub
		new PopupWindow().show();
	}

	@Override
	public HandlerRegistration addClickHandler(ClickHandler handler) {
		// TODO Auto-generated method stub
		return addDomHandler(handler, ClickEvent.getType());
	}

}

@@ -259,16 +259,98 @@
 ration;%0A
+import com.google.gwt.user.client.DOM;%0Aimport com.google.gwt.user.client.Element;%0A
 import c
@@ -389,16 +389,16 @@
 posite;%0A
-
 import c
@@ -684,16 +684,50 @@
 dlers %7B%0A
+%09private final ProgressBar bar;%0A%09%0A
 %09private
@@ -1016,28 +1016,16 @@
 );%0A%09%09%0A%09%09
-ProgressBar 
 bar = ne
@@ -1126,16 +1126,19 @@
 d(bar);%0A
+%09%09%0A
 %09%09addCli
@@ -1254,25 +1254,204 @@
 b%0A%09%09
-new PopupWindow()
+PopupWindow popupWindow = new PopupWindow();%0A%09%09int top = bar.getAbsoluteTop();%0A%09    int left = bar.getAbsoluteLeft();%0A%09%09popupWindow.setPopupPosition(left, top-bar.getOffsetHeight());%0A%09%09popupWindow
 .sho

Modify the position of Popup Window