@Test public void testNewComponent_UseShortcutKeyCode() { Button button = new ButtonBindingDefinition(shortcutButton()).newComponent(); assertThat(button, not(nullValue())); Button buttonSpy = spy(button); buttonSpy.setClickShortcut(KeyCode.ENTER); verify(buttonSpy).removeShortcutListener(clickShortcutCaptor.capture()); @NonNull ClickShortcut value = clickShortcutCaptor.getValue(); assertThat(value.getKeyCode(), is(KeyCode.E)); assertThat(value.getModifiers(), is(new int[] { ModifierKey.ALT })); }
@Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickShortcut(buttonAnnotation.shortcutKeyCode(), buttonAnnotation.shortcutModifierKeys()); } return button; }
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickShortcut(buttonAnnotation.shortcutKeyCode(), buttonAnnotation.shortcutModifierKeys()); } return button; } }
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickShortcut(buttonAnnotation.shortcutKeyCode(), buttonAnnotation.shortcutModifierKeys()); } return button; } ButtonBindingDefinition(UIButton annotation); }
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickShortcut(buttonAnnotation.shortcutKeyCode(), buttonAnnotation.shortcutModifierKeys()); } return button; } ButtonBindingDefinition(UIButton annotation); @Override Button newComponent(); @Override String label(); @Override EnabledType enabled(); @Override VisibleType visible(); @Override RequiredType required(); @Override String modelObject(); @Override String modelAttribute(); }
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickShortcut(buttonAnnotation.shortcutKeyCode(), buttonAnnotation.shortcutModifierKeys()); } return button; } ButtonBindingDefinition(UIButton annotation); @Override Button newComponent(); @Override String label(); @Override EnabledType enabled(); @Override VisibleType visible(); @Override RequiredType required(); @Override String modelObject(); @Override String modelAttribute();  }