com.vaadin.event.FieldEvents.BlurEvent Java Examples

The following examples show how to use com.vaadin.event.FieldEvents.BlurEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AceEditor.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public Registration addBlurListener(BlurListener listener) {
       Registration registration = addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener,
               BlurListener.blurMethod);
       getState().listenToFocusChanges = true;
       return registration;
   }
 
Example #2
Source File: AbstractNumberFieldTest.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Test
public void addAndRemoveBlurListener() {
  // Try both add remove a BlurListener, and ,ake sure they get delegated to the textfield
  assertTrue(field.tf.getListeners(BlurEvent.class).isEmpty());
  field.addBlurListener(BLUR_LISTENER);
  Collection<?> listeners = field.tf.getListeners(BlurEvent.class);
  assertEquals(1, listeners.size());
  assertEquals(BLUR_LISTENER, listeners.iterator().next());

  field.removeBlurListener(BLUR_LISTENER);
  assertTrue(field.tf.getListeners(BlurEvent.class).isEmpty());
}
 
Example #3
Source File: AbstractNumberFieldTest.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Test
public void addAndRemoveListenerWithMethodOverload() {
  // Try both add remove a BlurListener via add/removeListener, and make sure they get delegated to the textfield
  assertTrue(field.tf.getListeners(BlurEvent.class).isEmpty());
  field.addBlurListener(BLUR_LISTENER);
  Collection<?> listeners = field.tf.getListeners(BlurEvent.class);
  assertEquals(1, listeners.size());
  assertEquals(BLUR_LISTENER, listeners.iterator().next());
  field.removeBlurListener(BLUR_LISTENER);
  assertTrue(field.tf.getListeners(BlurEvent.class).isEmpty());
}
 
Example #4
Source File: ComboBoxMultiselect.java    From vaadin-combobox-multiselect with Apache License 2.0 4 votes vote down vote up
@Override
public Registration addBlurListener(final BlurListener listener) {
    return addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod);
}
 
Example #5
Source File: AceEditor.java    From cuba with Apache License 2.0 4 votes vote down vote up
public void removeFocusListener(FocusListener listener) {
	removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener);
	getState().listenToFocusChanges = !getListeners(FocusEvent.class)
			.isEmpty() || !getListeners(BlurEvent.class).isEmpty();
}
 
Example #6
Source File: AceEditor.java    From cuba with Apache License 2.0 4 votes vote down vote up
public void removeBlurListener(BlurListener listener) {
	removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener);
	getState().listenToFocusChanges = !getListeners(FocusEvent.class)
			.isEmpty() || !getListeners(BlurEvent.class).isEmpty();
}
 
Example #7
Source File: AceEditor.java    From cuba with Apache License 2.0 4 votes vote down vote up
private void fireBlur() {
	fireEvent(new BlurEvent(this));
}
 
Example #8
Source File: ComboBoxMultiselect.java    From vaadin-combobox-multiselect with Apache License 2.0 4 votes vote down vote up
@Override
public Registration addBlurListener(final BlurListener listener) {
    return addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod);
}
 
Example #9
Source File: NotificationUnreadButton.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void closeWindow(final BlurEvent event) {
    getUI().removeWindow((Window) event.getComponent());
}