@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), this); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); } }
@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. If the scrollable element is the same as the * root element, then we set the event listener twice (once in * super.onAttach() and once here), which is fine. */ Event.setEventListener(getScrollableElement(), this); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); }
@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), this); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); } }
@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. If the scrollable element is the same as the * root element, then we set the event listener twice (once in * super.onAttach() and once here), which is fine. */ Event.setEventListener(getScrollableElement(), this); }
@Override protected void onDetach() { /* * Detach the event listener in onDetach instead of onUnload so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), null); super.onDetach(); } }
@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. */ Event.setEventListener(getScrollableElement(), this); }
@Override protected void onAttach() { super.onAttach(); /* * Attach the event listener in onAttach instead of onLoad so users cannot * accidentally override it. If the scrollable element is the same as the * root element, then we set the event listener twice (once in * super.onAttach() and once here), which is fine. */ Event.setEventListener(getScrollableElement(), this); }
public CubaWindowWidget() { DOM.sinkEvents(header, DOM.getEventsSunk(header) | Event.ONCONTEXTMENU); addStyleName(NONMODAL_WINDOW_CLASSNAME); Event.sinkEvents(getModalityCurtain(), Event.ONCLICK); Event.setEventListener(getModalityCurtain(), event -> { if (closeOnClickOutside) { if (clickOnModalityCurtain != null) { clickOnModalityCurtain.run(); } } }); }
private void setCheckBoxClickHandler(Path nodePath, Element checkBoxElement, boolean isChecked) { Event.sinkEvents(checkBoxElement, Event.ONCLICK); Event.setEventListener( checkBoxElement, event -> { if (Event.ONCLICK == event.getTypeInt() && event.getTarget().getTagName().equalsIgnoreCase("label")) { handleCheckBoxSelection(nodePath, isChecked); delegate.refreshNodes(); } }); }
public ImageTracker(String imageUrl) { m_image = new Image(imageUrl); Event.setEventListener(m_image.getElement(), new EventListener() { @Override public void onBrowserEvent(Event event) { if(Event.ONLOAD == event.getTypeInt()) { callHandlers(); m_loadComplete = true; } } }); Element div = Document.get().getElementById(m_trackerDivId); div.appendChild(m_image.getElement()); //Document.get().getBody().appendChild(m_image.getElement()); }
public ImageTracker(String imageUrl) { m_image = new Image(imageUrl); Event.setEventListener(m_image.getElement(), new EventListener() { @Override public void onBrowserEvent(Event event) { if(Event.ONLOAD == event.getTypeInt()) { callHandlers(); m_loadComplete = true; } } }); Element div = Document.get().getElementById(m_trackerDivId); div.appendChild(m_image.getElement()); //Document.get().getBody().appendChild(m_image.getElement()); }
@Override public void addCommand(String name, Command command) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); commandMenu.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { command.execute(); } }); }
@Override public void addCommand(String name, Command command) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); commandMenu.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { command.execute(); } }); }
private void addItem(UnorderedList unorderedList, String name, boolean selected, Command onSelect) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); li.setClassName(selected ? "selected" : ""); unorderedList.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onSelect.execute(); } }); }
private void addItem(UnorderedList unorderedList, String name, boolean selected, Command onSelect) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); li.setClassName(selected ? "selected" : ""); unorderedList.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onSelect.execute(); } }); }