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


Java BlurEvent类代码示例

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


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

示例1: testValidNumericValueConstraintMatch

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
private void testValidNumericValueConstraintMatch(final String scoreHolderClass,
                                                  final String constraintMatchValue) throws Exception {
    ConstraintMatchInputWidgetBlurHandler handler = new ConstraintMatchInputWidgetBlurHandler(widget,
                                                                                              translationService,
                                                                                              scoreHolderClass);

    when(widget.getConstraintMatchValue()).thenReturn(constraintMatchValue);
    when(translationService.getTranslation(GuidedRuleEditorConstants.ConstraintMatchInputWidgetBlurHandler_IntegerValueParsingError))
            .thenReturn("translation");

    handler.onBlur(mock(BlurEvent.class));

    verify(widget,
           never()).showError("translation");
    verify(widget,
           times(1)).clearError();
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:ConstraintMatchInputWidgetBlurHandlerTest.java

示例2: addBlurHandler

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
  if (!blurHandlerAdded) {
    blurHandlerAdded = true;
    final OrionTextViewOverlay textView = this.editorOverlay.getTextView();
    textView.addEventListener(
        OrionEventConstants.BLUR_EVENT,
        new OrionTextViewOverlay.EventHandlerNoParameter() {

          @Override
          public void onEvent() {
            fireBlurEvent();
          }
        });
  }
  return addHandler(handler, BlurEvent.getType());
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:OrionEditorWidget.java

示例3: addHandlers

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
private void addHandlers() {
    BlurHandler blurHandler =  new BlurHandler() {
        public void onBlur(BlurEvent ev) {
            checkForChange(true);
        }
    };
    _textBox.addKeyPressHandler(new KeyHandler());
    _textBox.addBlurHandler(blurHandler);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:10,代码来源:TextBoxInputField.java

示例4: onBlur

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public void onBlur(BlurEvent p_event)
{
  if( !m_isEditableMode && m_text.getText().isEmpty() )
  {
    return;
  }
  if( m_isEditableMode
      && m_text.getText().equalsIgnoreCase( GameEngine.model().getGame().getMessage() ) )
  {
    // message didn't change: don't send message event
    return;
  }
  if( GameEngine.model().getGame().isRecordingScript() )
  {
    // or we are recording user event
    GameEngine.model().getGame().setMessage( m_text.getText() );
    return;
  }
  EbEvtMessage message = new EbEvtMessage();
  message.setGame( GameEngine.model().getGame() );
  message.setMessage( m_text.getText().trim() );
  message.setAccountId( AppMain.instance().getMyAccount().getId() );
  GameEngine.model().runSingleAction( message );
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:26,代码来源:WgtMessages.java

示例5: addLostFocusHandler

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
private void addLostFocusHandler(final PropertyEditorFieldInfo property,
                                 final PropertyEditorPasswordTextBox passwordTextBox) {

    passwordTextBox.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            if (validate(property,
                         passwordTextBox.getText())) {
                passwordTextBox.clearOldValidationErrors();
                property.setCurrentStringValue(passwordTextBox.getText());
                propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
                                                                                  passwordTextBox.getText()));
            } else {
                passwordTextBox.setValidationError(getValidatorErrorMessage(property,
                                                                            passwordTextBox.getText()));
                passwordTextBox.setText(property.getCurrentStringValue());
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:SecretTextField.java

示例6: addLostFocusHandler

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
private void addLostFocusHandler(final PropertyEditorFieldInfo property,
                                 final PropertyEditorTextBox textBox) {

    textBox.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            if (validate(property,
                         textBox.getText())) {
                textBox.clearOldValidationErrors();
                property.setCurrentStringValue(textBox.getText());
                propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
                                                                                  textBox.getText()));
            } else {
                textBox.setValidationError(getValidatorErrorMessage(property,
                                                                    textBox.getText()));
                textBox.setText(property.getCurrentStringValue());
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:TextField.java

示例7: createDomElement

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public ListBoxDOMElement createDomElement(final GridLayer gridLayer,
                                          final GridWidget gridWidget,
                                          final GridBodyCellRenderContext context) {
    this.widget = createWidget();
    this.e = new ListBoxDOMElement(widget,
                                   gridLayer,
                                   gridWidget);
    widget.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(final BlurEvent event) {
            destroyResources();
            gridLayer.batch();
            gridPanel.setFocus(true);
        }
    });
    return e;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:ListBoxSingletonDOMElementFactory.java

示例8: createDomElement

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public TextBoxDOMElement createDomElement(final GridLayer gridLayer,
                                          final GridWidget gridWidget,
                                          final GridBodyCellRenderContext context) {
    this.widget = createWidget();
    this.e = new TextBoxDOMElement(widget,
                                   gridLayer,
                                   gridWidget);
    widget.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(final BlurEvent event) {
            destroyResources();
            gridLayer.batch();
            gridPanel.setFocus(true);
        }
    });
    return e;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:TextBoxSingletonDOMElementFactory.java

示例9: createDomElement

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public TextBoxDOMElement createDomElement(final GridLayer gridLayer,
                                          final GridWidget gridWidget,
                                          final GridBodyCellRenderContext context) {
    final TextBox widget = createWidget();
    final TextBoxDOMElement e = new TextBoxDOMElement(widget,
                                                      gridLayer,
                                                      gridWidget);
    widget.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(final BlurEvent event) {
            e.flush(widget.getValue());
            gridLayer.batch();
        }
    });
    return e;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:TextBoxDOMElementFactory.java

