@Test public void shouldntSetLocaleToDefaultIfLocaleIsntNull() { String locale = "pl"; given(view.getComponentByReference(LOCALE)).willReturn(localeField); given(localeField.getFieldValue()).willReturn(locale); customTranslationsListViewHooks.setLocaleToDefault(view); verify(localeField, never()).setFieldValue(Mockito.anyString()); }
public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } }
CustomTranslationsListViewHooks { public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } } }
CustomTranslationsListViewHooks { public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } }  }
CustomTranslationsListViewHooks { public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } }  void updateRibbonState(final ViewDefinitionState view); void setLocaleToDefault(final ViewDefinitionState view); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view, final ComponentState state, final String[] args); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view); }
CustomTranslationsListViewHooks { public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } }  void updateRibbonState(final ViewDefinitionState view); void setLocaleToDefault(final ViewDefinitionState view); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view, final ComponentState state, final String[] args); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view);  }