@Test public void testNewComponent_CustomDateFormatIsUsed() { DateFieldBindingDefinition adapter = new DateFieldBindingDefinition(customAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(DateField.class))); DateField dateField = (DateField)component; assertThat(dateField.getDateFormat(), is(CUSTOM_DATE_FORMAT)); }
@Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } return dateField; }
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } return dateField; } }
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } return dateField; } DateFieldBindingDefinition(UIDateField uiDateField); }
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } return dateField; } DateFieldBindingDefinition(UIDateField uiDateField); @Override Component newComponent(); @Override String label(); @Override EnabledType enabled(); @Override RequiredType required(); @Override VisibleType visible(); @Override String modelAttribute(); @Override String modelObject(); }
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } return dateField; } DateFieldBindingDefinition(UIDateField uiDateField); @Override Component newComponent(); @Override String label(); @Override EnabledType enabled(); @Override RequiredType required(); @Override VisibleType visible(); @Override String modelAttribute(); @Override String modelObject();  }