Skip to content

Commit

Permalink
Retain binary compatibility for listenOn method (#8540)
Browse files Browse the repository at this point in the history
* Retain binary compatibility for listenOn method

Adding support for listening for shortcuts on multiple components #7339 broke binary compatibility.
This is problematic for any addon that would now need a new release on top of Flow 2.2.
Fixed the weirdly formulated javadocs.

Fixes vaadin/vaadin-button-flow#162
  • Loading branch information
pleku committed Jun 10, 2020
1 parent de7e21e commit cf01ea5
Showing 1 changed file with 18 additions and 3 deletions.
Expand Up @@ -253,11 +253,26 @@ public ShortcutRegistration bindLifecycleTo(Component component) {
setLifecycleOwner(component);
return this;
}

/**
* Fluently define the component to listen for shortcuts on. Calling this
* method will remove any previous listeners.
* <p>
* This method only exists to retain backwards compatibility after support
* for listening on multiple components was added with the method
* {@link #listenOn(Component...)}.
*
* @param listenOnComponent
* components to listen for the shortcut on. Must not be null.
* @return this <code>ShortcutRegistration</code>
*/
public ShortcutRegistration listenOn(Component listenOnComponent) {
return listenOn(new Component[]{listenOnComponent});
}

/**
* Fluently define the {@link Component} onto which the shortcut's listener
* is bound. Calling this method will remove the previous listener from the
* {@code component} it was bound to.
* Fluently define the components to listen for shortcuts on. Calling this
* method will remove any previous listeners.
*
* @param listenOnComponents
* {@code Component}s onto which the shortcut listeners are
Expand Down

0 comments on commit cf01ea5

Please sign in to comment.