示例10: setFocusLost

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的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

示例11: handleTypeAttribute

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
protected void handleTypeAttribute(UIObject uiObject, final String regExp, final String validationMessage, final String validationTitle) {
	if (uiObject instanceof TextBox) {
		TextBox textBox = (TextBox)uiObject;
		textBox.addBlurHandler(new BlurHandler(){
			public void onBlur(BlurEvent event) {
				String textValue = ((TextBoxBase)event.getSource()).getText();
				if ((textValue != null) && (regExp != null)) {											
					if (textValue.replaceFirst(regExp, "").length() > 0) {							
						if (validationTitle != null) {
							ClientApplicationContext.getInstance().log(validationTitle, validationMessage,true);
						} else {
							ClientApplicationContext.getInstance().log("Validation error", validationMessage,true);
						}
					}						
				}					
			}
		});
	}		
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:20,代码来源:LabeledTextFieldWidget.java

示例12: Text

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
public Text(Composite parent, int style) {
	this(new TextArea(), parent, style);
	textArea = (TextArea) getGwtWidget();
	panel = (LayoutPanel) getParent().getGwtWidget().getParent();
	panel.add(textArea);
	textArea.addBlurHandler(new BlurHandler() {

		@Override
		public void onBlur(BlurEvent event) {
			setText(textArea.getText());
			textArea.removeFromParent();
			sendEvent(SWT.Modify);
			sendEvent(SWT.FocusOut);
		}
	});
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:17,代码来源:Text.java

示例13: bindHandlers

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
private void bindHandlers() {
	if (this.widget == null) {
		return;
	}

	this.registrations.removeHandler();
	switch (this.getTrigger()) {
		case FOCUS:
			this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, FocusEvent.getType()));
			this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, BlurEvent.getType()));
			break;
		case HOVER:
			this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOverEvent.getType()));
			this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOutEvent.getType()));
			break;
		case MANUAL:
			break;
		default:
			break;
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:22,代码来源:AbstractHover.java

示例14: onBlur

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
@Override
public void onBlur(BlurEvent event) {
	this.focused = false;
	if (this.input != null) {
		T val = this.input.flush();
		StyleUtils.toggleStyle(this.container, InputList.STYLE_ERROR, this.hasErrors());
		if (val == null && !this.hasErrors()) {
			InputList.this.removeEditor(this);
		} else {
			this.itemValue = val;
			this.output.edit(val);
		}
	}
	this.resetFocusHandler();
	this.redraw();
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:17,代码来源:InputList.java

示例15: onBlur

import com.google.gwt.event.dom.client.BlurEvent; //导入依赖的package包/类
public void onBlur(final BlurEvent event) {
  final String interval = getText();
  if (!interval.matches(regexp)) {
    // Steal the dateBoxFormatError :)
    addStyleName("dateBoxFormatError");
    event.stopPropagation();
    DeferredCommand.addCommand(new Command() {
      public void execute() {
        // TODO(tsuna): Understand why this doesn't work as expected, even
        // though we cancel the onBlur event and we put the focus afterwards
        // using a deferred command.
        //setFocus(true);
        selectAll();
      }
    });
  } else {
    removeStyleName("dateBoxFormatError");
  }
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:20,代码来源:ValidatedTextBox.java


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