\r
import gr.ebs.gss.client.commands.NewGroupCommand;\r
\r
+import com.google.gwt.event.dom.client.ClickEvent;\r
+import com.google.gwt.event.dom.client.ClickHandler;\r
+import com.google.gwt.resources.client.ClientBundle;\r
+import com.google.gwt.resources.client.ImageResource;\r
import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
-import com.google.gwt.user.client.ui.ClickListener;\r
-import com.google.gwt.user.client.ui.ImageBundle;\r
import com.google.gwt.user.client.ui.MenuBar;\r
import com.google.gwt.user.client.ui.PopupPanel;\r
-import com.google.gwt.user.client.ui.Widget;\r
\r
/**\r
* The 'Group' menu implementation.\r
*/\r
-public class GroupMenu extends PopupPanel implements ClickListener {\r
+public class GroupMenu extends PopupPanel implements ClickHandler {\r
/**\r
* The widget's images.\r
*/\r
/**\r
* An image bundle for this widgets images.\r
*/\r
- public interface Images extends ImageBundle {\r
- @Resource("gr/ebs/gss/resources/groupevent.png")\r
- AbstractImagePrototype groupNew();\r
+ public interface Images extends ClientBundle {\r
+ @Source("gr/ebs/gss/resources/groupevent.png")\r
+ ImageResource groupNew();\r
\r
- @Resource("gr/ebs/gss/resources/view_text.png")\r
- AbstractImagePrototype viewText();\r
+ @Source("gr/ebs/gss/resources/view_text.png")\r
+ ImageResource viewText();\r
\r
}\r
\r
images = newImages;\r
\r
contextMenu = new MenuBar(true);\r
- contextMenu.addItem("<span>" + newImages.groupNew().getHTML() + " New Group</span>", true, new NewGroupCommand(this));\r
+ contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.groupNew()).getHTML() + " New Group</span>", true, new NewGroupCommand(this));\r
\r
add(contextMenu);\r
}\r
\r
- public void onClick(Widget sender) {\r
+ public void onClick(ClickEvent event) {\r
GroupMenu menu = new GroupMenu(images);\r
- int left = sender.getAbsoluteLeft();\r
- int top = sender.getAbsoluteTop() + sender.getOffsetHeight();\r
+ int left = event.getRelativeElement().getAbsoluteLeft();\r
+ int top = event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();\r
menu.setPopupPosition(left, top);\r
\r
menu.show();\r