@Override public HandlerRegistration addAttachHandler(Handler handler) { return delegate.addAttachHandler(handler); }
/** * 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(); } }); }
/** * 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(); } }); }
attachHandlerReg = widget.asWidget().addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) {
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(); } }); }
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(); } }); }
@Override protected void decorateWidget(Widget w) { w.addAttachHandler(event -> { WidgetTooltip.this.widgetAttached = event.isAttached(); scheduleTooltipUpdate(); }); }
/** * 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(); } }); }
/** * 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(); } }); }
public void load() { assert !loaded : "Cannot load an already loaded handler registry."; attachHandler = widget.asWidget().addAttachHandler(event -> { // Detach event if(clearOnUnload && !event.isAttached()) { clearHandlers(); } }); }
public void load() { assert !loaded : "Cannot load an already loaded handler registry."; attachHandler = widget.asWidget().addAttachHandler(event -> { // Detach event if(clearOnUnload && !event.isAttached()) { clearHandlers(); } }); }
@Override public void execute() { removeDataIfExists(); reconfigure(); getWidget().addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) { if (!event.isAttached()) { changeVisibility(VisibilityChange.HIDE); } } }); } });
@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(); } } }); }
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(); } }); }
/** * 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(); } }
/** * 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(); } }
@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)); } }
@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); } }
@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); } }
@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)); } }