com.google.gwt.user.client.ui.Widget.addAttachHandler()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中com.google.gwt.user.client.ui.Widget.addAttachHandler()方法的一些代码示例,展示了Widget.addAttachHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.addAttachHandler()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
方法名:addAttachHandler

Widget.addAttachHandler介绍

暂无

代码示例

代码示例来源:origin: stephenh/tessell

@Override
public HandlerRegistration addAttachHandler(Handler handler) {
 return delegate.addAttachHandler(handler);
}

代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3

/**
 * Default error handler.
 *
 * @param parent the parent of this error handler.
 */
public DefaultErrorHandler(Widget widget) {
  super();
  assert widget != null;
  this.inputWidget = widget;
  this.inputWidget.addAttachHandler(new Handler() {
    @Override
    public void onAttachOrDetach(AttachEvent event) {
      init();
    }
  });
}

代码示例来源:origin: gwtbootstrap3/gwtbootstrap3

/**
 * Default error handler.
 *
 * @param parent the parent of this error handler.
 */
public DefaultErrorHandler(Widget widget) {
  super();
  assert widget != null;
  this.inputWidget = widget;
  this.inputWidget.addAttachHandler(new Handler() {
    @Override
    public void onAttachOrDetach(AttachEvent event) {
      init();
    }
  });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

attachHandlerReg = widget.asWidget().addAttachHandler(new AttachEvent.Handler() {
 @Override
 public void onAttachOrDetach(AttachEvent event) {

代码示例来源:origin: com.intendia.gwt.rxgwt/rxgwt

public RxWidget(Widget wrap) {
  this.wrap = wrap;
  wrap.addAttachHandler(event -> {
    if (event.isAttached()) {
      for (Observable<?> o : attachObservables) subscribe(o, attachSubscriptions);
    } else {
      for (Subscription s : attachSubscriptions) s.unsubscribe();
      attachSubscriptions.clear();
    }
  });
}

代码示例来源:origin: intendia-oss/rxgwt

public RxWidget(Widget wrap) {
  this.wrap = wrap;
  wrap.addAttachHandler(event -> {
    if (event.isAttached()) {
      for (Completable o : attachObservables) subscribe(o, attachSubscriptions);
    } else {
      for (Disposable s : attachSubscriptions) s.dispose();
      attachSubscriptions.clear();
    }
  });
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
protected void decorateWidget(Widget w) {
  w.addAttachHandler(event -> {
    WidgetTooltip.this.widgetAttached = event.isAttached();
    scheduleTooltipUpdate();
  });
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

/**
 * Default error handler.
 *
 * @param widget the parent of this error handler.
 */
public DefaultErrorHandler(Widget widget) {
  super();
  assert widget != null;
  this.inputWidget = widget;
  this.inputWidget.addAttachHandler(event -> {
    if (event.isAttached()) {
      init();
    }
  });
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

/**
 * Default error handler.
 *
 * @param widget the parent of this error handler.
 */
public DefaultErrorHandler(Widget widget) {
  super();
  assert widget != null;
  this.inputWidget = widget;
  this.inputWidget.addAttachHandler(event -> {
    if (event.isAttached()) {
      init();
    }
  });
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

public void load() {
  assert !loaded : "Cannot load an already loaded handler registry.";
  attachHandler = widget.asWidget().addAttachHandler(event -> {
    // Detach event
    if(clearOnUnload && !event.isAttached()) {
      clearHandlers();
    }
  });
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

public void load() {
  assert !loaded : "Cannot load an already loaded handler registry.";
  attachHandler = widget.asWidget().addAttachHandler(event -> {
    // Detach event
    if(clearOnUnload && !event.isAttached()) {
      clearHandlers();
    }
  });
}

代码示例来源:origin: gwtbootstrap/gwt-bootstrap

@Override
  public void execute() {
    removeDataIfExists();
    
    reconfigure();
    
    getWidget().addAttachHandler(new AttachEvent.Handler() {
      
      @Override
      public void onAttachOrDetach(AttachEvent event) {
        if (!event.isAttached()) {
          changeVisibility(VisibilityChange.HIDE);
        }
      }
    });
  }
});

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

@Override
protected void extend(ServerConnector target) {
  textConnector = (TextFieldConnector) target;
  textWidget = textConnector.getWidget();
  addHandlers();
  updateIndicatorFromParentState();
  textWidget.addAttachHandler(new AttachEvent.Handler() {
    @Override
    public void onAttachOrDetach(AttachEvent event) {
      if (event.isAttached()) {
        assembleAndAttach();
      }
    }
  });
}

代码示例来源:origin: ArcBees/GWTP

protected void initWidget(IsWidget widget) {
  if (this.widget != null) {
    throw new IllegalStateException("ViewImpl.initWidget() may only be called once.");
  } else if (widget == null) {
    throw new NullPointerException("widget cannot be null");
  }
  this.widget = widget.asWidget();
  asWidget().addAttachHandler(event -> {
    if (event.isAttached()) {
      onAttach();
    } else {
      onDetach();
    }
  });
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

/**
 * Detect and apply waves, now or when the widget is attached.
 *
 * @param widget target widget to ensure is attached first
 */
public static void detectAndApply(Widget widget) {
  if (!widget.isAttached()) {
    widget.addAttachHandler(event -> {
      if (event.isAttached()) {
        detectAndApply();
      }
    });
  } else {
    detectAndApply();
  }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

/**
 * Detect and apply waves, now or when the widget is attached.
 *
 * @param widget target widget to ensure is attached first
 */
public static void detectAndApply(Widget widget) {
  if (!widget.isAttached()) {
    widget.addAttachHandler(event -> {
      if (event.isAttached()) {
        detectAndApply();
      }
    });
  } else {
    detectAndApply();
  }
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

@Override
public void setTooltip(String tooltip, String... classes) {
  setTooltip(tooltip);
  if (this.tooltip.getWidget().isAttached()) {
    addTooltipClass(classes);
  } else {
    this.tooltip.getWidget().addAttachHandler(event -> addTooltipClass(classes));
  }
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

@Override
public void setEnabled(boolean enabled) {
  if (!uiObject.isAttached() && handler == null) {
    handler = uiObject.addAttachHandler(event -> {
      if (event.isAttached()) {
        applyEnabled(enabled, uiObject);
      } else if (handler != null) {
        handler.removeHandler();
        handler = null;
      }
    });
  } else {
    applyEnabled(enabled, uiObject);
  }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

@Override
public void setEnabled(boolean enabled) {
  if (!uiObject.isAttached() && handler == null) {
    handler = uiObject.addAttachHandler(event -> {
      if (event.isAttached()) {
        applyEnabled(enabled, uiObject);
      } else if (handler != null) {
        handler.removeHandler();
        handler = null;
      }
    });
  } else {
    applyEnabled(enabled, uiObject);
  }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

@Override
public void setTooltip(String tooltip, String... classes) {
  setTooltip(tooltip);
  if (this.tooltip.getWidget().isAttached()) {
    addTooltipClass(classes);
  } else {
    this.tooltip.getWidget().addAttachHandler(event -> addTooltipClass(classes));
  }
}

相关文章