*/\r
package gr.ebs.gss.client;\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.Command;\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.MenuBar;\r
import com.google.gwt.user.client.ui.PopupPanel;\r
-import com.google.gwt.user.client.ui.Widget;\r
\r
/**\r
* The 'settings' menu implementation.\r
*/\r
-public class SettingsMenu extends PopupPanel implements ClickListener {\r
+public class SettingsMenu extends PopupPanel implements ClickHandler {\r
\r
/**\r
* The widget's images.\r
/**\r
* An image bundle for this widgets images.\r
*/\r
- public interface Images extends MessagePanel.Images {\r
+ public interface Images extends ClientBundle,MessagePanel.Images {\r
\r
/**\r
* Will bundle the file 'advancedsettings.png' residing in the package\r
*\r
* @return the image prototype\r
*/\r
- @Resource("gr/ebs/gss/resources/advancedsettings.png")\r
- AbstractImagePrototype preferences();\r
+ @Source("gr/ebs/gss/resources/advancedsettings.png")\r
+ ImageResource preferences();\r
\r
- @Resource("gr/ebs/gss/resources/lock.png")\r
- AbstractImagePrototype credentials();\r
+ @Source("gr/ebs/gss/resources/lock.png")\r
+ ImageResource credentials();\r
\r
}\r
\r
};\r
contextMenu = new MenuBar(true);\r
// contextMenu.addItem("<span>" + newImages.preferences().getHTML() + " Preferences</span>", true, cmd);\r
- contextMenu.addItem("<span>" + newImages.credentials().getHTML() + " Show Credentials</span>", true, userCredentialsCommand);\r
+ contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.credentials()).getHTML() + " Show Credentials</span>", true, userCredentialsCommand);\r
\r
add(contextMenu);\r
// setStyleName("toolbarPopup");\r
}\r
\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see com.google.gwt.user.client.ui.ClickListener#onClick(com.google.gwt.user.client.ui.Widget)\r
- */\r
- public void onClick(final Widget sender) {\r
+ @Override\r
+ public void onClick(final ClickEvent event) {\r
final SettingsMenu menu = new SettingsMenu(images);\r
- final int left = sender.getAbsoluteLeft();\r
- final int top = sender.getAbsoluteTop() + sender.getOffsetHeight();\r
+ final int left = event.getRelativeElement().getAbsoluteLeft();\r
+ final int top = event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();\r
menu.setPopupPosition(left, top);\r
\r
menu.show();\r