當前位置: 首頁>>代碼示例>>Java>>正文


Java BlurHandler類代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.BlurHandler的典型用法代碼示例。如果您正苦於以下問題:Java BlurHandler類的具體用法?Java BlurHandler怎麽用?Java BlurHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BlurHandler類屬於com.google.gwt.event.dom.client包,在下文中一共展示了BlurHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testInitWidget

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的package包/類
@Test
public void testInitWidget() {
    widget.init();
    verify(widget,
           times(1)).init();
    verify(dataTypeComboBox,
           times(1)).init(widget,
                          true,
                          dataType,
                          customDataType,
                          false,
                          true,
                          VariableListItemWidgetView.CUSTOM_PROMPT,
                          VariableListItemWidgetView.ENTER_TYPE_PROMPT);
    verify(name,
           times(1)).setRegExp(regExpCaptor.capture(),
                               anyString(),
                               anyString());
    RegExp regExp = RegExp.compile(regExpCaptor.getValue());
    assertEquals(false,
                 regExp.test("a 1"));
    assertEquals(false,
                 regExp.test("[email protected]"));
    assertEquals(true,
                 regExp.test("a1"));
    verify(customDataType,
           times(1)).addKeyDownHandler(any(KeyDownHandler.class));
    verify(name,
           times(1)).addBlurHandler(any(BlurHandler.class));
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:31,代碼來源:VariableListItemWidgetTest.java

示例2: addBlurHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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.BlurHandler; //導入依賴的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: addLostFocusHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例5: addLostFocusHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例6: createDomElement

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例7: createDomElement

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例8: createDomElement

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例9: setFocusLost

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例10: handleTypeAttribute

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例11: Text

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的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

示例12: createRTAComponents

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的package包/類
private void createRTAComponents() {
   rta = new CRichTextArea();
   rta.setWidth("100%");
   rta.addKeyDownHandler(this);
   formatter = new VRichTextToolbar(rta);

   // Add blur handlers
   for (Entry<BlurHandler, HandlerRegistration> handler : blurHandlers
           .entrySet()) {

      // Remove old registration
      handler.getValue().removeHandler();

      // Add blur handlers
      addBlurHandler(handler.getKey());
   }
}
 
開發者ID:vkazhdan,項目名稱:vaadin-crichtextarea,代碼行數:18,代碼來源:CVRichTextArea.java

示例13: testNameBlurHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的package包/類
@Test
public void testNameBlurHandler() {
    VariablesEditorWidgetView.Presenter parent = mock(VariablesEditorWidgetView.Presenter.class);
    when(parent.isDuplicateName(anyString())).thenReturn(true);
    doReturn("anyName").when(name).getText();
    view.setParentWidget(parent);
    view.init();
    verify(name,
           times(1)).addBlurHandler(blurHandlerCaptor.capture());
    BlurHandler handler = blurHandlerCaptor.getValue();
    handler.onBlur(mock(BlurEvent.class));
    verify(parent,
           times(1)).isDuplicateName("anyName");
    verify(notification,
           times(1)).fire(new NotificationEvent(null,
                                                NotificationEvent.NotificationType.ERROR));
    verify(name,
           times(1)).setValue("");
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:20,代碼來源:VariableListItemWidgetViewImplTest.java

示例14: testNameBlurHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的package包/類
@Test
public void testNameBlurHandler() {
    ActivityDataIOEditorWidget parent = mock(ActivityDataIOEditorWidget.class);
    when(parent.isDuplicateName(anyString())).thenReturn(true);
    doReturn("anyName").when(name).getText();
    view.setAllowDuplicateNames(false,
                                "ErrorMessage");
    view.setParentWidget(parent);
    view.init();
    verify(name,
           times(1)).addBlurHandler(blurHandlerCaptor.capture());
    BlurHandler handler = blurHandlerCaptor.getValue();
    handler.onBlur(mock(BlurEvent.class));
    verify(parent,
           times(1)).isDuplicateName("anyName");
    verify(notification,
           times(1)).fire(new NotificationEvent("ErrorMessage",
                                                NotificationEvent.NotificationType.ERROR));
    verify(name,
           times(1)).setValue("");
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:22,代碼來源:AssignmentListItemWidgetViewImplTest.java

示例15: addBlurHandler

import com.google.gwt.event.dom.client.BlurHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
	return iText.addBlurHandler(handler);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:5,代碼來源:TimeSelector.java


注:本文中的com.google.gwt.event.dom.client.BlurHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。