@Test public void testNewComponent_DefaultAnnotations() { ButtonBindingDefinition adapter = new ButtonBindingDefinition(defaultAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(Button.class))); Button button = (Button)component; assertThat(button.getIcon(), is(nullValue())); assertThat(button.getStyleName(), is("")); }
@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();  }