Java 类com.google.gwt.event.dom.client.BlurHandler 实例源码

项目:che    文件:OrionEditorWidget.java   
@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());
}
项目:firefly    文件:TextBoxInputField.java   
private void addHandlers() {
    BlurHandler blurHandler =  new BlurHandler() {
        public void onBlur(BlurEvent ev) {
            checkForChange(true);
        }
    };
    _textBox.addKeyPressHandler(new KeyHandler());
    _textBox.addBlurHandler(blurHandler);
}
项目:appformer    文件:SecretTextField.java   
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());
            }
        }
    });
}
项目:appformer    文件:TextField.java   
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());
            }
        }
    });
}
项目:appformer    文件:ListBoxSingletonDOMElementFactory.java   
@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;
}
项目:appformer    文件:TextBoxSingletonDOMElementFactory.java   
@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;
}
项目:appformer    文件:TextBoxDOMElementFactory.java   
@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;
}
项目:platypus-js    文件:EventsExecutor.java   
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;
                }
            });
        }
    }
}
项目:qafe-platform    文件:LabeledTextFieldWidget.java   
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);
                        }
                    }                       
                }                   
            }
        });
    }       
}
项目:gef-gwt    文件:Text.java   
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);
        }
    });
}
项目:vaadin-crichtextarea    文件:CVRichTextArea.java   
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());
   }
}
项目:kie-wb-common    文件:VariableListItemWidgetViewImplTest.java   
@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("");
}
项目:kie-wb-common    文件:AssignmentListItemWidgetViewImplTest.java   
@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("");
}
项目:unitimes    文件:TimeSelector.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return iText.addBlurHandler(handler);
}
项目:x-cure-chat    文件:TextBoxWithSuggText.java   
/**
 * Allows to initialize the text box by setting up its listeners and styles.
 */
private void initialize() {
    //Set the base values and styles
    super.setStyleName( CommonResourcesContainer.GWT_TEXT_BOX_STYLE );
    this.addStyleName( CommonResourcesContainer.USER_DIALOG_SUGG_TEXT_BOX_STYLE );
    this.setText( helperText );
    //On gaining the focus
    addFocusHandler(new FocusHandler(){
        public void onFocus(FocusEvent event) {
            //If the focus is obtained and the text box value is set to empty if
            //the user text was not set, i.e. he have the helper message there
            if( TextBoxWithSuggText.super.getText().trim().equals( helperText ) ){
                TextBoxWithSuggText.super.setText( "" );
            }
            //Remove the suggestion style making the text be in another color
            removeStyleName( CommonResourcesContainer.USER_DIALOG_SUGG_TEXT_BOX_STYLE );
        }
    });
    //On loosing the focus
    addBlurHandler(new BlurHandler(){
        public void onBlur(BlurEvent e) {
            //If the text box looses the focus and the text is not set
            //then we set the helper text and the corresponding style 
            if( TextBoxWithSuggText.super.getText().trim().isEmpty() ){
                TextBoxWithSuggText.this.setText( null );
            }
        }
    });
}
项目:optaplanner-wb    文件:ConstraintMatchInputWidget.java   
public HandlerRegistration addConstraintMatchBlurHandler(final BlurHandler blurHandler) {
    HandlerRegistration registration = constraintMatchTextBox.addBlurHandler(blurHandler);
    DomEvent.fireNativeEvent(Document.get().createBlurEvent(),
                             constraintMatchTextBox);

    return registration;
}
项目:firefly    文件:TextAreaInputField.java   
private void addHandlers() {
    BlurHandler blurHandler =  new BlurHandler() {
        public void onBlur(BlurEvent ev) {
            checkForChange();
        }
    };
    _textArea.addKeyPressHandler(new KeyHandler());
    _textArea.addBlurHandler(blurHandler);
}
项目:qafe-platform    文件:EventFactory.java   
public static BlurHandler createOnExitListener(final EventListenerGVO ev, final List<InputVariableGVO> input) {
    return new BlurHandler() {
        public void onBlur(BlurEvent event) {
            CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONEXIT, ev, input);
        }
    };
}
项目:qafe-platform    文件:ActivityHelper.java   
private static BlurHandler createBlurHandler(final ComponentGVO componentGVO, final EventListenerGVO eventGVO, final NotifyHandler notifyHandler, final String windowId, final String context, final AbstractActivity activity) {
    return new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            UIObject widget = (UIObject)event.getSource();
            List<InputVariableGVO> inputVariables = eventGVO.getInputvariablesList();
            handleEvent(componentGVO, widget, eventGVO, event, QAMLConstants.EVENT_ONEXIT, inputVariables, notifyHandler, windowId, context, activity);
        }
    };
}
项目:plugin-editor-codemirror    文件:CodeMirrorEditorWidget.java   
@Override
public HandlerRegistration addBlurHandler(final BlurHandler handler) {
    if (!blurHandlerAdded) {
        blurHandlerAdded = true;
        this.codeMirror.on(this.editorOverlay, BLUR, new EventHandlers.EventHandlerNoParameters() {

            @Override
            public void onEvent() {
                fireBlurEvent();
            }
        });
    }
    return addHandler(handler, BlurEvent.getType());
}
项目:vaadin-crichtextarea    文件:CVRichTextArea.java   
/**
 * Removes a blur handler.
 *
 * @param blurHandler the handler to remove
 */
