示例#1
0
 public void setSelectedIndex(int itemIdx, boolean fireEvent) {
   String selectedStyle = resources_.listStyle().selectedItem();
   panel_.getWidget(selectedIdx_).removeStyleName(selectedStyle);
   selectedIdx_ = itemIdx;
   panel_.getWidget(selectedIdx_).addStyleName(selectedStyle);
   panel_.getWidget(selectedIdx_).getElement().scrollIntoView();
   if (fireEvent) {
     DomEvent.fireNativeEvent(Document.get().createChangeEvent(), handlerManager_);
   }
 }
  private void onEnd(DomEvent<?> event) {

    Element relativeElement = event.getRelativeElement();
    String modeS = relativeElement.getAttribute("mode");
    // Element target = event.getNativeEvent().getEventTarget().cast();
    if (addList.getElement().isOrHasChild(relativeElement)) {
      if (modeS.isEmpty()) {
        handleAddClick();
      } else {
        int mode = Integer.parseInt(modeS);
        addAssignment(mode);
        relativeElement.removeFromParent();
        userAddModes.setVisible(false);
      }
      event.stopPropagation();
    } else {
      userAddModes.setVisible(false);
      event.stopPropagation();
    }
  }
示例#3
0
 public void click() {
   NativeEvent clickEvent =
       Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false);
   DomEvent.fireNativeEvent(clickEvent, hasHandlers_);
 }
 private void fireBlurEvent() {
   DomEvent.fireNativeEvent(Document.get().createBlurEvent(), this);
 }
示例#5
0
  /**
   * Propagates the a focus event.
   *
   * <p>
   */
  protected void propagateFocusEvent() {

    NativeEvent nativeEvent = Document.get().createFocusEvent();
    DomEvent.fireNativeEvent(nativeEvent, this, getElement());
  }
示例#6
0
 public void invalidateCache() {
   previousResults_.clear();
   DomEvent.fireNativeEvent(Document.get().createChangeEvent(), handlerManager_);
 }
示例#7
0
 @Override
 public void onClick(ClickEvent event) {
   setActive(!isActive());
   // re-fire the event with this as the source
   DomEvent.fireNativeEvent(Event.getCurrentEvent(), this);
 }