Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. package mods.client.resultSelector;
  2.  
  3. import com.google.gwt.event.dom.client.MouseDownEvent;
  4. import com.google.gwt.event.dom.client.MouseDownHandler;
  5. import com.google.gwt.user.client.ui.AbsolutePanel;
  6. import com.google.gwt.user.client.ui.Composite;
  7.  
  8. public class MousyAbsolutePanel extends Composite implements MouseDownHandler {
  9.  
  10. AbsolutePanel abs = new AbsolutePanel();
  11.  
  12. public MousyAbsolutePanel(int width){
  13. System.out.println("MousyAbsolutePanel being created with width:" + width);
  14. initWidget(abs);
  15. abs.setWidth(String.valueOf(width));
  16. abs.setHeight("100%");
  17. abs.setStyleName("mousyAbsolutePanel");
  18. }
  19.  
  20. public void onMouseDown(MouseDownEvent event) {
  21. System.out.println("onMouseDown()");
  22. }
  23.  
  24. }
  25.  
  26. package mods.client.resultSelector;
  27.  
  28. import com.google.gwt.event.dom.client.MouseDownEvent;
  29. import com.google.gwt.event.dom.client.MouseDownHandler;
  30. import com.google.gwt.event.dom.client.HasMouseDownHandlers;
  31. import com.google.gwt.user.client.ui.AbsolutePanel;
  32.  
  33.  
  34. public class MousyAbsolutePanel extends AbsolutePanel implements
  35. MouseDownHandler,HasMouseDownHandlers {
  36.  
  37. public MousyAbsolutePanel(int width) {
  38. System.out.println("MousyAbsolutePanel being created with width:" + width);
  39.  
  40. this.setWidth(String.valueOf(width));
  41. this.setHeight("100%");
  42. this.setStyleName("mousyAbsolutePanel");
  43.  
  44. this.addMouseDownHandler(this);
  45. }
  46.  
  47. /**
  48. * MouseDownHandler
  49. */
  50. public void onMouseDown(MouseDownEvent event) {
  51. System.out.println("onMouseDown()");
  52. }
  53.  
  54. /**
  55. * HasMouseDownHandlers - Code to add handlers to the panel
  56. */
  57. public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
  58. return addDomHandler(handler, MouseDownEvent.getType());
  59. }
  60.  
  61. }
Add Comment
Please, Sign In to add comment