public void removeBlurHandler(BlurHandler blurHandler) {
   HandlerRegistration registration = blurHandlers.remove(blurHandler);
   if (registration != null) {
      registration.removeHandler();
   }
}
项目:suggestfield    文件:SuggestionMenuBar.java   
private void init() {
    Element table = DOM.createTable();
    body = DOM.createTBody();
    DOM.appendChild(table, body);

    Element outer = FocusImpl.getFocusImplForPanel().createFocusable();
    DOM.appendChild(outer, table);
    setElement(outer);

    Roles.getMenubarRole().set(getElement());

    sinkEvents(Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT
            | Event.ONFOCUS | Event.ONKEYDOWN);

    setStyleName(STYLENAME_DEFAULT);
    addStyleDependentName("vertical");

    // Hide focus outline in Mozilla/Webkit/Opera
    getElement().getStyle().setProperty("outline", "0px");

    // Hide focus outline in IE 6/7
    getElement().setAttribute("hideFocus", "true");

    // Deselect items when blurring without a child menu.
    addDomHandler(new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            selectItem(null);
        }
    }, BlurEvent.getType());
}
项目:gwt-traction    文件:ViewportImplIE.java   
@Override
   public void addEventListeners() {

// we create these to map the event names to their events. see
// DomEvent.Type for details.
new Type<FocusHandler>("focusin", new FocusInEvent());
new Type<BlurHandler>("focusout", new FocusOutEvent());

addEventListeners_();
   }
