本文整理汇总了Java中com.vaadin.event.FieldEvents.BlurEvent类的典型用法代码示例。如果您正苦于以下问题:Java BlurEvent类的具体用法?Java BlurEvent怎么用?Java BlurEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlurEvent类属于com.vaadin.event.FieldEvents包,在下文中一共展示了BlurEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testButton
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@Test
public void testButton() {
FButton button = new FButton().withCaption("My button")
.withIcon(VaadinIcons.ARROW_BACKWARD)
.withIconAlternateText("backward")
.withClickListener(click -> System.out.println("clicked"))
.withClickShortcut(ShortcutAction.KeyCode.ENTER, null)
.withBlurListener(blur -> System.out.println("lost focus"))
.withFocusListener(focus -> System.out.println("gain focus"))
.withTabIndex(5)
.withDisableOnClick(true);
assertEquals("My button", button.getCaption());
assertEquals(VaadinIcons.ARROW_BACKWARD, button.getIcon());
assertEquals("backward", button.getIconAlternateText());
assertEquals(5, button.getTabIndex());
assertEquals(1, button.getListeners(ClickEvent.class).size());
assertEquals(1, button.getListeners(FocusEvent.class).size());
assertEquals(1, button.getListeners(BlurEvent.class).size());
assertTrue(button.getClickShortcut() != null);
assertTrue(button.isDisableOnClick());
}
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:24,代码来源:FButtonTest.java
示例2: testNativeButton
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@Test
public void testNativeButton() {
FNativeButton button = new FNativeButton().withCaption("My button")
.withIcon(VaadinIcons.ARROW_BACKWARD)
.withIconAlternateText("backward")
.withClickListener(click -> System.out.println("clicked"))
.withClickShortcut(ShortcutAction.KeyCode.ENTER, null)
.withBlurListener(blur -> System.out.println("lost focus"))
.withFocusListener(focus -> System.out.println("gain focus"))
.withTabIndex(5)
.withDisableOnClick(true);
assertEquals("My button", button.getCaption());
assertEquals(VaadinIcons.ARROW_BACKWARD, button.getIcon());
assertEquals("backward", button.getIconAlternateText());
assertEquals(5, button.getTabIndex());
assertEquals(1, button.getListeners(ClickEvent.class).size());
assertEquals(1, button.getListeners(FocusEvent.class).size());
assertEquals(1, button.getListeners(BlurEvent.class).size());
assertTrue(button.isDisableOnClick());
}
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:23,代码来源:FButtonTest.java
示例3: addAndRemoveBlurListener
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@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());
}
开发者ID:viritin,项目名称:viritin,代码行数:13,代码来源:AbstractNumberFieldTest.java
示例4: addAndRemoveListenerWithMethodOverload
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@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());
}
开发者ID:viritin,项目名称:viritin,代码行数:12,代码来源:AbstractNumberFieldTest.java
示例5: addBlurListener
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@Override
public Registration addBlurListener(final BlurListener listener) {
return addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod);
}
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:5,代码来源:ComboBoxMultiselect.java
示例6: closeWindow
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
private void closeWindow(final BlurEvent event) {
getUI().removeWindow((Window) event.getComponent());
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:4,代码来源:NotificationUnreadButton.java
示例7: addBlurListener
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@Override
public void addBlurListener(BlurListener listener) {
addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener,
BlurListener.blurMethod);
}
开发者ID:markoradinovic,项目名称:suggestfield,代码行数:7,代码来源:SuggestField.java
示例8: removeBlurListener
import com.vaadin.event.FieldEvents.BlurEvent; //导入依赖的package包/类
@Override
public void removeBlurListener(BlurListener listener) {
removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener);
}
开发者ID:markoradinovic,项目名称:suggestfield,代码行数:6,代码来源:SuggestField.java
注:本文中的com.vaadin.event.FieldEvents.BlurEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论