Skip to content

Commit

Permalink
#292 #293 done (#294)
Browse files Browse the repository at this point in the history
logger explained and severity decreased; bumped to Vaadin 14.5.3
  • Loading branch information
vaadin-miki authored Apr 20, 2021
1 parent b900acd commit 13c759d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>14.5.1</vaadin.version>
<vaadin.version>14.5.3</vaadin.version>
</properties>

</project>
4 changes: 4 additions & 0 deletions superfields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Some components contain server-side methods to control text selection in their w

The web components listen to each key press and mouse click. If text selection changes as a result of that action, they send an event to the server-side component. This may happen quite often and increase server load, so the feature is turned off by default. To turn it on simply call `setReceivingSelectionEventsFromClient(true)` (or `withReceivingSelectionEventsFromClient(true)`).

#### Log messages

Quite a few components log their state using [SLF4J](https://www.slf4j.org). Critical information is logged as error or warning, debugging messages are, well, debug or trace. Information about [how to configure which log messages get displayed can be found e.g. on Stack Overflow](https://stackoverflow.com/questions/45997759/how-to-change-slf4j-logging-level).

## Number fields

None of the number fields support range checking, so if you allow too many digits, overflows will occur.
Expand Down
2 changes: 1 addition & 1 deletion superfields/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>14.5.1</vaadin.version>
<vaadin.version>14.5.3</vaadin.version>
<maven.jar.plugin.version>3.1.2</maven.jar.plugin.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* Somewhat similar to value change.
* @param <C> Source component.
* @param <S> Information about the state.
*
* @author miki
* @since 2020-07-08
*/
public class StateChangeEvent<S extends Serializable, C extends Component & HasState<S>> extends ComponentEvent<C> {

Expand All @@ -19,7 +22,7 @@ public class StateChangeEvent<S extends Serializable, C extends Component & HasS
/**
* Creates a new event using the given source and indicator whether the
* event originated from the client side or the server side.
* @param source the source component
* @param source the source component
* @param fromClient <code>true</code> if the event originated from the client
* @param state Current state of the component.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* Marker interface for objects that listen to state changes.
* @param <S> Information about the state.
* @param <C> Source of the changes.
*
* @author miki
* @since 2020-07-08
*/
@FunctionalInterface
public interface StateChangeListener<S extends Serializable, C extends Component & HasState<S>> extends ComponentEventListener<StateChangeEvent<S, C>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public List<String> getDisplayMonthNames() {
@Override
public void setLocale(Locale locale) {
this.locale = locale == null ? Locale.getDefault() : locale;
DateFormatSymbols symbols = new DateFormatSymbols(locale);
final DateFormatSymbols symbols = new DateFormatSymbols(locale);
this.setMonthNames(Arrays.asList(symbols.getMonths()).subList(0, 12));
this.setDisplayMonthNames(Arrays.asList(symbols.getMonths()).subList(0, 12));
this.setFirstDayOfWeek(Calendar.getInstance(this.locale).getFirstDayOfWeek() == Calendar.MONDAY ? 1 : 0);
Expand All @@ -114,7 +114,7 @@ public void setLocale(Locale locale) {
.forEach(entry -> entry.getValue().apply(Arrays.asList(bundle.getString(entry.getKey()).split("\\s*,\\s*"))));
if(bundleKeys.contains("first-day-of-week"))
this.setFirstDayOfWeek(Integer.parseInt(bundle.getString("first-day-of-week")));
LOGGER.info("resource overwritten properties: {}", bundleKeys);
LOGGER.info("these properties were overwritten by resource bundle: {}", bundleKeys);
}
catch(MissingResourceException mre) {
LOGGER.warn("resource bundle {} for locale {} not found, some texts may display incorrectly or not at all", RESOURCE_BUNDLE_NAME, locale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ protected final void setPresentationValue(T number) {
if(number == null && !this.isNullValueAllowed())
throw new IllegalArgumentException("null value is not allowed");
final String formatted = number == null ? "" : this.format.format(number);
LOGGER.info("value {} to be presented as {} with {} decimal digits", number, formatted, this.format.getMaximumFractionDigits());
LOGGER.debug("value {} to be presented as {} with {} decimal digits", number, formatted, this.format.getMaximumFractionDigits());
this.field.setValue(formatted);
// fixes #241 caused by a Vaadin bug https://github.com/vaadin/vaadin-text-field/issues/547
this.field.getElement().getNode().runWhenAttached(ui -> ui.beforeClientResponse(this.field, context ->
Expand Down

0 comments on commit 13c759d

Please sign in to comment.