项目:putnami-web-toolkit    文件:InputDatePicker.java   
public void popup(Widget container, Widget relativeTo) {
    this.setVisible(true);
    StyleUtils.addStyle(this, InputDatePicker.STYLE_POPUP);
    RootPanel.get().add(this);

    Element positioningElement = this.getElement();
    Element relativeElement = relativeTo.getElement();

    int targetHeight = relativeElement.getOffsetHeight();
    int targetTop = relativeElement.getAbsoluteTop();

    int positioningWidth = positioningElement.getOffsetWidth();
    int targetRight = relativeElement.getAbsoluteRight();

    Style elementStyle = positioningElement.getStyle();
    elementStyle.setPosition(Position.ABSOLUTE);
    elementStyle.setLeft(targetRight - positioningWidth, Unit.PX);
    elementStyle.setTop(targetTop + targetHeight, Unit.PX);

    StyleUtils.addStyle(this, InputDatePicker.STYLE_FADE);
    StyleUtils.addStyle(this, InputDatePicker.STYLE_SHOW);

    this.setFocus(true);

    if (this.popupBlurHandler == null) {
        this.popupBlurHandler = this.addBlurHandler(new BlurHandler() {

            @Override
            public void onBlur(BlurEvent event) {
                InputDatePicker.this.hide();
            }
        });
    }
}
项目:gwtbootstrap3    文件:DefaultValidatorMixin.java   
protected HandlerRegistration setupBlurValidation() {
    return inputWidget.addDomHandler(new BlurHandler() {
        @Override
        public void onBlur(BlurEvent event) {
            validate(validateOnBlur);
        }
    }, BlurEvent.getType());
}
项目:drools-wb    文件:ListBoxSingletonDOMElementFactoryTest.java   
@Test
public void checkDOMElementCreationChecksListBoxIsMultipleSelect() {
    factory.createDomElement(gridLayer,
                             gridWidget,
                             cellRenderContext);

    verify(listBox).addMouseDownHandler(any(MouseDownHandler.class));
    verify(listBox).addKeyDownHandler(any(KeyDownHandler.class));
    verify(listBox).addBlurHandler(any(BlurHandler.class));
    verify(listBox).isMultipleSelect();
}
项目:drools-wb    文件:ListBoxSingletonDOMElementFactoryTest.java   
@Test
@SuppressWarnings("unchecked")
public void checkDOMElementCreationBlurHandler() {
    final InOrder order = inOrder(factory);

    final GridBodyCellRenderContext context = mock(GridBodyCellRenderContext.class);
    final Callback<ListBoxDOMElement<String, ListBox>> onCreation = mock(Callback.class);
    final Callback<ListBoxDOMElement<String, ListBox>> onDisplay = mock(Callback.class);
    when(context.getTransform()).thenReturn(mock(Transform.class));

    factory.attachDomElement(context,
                             onCreation,
                             onDisplay);

    final ArgumentCaptor<BlurHandler> blurHandlerCaptor = ArgumentCaptor.forClass(BlurHandler.class);

    verify(listBox).addBlurHandler(blurHandlerCaptor.capture());

    final BlurEvent e = mock(BlurEvent.class);
    final BlurHandler blurHandler = blurHandlerCaptor.getValue();
    blurHandler.onBlur(e);

    order.verify(factory).flush();
    order.verify(factory).destroyResources();
    verify(gridLayer).batch();
    verify(gridLienzoPanel).setFocus(eq(true));
}
项目:kie-wb-common    文件:VariableNameTextBoxTest.java   
@Before
public void init() {
    GwtMockito.initMocks(this);
    textBox = GWT.create(VariableNameTextBox.class);
    doCallRealMethod().when(textBox).setRegExp(anyString(),
                                               anyString(),
                                               anyString());
    doCallRealMethod().when(textBox).setInvalidValues(anySet(),
                                                      anyBoolean(),
                                                      anyString());
    doCallRealMethod().when(textBox).isValidValue(anyString(),
                                                  anyBoolean());
    doCallRealMethod().when(textBox).setText(anyString());
    doCallRealMethod().when(textBox).testForInvalidValue(anyString());
    doCallRealMethod().when(textBox).makeValidValue(anyString());
    doCallRealMethod().when(textBox).getInvalidCharsInName(anyString());
    doCallRealMethod().when(textBox).isValidChar(anyChar());
    doCallRealMethod().when(textBox).setup();
    doCallRealMethod().when(textBox).addBlurHandler(any(BlurHandler.class));
    doCallRealMethod().when(textBox).addKeyPressHandler(any(KeyPressHandler.class));
    textBox.setRegExp(ALPHA_NUM_REGEXP,
                      ERROR_REMOVED,
                      ERROR_TYPED);
    INVALID_VALUES.clear();
    INVALID_VALUES.add("abc");
    INVALID_VALUES.add("CdE");
    INVALID_VALUES.add("a#$%1");
    textBox.setInvalidValues(INVALID_VALUES,
                             caseSensitive,
                             ERROR_MESSAGE);
}
项目:unitimes    文件:AriaSuggestBox.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addHandler(handler, BlurEvent.getType());
}
项目:unitimes    文件:ImageButton.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addDomHandler(handler, BlurEvent.getType());
}
项目:unitimes    文件:TimeSelector.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addHandler(handler, BlurEvent.getType());
}
项目:unitimes    文件:IntervalSelector.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return iFilter.addBlurHandler(handler);
}
项目:unitimes    文件:FilterBox.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return iFilter.addBlurHandler(handler);
}
项目:unitimes    文件:UniTimeFilterBox.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return iFilter.getWidget().addBlurHandler(handler);
}
项目:unitimes    文件:SessionDatesSelector.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return iText.addBlurHandler(handler);
}
项目:r01fb    文件:TreeView.java   
@Override
public HandlerRegistration addBlurHandler(final BlurHandler handler) {
    return this.addDomHandler(handler, 
                              BlurEvent.getType());
}
项目:OpenTripPlanner-client-gwt    文件:TimePicker.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addHandler(handler, BlurEvent.getType());
}
项目:unitime    文件:AriaSuggestBox.java   
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
    return addHandler(handler, BlurEvent.getType());
}