当前位置: 首页>>代码示例>>Java>>正文


Java HasBlurHandlers类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.HasBlurHandlers的典型用法代码示例。如果您正苦于以下问题:Java HasBlurHandlers类的具体用法?Java HasBlurHandlers怎么用?Java HasBlurHandlers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HasBlurHandlers类属于com.google.gwt.event.dom.client包,在下文中一共展示了HasBlurHandlers类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setFocusLost

import com.google.gwt.event.dom.client.HasBlurHandlers; //导入依赖的package包/类
public void setFocusLost(JavaScriptObject aValue) {
	if (focusLost != aValue) {
		if (blurReg != null) {
			blurReg.removeHandler();
			blurReg = null;
		}
		focusLost = aValue;
		if (focusLost != null && component instanceof HasBlurHandlers) {
			blurReg = ((HasBlurHandlers) component).addBlurHandler(new BlurHandler() {
				@Override
				public void onBlur(BlurEvent event) {
					if (focusLost != null) {
						executeEvent(focusLost, EventsPublisher.publish(event));
					}
					mouseState = MOUSE.NULL;
				}
			});
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:EventsExecutor.java

示例2: setChildWidget

import com.google.gwt.event.dom.client.HasBlurHandlers; //导入依赖的package包/类
/**
 * Set the widget that the EditorPanel will display. This method will automatically call
 * {@link #setEditor}.
 *
 * @param pwidget a {@link IsEditor} widget
 */
@Override
@UiChild(limit = 1, tagname = "widget")
public void setChildWidget(final TakesValue<T> pwidget) {
  this.widget = (Widget) pwidget;
  this.contents.add(this.widget);
  this.setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
  if (pwidget instanceof HasFocusHandlers) {
    ((HasFocusHandlers) pwidget)
        .addFocusHandler(pevent -> AbstractDecoratorWithLabel.this.addStyleToLabel());
  }
  if (pwidget instanceof HasBlurHandlers) {
    ((HasBlurHandlers) pwidget).addBlurHandler(pevent -> {
      boolean hide = true;
      if (AbstractDecoratorWithLabel.this.widget instanceof TakesValue<?>) {
        hide = StringUtils.isEmpty(Objects
            .toString(((TakesValue<?>) AbstractDecoratorWithLabel.this.widget).getValue(), null));
      }
      if (hide) {
        AbstractDecoratorWithLabel.this.removeStyleFromLabel();
      }
    });
  }
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:30,代码来源:AbstractDecoratorWithLabel.java

示例3: fixHandlers

import com.google.gwt.event.dom.client.HasBlurHandlers; //导入依赖的package包/类
private void fixHandlers(final FilterBox box, Widget w) {
	if (w instanceof HasBlurHandlers)
		((HasBlurHandlers)w).addBlurHandler(box.iBlurHandler);
	if (w instanceof HasFocusHandlers)
		((HasFocusHandlers)w).addFocusHandler(box.iFocusHandler);
	if (w instanceof HasKeyDownHandlers)
		((HasKeyDownHandlers)w).addKeyDownHandler(new KeyDownHandler() {
			@Override
			public void onKeyDown(KeyDownEvent event) {
				if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE)
					if (box.isFilterPopupShowing()) box.hideFilterPopup();
			}
		});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:FilterBox.java

示例4: resetFocusHandler

import com.google.gwt.event.dom.client.HasBlurHandlers; //导入依赖的package包/类
private void resetFocusHandler() {
	this.registrationCollection.removeHandler();
	boolean hasError = this.hasErrors();
	if (!hasError && !this.focused) {
		this.setTabIndex(0);
		this.registrationCollection.add(this.addFocusHandler(this));
	} else if (hasError && !this.focused) {
		this.setTabIndex(-1);
		if (this.input instanceof HasFocusHandlers) {
			this.registrationCollection.add(((HasFocusHandlers) this.input).addFocusHandler(this));
		}
	} else {
		this.setTabIndex(-1);
		if (this.input instanceof HasBlurHandlers) {
			this.registrationCollection.add(((HasBlurHandlers) this.input).addBlurHandler(this));
		}
		Scheduler.get().scheduleDeferred(new ScheduledCommand() {

			@Override
			public void execute() {
				if (InternalListItem.this.input instanceof Focusable) {
					((Focusable) InternalListItem.this.input).setFocus(true);
				}
			}
		});
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:28,代码来源:InputList.java


注:本文中的com.google.gwt.event.dom.client.HasBlurHandlers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。