import com.vaadin.data.Binder;
import com.vaadin.data.HasValue;
import com.vaadin.data.ValueProvider;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.Setter;
/**
* @since 3.0
*/
@Deprecated
- public interface ValueChangeListener extends Serializable {
+ public interface ValueChangeListener extends SerializableEventListener {
/**
* Notifies this listener that the Property's value has changed.
* @since 3.0
*/
@Deprecated
- public interface ReadOnlyStatusChangeListener extends Serializable {
+ public interface ReadOnlyStatusChangeListener extends SerializableEventListener {
/**
* Notifies this listener that a Property's read-only status has
import java.lang.reflect.Method;
import com.vaadin.event.MouseEvents.ClickEvent;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.Component;
import com.vaadin.v7.data.Container;
}
@Deprecated
- public interface ItemClickListener extends Serializable {
+ public interface ItemClickListener extends SerializableEventListener {
public void itemClick(ItemClickEvent event);
}
import java.util.LinkedHashSet;
import java.util.Set;
+import com.vaadin.event.SerializableEventListener;
+
/**
* An event that specifies what in a selection has changed, and where the
* selection took place.
* SelectionEvents}.
*/
@Deprecated
- public interface SelectionListener extends Serializable {
+ public interface SelectionListener extends SerializableEventListener {
/**
* Notifies the listener that the selection state has changed.
*
import java.io.Serializable;
import java.util.List;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.Registration;
import com.vaadin.ui.Component;
import com.vaadin.v7.data.sort.SortOrder;
*/
@FunctionalInterface
@Deprecated
- public interface SortListener extends Serializable {
+ public interface SortListener extends SerializableEventListener {
/**
* Called when the sort order has changed.
*
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.TargetDetails;
private String weeklyCaptionFormat = null;
/** Map from event ids to event handlers */
- private final Map<String, EventListener> handlers;
+ private final Map<String, SerializableEventListener> handlers;
/**
* Drop Handler for Vaadin DD. By default null.
public Calendar(String caption, CalendarEventProvider eventProvider) {
registerRpc(rpc);
setCaption(caption);
- handlers = new HashMap<String, EventListener>();
+ handlers = new HashMap<String, SerializableEventListener>();
setDefaultHandlers();
currentCalendar.setTime(new Date());
setEventProvider(eventProvider);
* The method on the lister to call when the event is triggered
*/
protected void setHandler(String eventId, Class<?> eventType,
- EventListener listener, Method listenerMethod) {
+ SerializableEventListener listener, Method listenerMethod) {
if (handlers.get(eventId) != null) {
removeListener(eventId, eventType, handlers.get(eventId));
handlers.remove(eventId);
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.AbstractClientConnector;
import com.vaadin.server.AbstractExtension;
import com.vaadin.server.EncodeResult;
* @since 7.5.0
*/
@Deprecated
- public interface ColumnVisibilityChangeListener extends Serializable {
+ public interface ColumnVisibilityChangeListener extends SerializableEventListener {
/**
* Called when a column has become hidden or unhidden.
*
* @since 7.5.0
*/
@Deprecated
- public interface ColumnReorderListener extends Serializable {
+ public interface ColumnReorderListener extends SerializableEventListener {
/**
* Called when the columns of the grid have been reordered.
* @since 7.6
*/
@Deprecated
- public interface ColumnResizeListener extends Serializable {
+ public interface ColumnResizeListener extends SerializableEventListener {
/**
* Called when the columns of the grid have been resized.
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ContextClickEvent;
import com.vaadin.event.MouseEvents.ClickEvent;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DragSource;
import com.vaadin.event.dd.DropHandler;
* headerClick method is called when the user presses a header column cell.
*/
@Deprecated
- public interface HeaderClickListener extends Serializable {
+ public interface HeaderClickListener extends SerializableEventListener {
/**
* Called when a user clicks a header column cell.
* footerClick method is called when the user presses a footer column cell.
*/
@Deprecated
- public interface FooterClickListener extends Serializable {
+ public interface FooterClickListener extends SerializableEventListener {
/**
* Called when a user clicks a footer column cell.
* Interface for listening to column resize events.
*/
@Deprecated
- public interface ColumnResizeListener extends Serializable {
+ public interface ColumnResizeListener extends SerializableEventListener {
/**
* This method is triggered when the column has been resized.
* Interface for listening to column reorder events.
*/
@Deprecated
- public interface ColumnReorderListener extends Serializable {
+ public interface ColumnReorderListener extends SerializableEventListener {
/**
* This method is triggered when the column has been reordered.
* @since 7.6
*/
@Deprecated
- public interface ColumnCollapseListener extends Serializable {
+ public interface ColumnCollapseListener extends SerializableEventListener {
/**
* This method is triggered when the collapse state for a column has
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ContextClickEvent;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.event.Transferable;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DragSource;
* @since 3.0
*/
@Deprecated
- public interface ExpandListener extends Serializable {
+ public interface ExpandListener extends SerializableEventListener {
public static final Method EXPAND_METHOD = ReflectTools.findMethod(
ExpandListener.class, "nodeExpand", ExpandEvent.class);
* @since 3.0
*/
@Deprecated
- public interface CollapseListener extends Serializable {
+ public interface CollapseListener extends SerializableEventListener {
public static final Method COLLAPSE_METHOD = ReflectTools.findMethod(
CollapseListener.class, "nodeCollapse", CollapseEvent.class);
import java.util.LinkedHashSet;
import java.util.Map;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.NoInputStreamException;
import com.vaadin.server.NoOutputStreamException;
import com.vaadin.server.PaintException;
* @since 5.0
*/
@Deprecated
- public interface StartedListener extends Serializable {
+ public interface StartedListener extends SerializableEventListener {
/**
* Upload has started.
* @since 3.0
*/
@Deprecated
- public interface FinishedListener extends Serializable {
+ public interface FinishedListener extends SerializableEventListener {
/**
* Upload has finished.
* @since 3.0
*/
@Deprecated
- public interface FailedListener extends Serializable {
+ public interface FailedListener extends SerializableEventListener {
/**
* Upload has finished unsuccessfully.
* @since 3.0
*/
@Deprecated
- public interface SucceededListener extends Serializable {
+ public interface SucceededListener extends SerializableEventListener {
/**
* Upload successful.
* @since 7.2
*/
@Deprecated
- public interface ChangeListener extends Serializable {
+ public interface ChangeListener extends SerializableEventListener {
Method FILENAME_CHANGED = ReflectTools.findMethod(ChangeListener.class,
"filenameChanged", ChangeEvent.class);
import java.util.Date;
import java.util.EventListener;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.util.ReflectTools;
import com.vaadin.v7.shared.ui.calendar.CalendarEventId;
import com.vaadin.v7.ui.Calendar;
*
*/
@Deprecated
- public interface EventMoveHandler extends EventListener, Serializable {
+ public interface EventMoveHandler extends SerializableEventListener {
/** Trigger method for the MoveEvent. */
public static final Method eventMoveMethod = ReflectTools.findMethod(
/** RangeSelectHandler handles RangeSelectEvent. */
@Deprecated
- public interface RangeSelectHandler extends EventListener, Serializable {
+ public interface RangeSelectHandler extends SerializableEventListener {
/** Trigger method for the RangeSelectEvent. */
public static final Method rangeSelectMethod = ReflectTools.findMethod(
/** ForwardHandler handles ForwardEvent. */
@Deprecated
- public interface ForwardHandler extends EventListener, Serializable {
+ public interface ForwardHandler extends SerializableEventListener {
/** Trigger method for the ForwardEvent. */
public static final Method forwardMethod = ReflectTools.findMethod(
/** BackwardHandler handles BackwardEvent. */
@Deprecated
- public interface BackwardHandler extends EventListener, Serializable {
+ public interface BackwardHandler extends SerializableEventListener {
/** Trigger method for the BackwardEvent. */
public static final Method backwardMethod = ReflectTools.findMethod(
/** DateClickHandler handles DateClickEvent. */
@Deprecated
- public interface DateClickHandler extends EventListener, Serializable {
+ public interface DateClickHandler extends SerializableEventListener {
/** Trigger method for the DateClickEvent. */
public static final Method dateClickMethod = ReflectTools.findMethod(
/** EventClickHandler handles EventClick. */
@Deprecated
- public interface EventClickHandler extends EventListener, Serializable {
+ public interface EventClickHandler extends SerializableEventListener {
/** Trigger method for the EventClick. */
public static final Method eventClickMethod = ReflectTools.findMethod(
/** WeekClickHandler handles WeekClicks. */
@Deprecated
- public interface WeekClickHandler extends EventListener, Serializable {
+ public interface WeekClickHandler extends SerializableEventListener {
/** Trigger method for the WeekClick. */
public static final Method weekClickMethod = ReflectTools.findMethod(
* Handler for EventResize event.
*/
@Deprecated
- public interface EventResizeHandler extends EventListener, Serializable {
+ public interface EventResizeHandler extends SerializableEventListener {
/** Trigger method for the EventResize. */
public static final Method eventResizeMethod = ReflectTools.findMethod(
*/
package com.vaadin.v7.ui.components.colorpicker;
-import java.io.Serializable;
+import com.vaadin.event.SerializableEventListener;
/**
* The listener interface for receiving colorChange events. The class that is
* @see ColorChangeEvent
*/
@Deprecated
-public interface ColorChangeListener extends Serializable {
+public interface ColorChangeListener extends SerializableEventListener {
/**
* Called when a new color has been selected.
*/
package com.vaadin.data.provider;
-import java.io.Serializable;
+import com.vaadin.event.SerializableEventListener;
/**
* Interface for listening for a data change events fired by a
* the data type
*/
@FunctionalInterface
-public interface DataProviderListener<T> extends Serializable {
+public interface DataProviderListener<T> extends SerializableEventListener {
/**
* Invoked when this listener receives a data change event from a data
* Listener for {@link ContextClickEvent ContextClickEvents}.
*/
@FunctionalInterface
- public interface ContextClickListener extends Serializable {
+ public interface ContextClickListener extends SerializableEventListener {
/**
* Called when the context click happens.
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Objects;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.server.ErrorEvent;
import com.vaadin.server.ErrorHandler;
* events generated by this component. Don't add a JavaDoc comment here, we
* use the default documentation from implemented interface.
*/
+ @Deprecated
@Override
public Registration addListener(Class<?> eventType, Object object,
Method method) {
Objects.requireNonNull(object, "Listener must not be null.");
+ getLogger().log(Level.WARNING, "Adding listeners with type Object is"
+ + " deprecated, event listener should extend SerializableEventListener");
if (listenerList == null) {
listenerList = new LinkedHashSet<>();
}
return () -> listenerList.remove(listenerMethod);
}
+ /*
+ * Registers a new listener with the specified activation method to listen
+ * events generated by this component. Don't add a JavaDoc comment here, we
+ * use the default documentation from implemented interface.
+ */
+ @Override
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, Method method) {
+ Objects.requireNonNull(listener, "Listener must not be null.");
+ if (listenerList == null) {
+ listenerList = new LinkedHashSet<>();
+ }
+ ListenerMethod listenerMethod = new ListenerMethod(eventType, listener,
+ method);
+ listenerList.add(listenerMethod);
+ return () -> listenerList.remove(listenerMethod);
+ }
+
/**
* Registers a new event listener with the specified activation method to
* listen events generated by this component. If the activation method does
* For more information on the inheritable event mechanism see the
* {@link com.vaadin.event com.vaadin.event package documentation}.
* </p>
- *
+ *
+ * @deprecated As of 8.12. Use
+ * {@link #addListener(Class, SerializableEventListener, Method, String, SharedState)}
+ * instead
+ *
* @param eventType
* the type of the listened event. Events of this type or its
* subclasses activate the listener.
* if {@code target} is {@code null}
* @since 8.2
*/
+ @Deprecated
public Registration addListener(Class<?> eventType, Object target,
Method method, String eventIdentifier, SharedState state) {
- Objects.requireNonNull(target, "Listener must not be null.");
+ getLogger().log(Level.WARNING, "Adding listeners with type Object is"
+ + " deprecated, event listener should extend SerializableEventListener");
if (listenerList == null) {
listenerList = new LinkedHashSet<>();
}
};
}
+ /**
+ * Registers a new event listener with the specified activation method to
+ * listen events generated by this component. If the activation method does
+ * not have any arguments the event object will not be passed to it when
+ * it's called.
+ *
+ * <p>
+ * This method additionally informs the event-api to stop routing events
+ * with the given {@code eventIdentifier} to the components handleEvent
+ * function call.
+ * </p>
+ *
+ * <p>
+ * The only way to remove the listener is to use the returned
+ * {@link Registration}. The other methods, e.g.
+ * {@link #removeAllListeners()} do not do that.
+ * </p>
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the listener instance who owns the activation method.
+ * @param method
+ * the activation method.
+ * @param eventIdentifier
+ * the identifier of the event to listen for
+ * @param state
+ * The component State
+ * @return a registration object for removing the listener
+ * @throws IllegalArgumentException
+ * unless {@code method} has exactly one match in {@code target}
+ * @throws NullPointerException
+ * if {@code target} is {@code null}
+ * @since 8.12
+ */
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, Method method,
+ String eventIdentifier, SharedState state) {
+ if (listenerList == null) {
+ listenerList = new LinkedHashSet<>();
+ }
+ ListenerMethod listenerMethod = new ListenerMethod(eventType, listener,
+ method);
+ listenerList.add(listenerMethod);
+
+ Registration registration = ComponentStateUtil
+ .addRegisteredEventListener(state, eventIdentifier);
+
+ return () -> {
+ listenerList.remove(listenerMethod);
+ if (!hasListeners(eventType)) {
+ registration.remove();
+ }
+ };
+ }
+
/*
* Registers a new listener with the specified named activation method to
* listen events generated by this component. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
+ @Deprecated
@Override
public Registration addListener(Class<?> eventType, Object object,
String methodName) {
Objects.requireNonNull(object, "Listener must not be null.");
+ getLogger().log(Level.WARNING, "Adding listeners with type Object is"
+ + " deprecated, event listener should extend SerializableEventListener");
if (listenerList == null) {
listenerList = new LinkedHashSet<>();
}
return () -> listenerList.remove(listenerMethod);
}
+ /*
+ * Registers a new listener with the specified named activation method to
+ * listen events generated by this component. Don't add a JavaDoc comment
+ * here, we use the default documentation from implemented interface.
+ */
+ @Override
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, String methodName) {
+ Objects.requireNonNull(listener, "Listener must not be null.");
+ if (listenerList == null) {
+ listenerList = new LinkedHashSet<>();
+ }
+ ListenerMethod listenerMethod = new ListenerMethod(eventType, listener,
+ methodName);
+ listenerList.add(listenerMethod);
+ return () -> listenerList.remove(listenerMethod);
+ }
+
/*
* Removes all registered listeners matching the given parameters. Don't add
* a JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
+ @Deprecated
public void removeListener(Class<?> eventType, Object target) {
if (listenerList != null) {
final Iterator<ListenerMethod> i = listenerList.iterator();
}
}
+ /*
+ * Removes all registered listeners matching the given parameters. Don't add
+ * a JavaDoc comment here, we use the default documentation from implemented
+ * interface.
+ */
+ @Override
+ public void removeListener(Class<?> eventType,
+ SerializableEventListener listener) {
+ removeListener(eventType, (Object) listener);
+ }
+
/*
* Removes the event listener methods matching the given given parameters.
* Don't add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
+ @Deprecated
public void removeListener(Class<?> eventType, Object target,
Method method) {
if (listenerList != null) {
* implemented interface.
*/
@Override
+ @Deprecated
public void removeListener(Class<?> eventType, Object target,
String methodName) {
}
return listeners;
}
+
+ private static final Logger getLogger() {
+ return Logger.getLogger(EventRouter.class.getName());
+ }
}
* will not be passed to the trigger method, though it is still
* called.
* @throws IllegalArgumentException
- * if <code>method</code> is not a member of <code>target</code>
- * .
+ * if <code>method</code> is not a member of <code>target</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, Method method,
Object[] arguments, int eventArgumentIndex)
throws IllegalArgumentException {
this.eventArgumentIndex = eventArgumentIndex;
}
+ /**
+ * <p>
+ * Constructs a new event listener from a trigger method, it's arguments and
+ * the argument index specifying which one is replaced with the event object
+ * when the trigger method is called.
+ * </p>
+ *
+ * <p>
+ * This constructor gets the trigger method as a parameter so it does not
+ * need to reflect to find it out.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method
+ * @param method
+ * the trigger method
+ * @param arguments
+ * the arguments to be passed to the trigger method
+ * @param eventArgumentIndex
+ * An index to the argument list. This index points out the
+ * argument that is replaced with the event object before the
+ * argument set is passed to the trigger method. If the
+ * eventArgumentIndex is negative, the triggering event object
+ * will not be passed to the trigger method, though it is still
+ * called.
+ * @throws IllegalArgumentException
+ * if <code>method</code> is not a member of <code>target</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, Method method,
+ Object[] arguments, int eventArgumentIndex)
+ throws IllegalArgumentException {
+ this(eventType, (Object) listener, method, arguments,
+ eventArgumentIndex);
+ }
+
/**
* <p>
* Constructs a new event listener from a trigger method name, it's
* unless exactly one match <code>methodName</code> is found in
* <code>target</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, String methodName,
Object[] arguments, int eventArgumentIndex)
throws IllegalArgumentException {
this.eventArgumentIndex = eventArgumentIndex;
}
+ /**
+ * <p>
+ * Constructs a new event listener from a trigger method name, it's
+ * arguments and the argument index specifying which one is replaced with
+ * the event object. The actual trigger method is reflected from
+ * <code>object</code>, and <code>java.lang.IllegalArgumentException</code>
+ * is thrown unless exactly one match is found.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method.
+ * @param methodName
+ * the name of the trigger method. If the object does not contain
+ * the method or it contains more than one matching methods
+ * <code>java.lang.IllegalArgumentException</code> is thrown.
+ * @param arguments
+ * the arguments to be passed to the trigger method.
+ * @param eventArgumentIndex
+ * An index to the argument list. This index points out the
+ * argument that is replaced with the event object before the
+ * argument set is passed to the trigger method. If the
+ * eventArgumentIndex is negative, the triggering event object
+ * will not be passed to the trigger method, though it is still
+ * called.
+ * @throws IllegalArgumentException
+ * unless exactly one match <code>methodName</code> is found in
+ * <code>target</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, String methodName,
+ Object[] arguments, int eventArgumentIndex)
+ throws IllegalArgumentException {
+ this(eventType, (Object) listener, methodName, arguments,
+ eventArgumentIndex);
+ }
+
/**
* <p>
* Constructs a new event listener from the trigger method and it's
* @param arguments
* the arguments to be passed to the trigger method.
* @throws IllegalArgumentException
- * if <code>method</code> is not a member of <code>target</code>
- * .
+ * if <code>method</code> is not a member of <code>target</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, Method method,
Object[] arguments) throws IllegalArgumentException {
eventArgumentIndex = -1;
}
+ /**
+ * <p>
+ * Constructs a new event listener from the trigger method and it's
+ * arguments. Since the the index to the replaced parameter is not specified
+ * the event triggering this listener will not be passed to the trigger
+ * method.
+ * </p>
+ *
+ * <p>
+ * This constructor gets the trigger method as a parameter so it does not
+ * need to reflect to find it out.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method.
+ * @param method
+ * the trigger method.
+ * @param arguments
+ * the arguments to be passed to the trigger method.
+ * @throws IllegalArgumentException
+ * if <code>method</code> is not a member of <code>target</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, Method method,
+ Object[] arguments) throws IllegalArgumentException {
+ this(eventType, (Object) listener, method, arguments);
+ }
+
/**
* <p>
* Constructs a new event listener from a trigger method name and it's
* unless exactly one match <code>methodName</code> is found in
* <code>object</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, String methodName,
Object[] arguments) throws IllegalArgumentException {
eventArgumentIndex = -1;
}
+ /**
+ * <p>
+ * Constructs a new event listener from a trigger method name and it's
+ * arguments. Since the the index to the replaced parameter is not specified
+ * the event triggering this listener will not be passed to the trigger
+ * method.
+ * </p>
+ *
+ * <p>
+ * The actual trigger method is reflected from <code>listener</code>, and
+ * <code>java.lang.IllegalArgumentException</code> is thrown unless exactly
+ * one match is found.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method.
+ * @param methodName
+ * the name of the trigger method. If the object does not contain
+ * the method or it contains more than one matching methods
+ * <code>java.lang.IllegalArgumentException</code> is thrown.
+ * @param arguments
+ * the arguments to be passed to the trigger method.
+ * @throws IllegalArgumentException
+ * unless exactly one match <code>methodName</code> is found in
+ * <code>object</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, String methodName,
+ Object[] arguments) throws IllegalArgumentException {
+ this(eventType, (Object) listener, methodName, arguments);
+ }
+
/**
* <p>
* Constructs a new event listener from a trigger method. Since the argument
* @param method
* the trigger method.
* @throws IllegalArgumentException
- * if <code>method</code> is not a member of <code>object</code>
- * .
+ * if <code>method</code> is not a member of <code>object</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, Method method)
throws IllegalArgumentException {
}
}
+ /**
+ * <p>
+ * Constructs a new event listener from a trigger method. Since the argument
+ * list is unspecified no parameters are passed to the trigger method when
+ * the listener is triggered.
+ * </p>
+ *
+ * <p>
+ * This constructor gets the trigger method as a parameter so it does not
+ * need to reflect to find it out.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method.
+ * @param method
+ * the trigger method.
+ * @throws IllegalArgumentException
+ * if <code>method</code> is not a member of <code>object</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, Method method)
+ throws IllegalArgumentException {
+ this(eventType, (Object) listener, method);
+ }
+
/**
* <p>
* Constructs a new event listener from a trigger method name. Since the
* unless exactly one match <code>methodName</code> is found in
* <code>target</code>.
*/
+ @Deprecated
public ListenerMethod(Class<?> eventType, Object target, String methodName)
throws IllegalArgumentException {
}
}
+ /**
+ * <p>
+ * Constructs a new event listener from a trigger method name. Since the
+ * argument list is unspecified no parameters are passed to the trigger
+ * method when the listener is triggered.
+ * </p>
+ *
+ * <p>
+ * The actual trigger method is reflected from <code>listener</code>, and
+ * <code>java.lang.IllegalArgumentException</code> is thrown unless exactly
+ * one match is found.
+ * </p>
+ *
+ * @param eventType
+ * the event type that is listener listens to. All events of this
+ * kind (or its subclasses) result in calling the trigger method.
+ * @param listener
+ * the listener instance that contains the trigger method.
+ * @param methodName
+ * the name of the trigger method. If the object does not contain
+ * the method or it contains more than one matching methods
+ * <code>java.lang.IllegalArgumentException</code> is thrown.
+ * @throws IllegalArgumentException
+ * unless exactly one match <code>methodName</code> is found in
+ * <code>target</code>.
+ */
+ public ListenerMethod(Class<?> eventType,
+ SerializableEventListener listener, String methodName)
+ throws IllegalArgumentException {
+ this(eventType, (Object) listener, methodName);
+ }
+
/**
* Receives one event from the <code>EventRouter</code> and calls the
* trigger method if it matches with the criteria defined for the listener.
* @return <code>true</code> if <code>target</code> is the same object as
* the one stored in this object, <code>eventType</code> equals with
* the event type stored in this object and <code>method</code>
- * equals with the method stored in this object
+ * equals with the method stored in this object.
*/
public boolean matches(Class<?> eventType, Object target, Method method) {
return (this.target == target) && (eventType.equals(this.eventType)
* if {@code object} is {@code null}
* @since 8.0
*/
+ @Deprecated
public Registration addListener(Class<?> eventType, Object object,
Method method);
+ /**
+ * Registers a new event listener with the specified activation method to
+ * listen events generated by this component. If the activation method does
+ * not have any arguments the event object will not be passed to it when
+ * it's called.
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the listener instance who owns the activation method.
+ * @param method
+ * the activation method.
+ * @return a registration object for removing the listener
+ * @throws IllegalArgumentException
+ * unless <code>method</code> has exactly one match in
+ * <code>object</code>
+ * @throws NullPointerException
+ * if {@code object} is {@code null}
+ * @since 8.12
+ */
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, Method method);
+
/**
* Registers a new listener with the specified activation method to listen
* events generated by this component. If the activation method does not
* if {@code object} is {@code null}
* @since 8.0
*/
+ @Deprecated
public Registration addListener(Class<?> eventType, Object object,
String methodName);
+ /**
+ * Registers a new listener with the specified activation method to listen
+ * events generated by this component. If the activation method does not
+ * have any arguments the event object will not be passed to it when it's
+ * called.
+ *
+ * <p>
+ * This version of <code>addListener</code> gets the name of the activation
+ * method as a parameter. The actual method is reflected from
+ * <code>listener</code>, and unless exactly one match is found,
+ * <code>java.lang.IllegalArgumentException</code> is thrown.
+ * </p>
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the listener instance who owns the activation method.
+ * @param methodName
+ * the name of the activation method.
+ * @return a registration object for removing the listener
+ * @throws IllegalArgumentException
+ * unless <code>method</code> has exactly one match in
+ * <code>object</code>
+ * @throws NullPointerException
+ * if {@code object} is {@code null}
+ * @since 8.12
+ */
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener object, String methodName);
+
/**
* Removes all registered listeners matching the given parameters. Since
* this method receives the event type and the listener object as
* the target object that has registered to listen to events of
* type <code>eventType</code> with one or more methods.
*/
+ @Deprecated
public void removeListener(Class<?> eventType, Object target);
+ /**
+ * Removes all registered listeners matching the given parameters. Since
+ * this method receives the event type and the listener object as
+ * parameters, it will unregister all <code>object</code>'s methods that are
+ * registered to listen to events of type <code>eventType</code> generated
+ * by this component.
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the exact event type the <code>object</code> listens to.
+ * @param listener
+ * the listener that has registered to listen to events of type
+ * <code>eventType</code> with one or more methods.
+ * @since 8.12
+ */
+ public void removeListener(Class<?> eventType,
+ SerializableEventListener listener);
+
/**
* Removes one registered listener method. The given method owned by the
* given object will no longer be called when the specified events are
* the type of the sorting information
*/
@FunctionalInterface
- public interface SortListener<T extends SortOrder<?>> extends Serializable {
+ public interface SortListener<T extends SortOrder<?>> extends SerializableEventListener {
/**
* Called when the sort order has changed.
*
* @author Vaadin Ltd
*/
@FunctionalInterface
- public interface PollListener extends Serializable {
+ public interface PollListener extends SerializableEventListener {
public static final Method POLL_METHOD = ReflectTools
.findMethod(PollListener.class, "poll", PollEvent.class);
import com.vaadin.event.EventRouter;
import com.vaadin.event.MethodEventSource;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.Registration;
import com.vaadin.shared.communication.ClientRpc;
import com.vaadin.shared.communication.ServerRpc;
}
}
- /* Listener code starts. Should be refactored. */
-
/**
* Registers a new listener with the specified activation method to listen
* events generated by this component. If the activation method does not
* For more information on the inheritable event mechanism see the
* {@link com.vaadin.event com.vaadin.event package documentation}.
* </p>
+ *
+ * @deprecated As of 8.12. Use strongly typed
+ * {@link #addListener(String, Class, SerializableEventListener, Method)}
+ * method instead.
*
* @param eventIdentifier
* the identifier of the event to listen for
* @return a registration object for removing the listener
* @since 8.0
*/
+ @Deprecated
protected Registration addListener(String eventIdentifier,
Class<?> eventType, Object target, Method method) {
if (eventRouter == null) {
eventIdentifier, getState());
}
+ /**
+ * Registers a new listener with the specified activation method to listen
+ * events generated by this component. If the activation method does not
+ * have any arguments the event object will not be passed to it when it's
+ * called.
+ *
+ * <p>
+ * This method additionally informs the event-api to route events with the
+ * given eventIdentifier to the components handleEvent function call.
+ * </p>
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventIdentifier
+ * the identifier of the event to listen for
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the listener instance who owns the activation method.
+ * @param method
+ * the activation method.
+ * @return a registration object for removing the listener
+ * @since 8.12
+ */
+ protected Registration addListener(String eventIdentifier,
+ Class<?> eventType, SerializableEventListener listener,
+ Method method) {
+ if (eventRouter == null) {
+ eventRouter = new EventRouter();
+ }
+ return eventRouter.addListener(eventType, listener, method,
+ eventIdentifier, getState());
+ }
+
/**
* Checks if the given {@link Event} type is listened for this component.
*
* For more information on the inheritable event mechanism see the
* {@link com.vaadin.event com.vaadin.event package documentation}.
* </p>
+ *
+ * @deprecated As of 8.12. Use strongly typed
+ * {@link #addListener(Class, SerializableEventListener, Method)}
+ * method instead.
*
* @param eventType
* the type of the listened event. Events of this type or its
* @return a registration object for removing the listener
*/
@Override
+ @Deprecated
public Registration addListener(Class<?> eventType, Object target,
Method method) {
if (eventRouter == null) {
return eventRouter.addListener(eventType, target, method);
}
+ /**
+ * Registers a new listener with the specified activation method to listen
+ * events generated by this component. If the activation method does not
+ * have any arguments the event object will not be passed to it when it's
+ * called.
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the listener instance who owns the activation method.
+ * @param method
+ * the activation method.
+ * @return a registration object for removing the listener
+ * @since 8.12
+ */
+
+ @Override
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, Method method) {
+ if (eventRouter == null) {
+ eventRouter = new EventRouter();
+ }
+ return eventRouter.addListener(eventType, listener, method);
+ }
+
/**
* Convenience method for registering a new listener with the specified
* activation method to listen events generated by this component. If the
* the name of the activation method.
* @return a registration object for removing the listener
* @deprecated As of 7.0. This method should be avoided. Use
- * {@link #addListener(Class, Object, Method)} or
- * {@link #addListener(String, Class, Object, Method)} instead.
+ * {@link #addListener(Class, SerializableEventListener, Method)}
+ * or
+ * {@link #addListener(String, Class, SerializableEventListener, Method)}
+ * instead.
* @since 8.0
*/
@Override
return eventRouter.addListener(eventType, target, methodName);
}
+ /**
+ * Convenience method for registering a new listener with the specified
+ * activation method to listen events generated by this component. If the
+ * activation method does not have any arguments the event object will not
+ * be passed to it when it's called.
+ *
+ * <p>
+ * This version of <code>addListener</code> gets the name of the activation
+ * method as a parameter. The actual method is reflected from
+ * <code>object</code>, and unless exactly one match is found,
+ * <code>java.lang.IllegalArgumentException</code> is thrown.
+ * </p>
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * <p>
+ * Note: Using this method is discouraged because it cannot be checked
+ * during compilation. Use {@link #addListener(Class, Object, Method)} or
+ * {@link #addListener(String, Class, Object, Method) instead. </p>
+ *
+ * @param eventType
+ * the type of the listened event. Events of this type or its
+ * subclasses activate the listener.
+ * @param listener
+ * the object instance who owns the activation method.
+ * @param methodName
+ * the name of the activation method.
+ * @return a registration object for removing the listener
+ * @deprecated This method has only been added for ease of migration and
+ * should be avoided in new code.
+ * Use
+ * {@link #addListener(Class, SerializableEventListener, Method)}
+ * or
+ * {@link #addListener(String, Class, SerializableEventListener, Method)}
+ * instead.
+ * @since 8.12
+ */
+ @Override
+ @Deprecated
+ public Registration addListener(Class<?> eventType,
+ SerializableEventListener listener, String methodName) {
+ if (eventRouter == null) {
+ eventRouter = new EventRouter();
+ }
+ return eventRouter.addListener(eventType, listener, methodName);
+ }
+
/**
* Removes all registered listeners matching the given parameters. Since
* this method receives the event type and the listener object as
}
}
+ /**
+ * Removes all registered listeners matching the given parameters. Since
+ * this method receives the event type and the listener object as
+ * parameters, it will unregister all <code>object</code>'s methods that are
+ * registered to listen to events of type <code>eventType</code> generated
+ * by this component.
+ *
+ * <p>
+ * For more information on the inheritable event mechanism see the
+ * {@link com.vaadin.event com.vaadin.event package documentation}.
+ * </p>
+ *
+ * @param eventType
+ * the exact event type the <code>object</code> listens to.
+ * @param listener
+ * the listener that has registered to listen to events of type
+ * <code>eventType</code> with one or more methods.
+ * @deprecated use a {@link Registration} from {@link #addListener} to
+ * remove a listener
+ * @since 8.12
+ */
+ @Deprecated
+ @Override
+ public void removeListener(Class<?> eventType,
+ SerializableEventListener listener) {
+ if (eventRouter != null) {
+ eventRouter.removeListener(eventType, listener);
+ }
+ }
+
/**
* Removes one registered listener method. The given method owned by the
* given object will no longer be called when the specified events are
package com.vaadin.server;
-import java.io.Serializable;
-import java.util.EventListener;
-
import javax.portlet.RenderResponse;
+import com.vaadin.event.SerializableEventListener;
+
/**
* Event listener notified when the bootstrap HTML is about to be generated and
* send to the client. The bootstrap HTML is first constructed as an in-memory
* @author Vaadin Ltd
* @since 7.0.0
*/
-public interface BootstrapListener extends EventListener, Serializable {
+public interface BootstrapListener extends SerializableEventListener {
/**
* Lets this listener make changes to the fragment that makes up the actual
* Vaadin application. In a typical Servlet deployment, this is the contents
import com.vaadin.annotations.HtmlImport;
import com.vaadin.annotations.StyleSheet;
import com.vaadin.event.EventRouter;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.BorderStyle;
import com.vaadin.shared.ui.ui.PageClientRpc;
* @see #addBrowserWindowResizeListener(BrowserWindowResizeListener)
*/
@FunctionalInterface
- public interface BrowserWindowResizeListener extends Serializable {
+ public interface BrowserWindowResizeListener extends SerializableEventListener {
/**
* Invoked when the browser window containing a UI has been resized.
*
*/
@Deprecated
@FunctionalInterface
- public interface UriFragmentChangedListener extends Serializable {
+ public interface UriFragmentChangedListener extends SerializableEventListener {
/**
* Event handler method invoked when the URI fragment of the page
* changes. Please note that the initial URI fragment has already been
* @since 8.0
*/
@FunctionalInterface
- public interface PopStateListener extends Serializable {
+ public interface PopStateListener extends SerializableEventListener {
/**
* Event handler method invoked when the URI fragment of the page
* changes. Please note that the initial URI fragment has already been
this.state = state;
}
- private Registration addListener(Class<?> eventType, Object target,
+ private Registration addListener(Class<?> eventType, SerializableEventListener listener,
Method method) {
if (!hasEventRouter()) {
eventRouter = new EventRouter();
}
- return eventRouter.addListener(eventType, target, method);
+ return eventRouter.addListener(eventType, listener, method);
}
- private void removeListener(Class<?> eventType, Object target,
+ private void removeListener(Class<?> eventType, SerializableEventListener listener,
Method method) {
if (hasEventRouter()) {
- eventRouter.removeListener(eventType, target, method);
+ eventRouter.removeListener(eventType, listener, method);
}
}
package com.vaadin.ui;
-import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Collection;
import org.jsoup.nodes.Element;
import com.vaadin.event.Action;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
* @since 3.0
*/
@FunctionalInterface
- public interface ClickListener extends Serializable {
+ public interface ClickListener extends SerializableEventListener {
public static final Method BUTTON_CLICK_METHOD = ReflectTools
.findMethod(ClickListener.class, "buttonClick",
import java.lang.reflect.Method;
import java.util.Iterator;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.Registration;
import com.vaadin.util.ReflectTools;
* Component attach listener interface.
*/
@FunctionalInterface
- public interface ComponentAttachListener extends Serializable {
+ public interface ComponentAttachListener extends SerializableEventListener {
public static final Method attachMethod = ReflectTools.findMethod(
ComponentAttachListener.class, "componentAttachedToContainer",
* Component detach listener interface.
*/
@FunctionalInterface
- public interface ComponentDetachListener extends Serializable {
+ public interface ComponentDetachListener extends SerializableEventListener {
public static final Method detachMethod = ReflectTools.findMethod(
ComponentDetachListener.class, "componentDetachedFromContainer",
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import java.io.Serializable;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.StreamResource;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.Registration;
* Listener triggered when a login occurs in a {@link LoginForm}.
*/
@FunctionalInterface
- public interface LoginListener extends Serializable {
+ public interface LoginListener extends SerializableEventListener {
/**
* Event method invoked when the login button is pressed in a login
* form.
package com.vaadin.ui;
-import java.io.Serializable;
import java.lang.reflect.Method;
import com.vaadin.event.ConnectorEvent;
import com.vaadin.event.HasUserOriginated;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.AbstractExtension;
import com.vaadin.server.Page;
import com.vaadin.server.Resource;
* @since 8.2
*/
@FunctionalInterface
- public interface CloseListener extends Serializable {
+ public interface CloseListener extends SerializableEventListener {
/**
* Use {@link CloseEvent#getNotification()} to get a reference to the
* {@link Notification} that was closed.
import org.jsoup.nodes.Node;
import org.jsoup.parser.Tag;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.popupview.PopupViewServerRpc;
import com.vaadin.shared.ui.popupview.PopupViewState;
*
*/
@FunctionalInterface
- public interface PopupVisibilityListener extends Serializable {
+ public interface PopupVisibilityListener extends SerializableEventListener {
/**
* Pass to {@link PopupView.PopupVisibilityEvent} to start listening for
* popup visibility changes.
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.Objects;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.event.HasUserOriginated;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.KeyMapper;
import com.vaadin.server.Resource;
* @since 3.0
*/
@FunctionalInterface
- public interface SelectedTabChangeListener extends Serializable {
+ public interface SelectedTabChangeListener extends SerializableEventListener {
/**
* Selected (shown) tab in tab sheet has has been changed.
import java.util.Map;
import java.util.Objects;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.NoInputStreamException;
import com.vaadin.server.NoOutputStreamException;
import com.vaadin.server.PaintException;
* @since 5.0
*/
@FunctionalInterface
- public interface StartedListener extends Serializable {
+ public interface StartedListener extends SerializableEventListener {
/**
* Upload has started.
* @since 3.0
*/
@FunctionalInterface
- public interface FinishedListener extends Serializable {
+ public interface FinishedListener extends SerializableEventListener {
/**
* Upload has finished.
* @since 3.0
*/
@FunctionalInterface
- public interface FailedListener extends Serializable {
+ public interface FailedListener extends SerializableEventListener {
/**
* Upload has finished unsuccessfully.
* @since 3.0
*/
@FunctionalInterface
- public interface SucceededListener extends Serializable {
+ public interface SucceededListener extends SerializableEventListener {
/**
* Upload successful.
* @since 7.2
*/
@FunctionalInterface
- public interface ChangeListener extends Serializable {
+ public interface ChangeListener extends SerializableEventListener {
Method FILENAME_CHANGED = ReflectTools.findMethod(ChangeListener.class,
"filenameChanged", ChangeEvent.class);
package com.vaadin.ui;
-import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.event.MouseEvents.ClickEvent;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
* </p>
*/
@FunctionalInterface
- public interface CloseListener extends Serializable {
+ public interface CloseListener extends SerializableEventListener {
/**
* Called when the user closes a window. Use
* {@link CloseEvent#getWindow()} to get a reference to the
* {@link WindowMode#MAXIMIZED}) or restored ({@link WindowMode#NORMAL} ).
*/
@FunctionalInterface
- public interface WindowModeChangeListener extends Serializable {
+ public interface WindowModeChangeListener extends SerializableEventListener {
public static final Method windowModeChangeMethod = ReflectTools
.findMethod(WindowModeChangeListener.class, "windowModeChanged",
* @see com.vaadin.ui.Window.ResizeEvent
*/
@FunctionalInterface
- public interface ResizeListener extends Serializable {
+ public interface ResizeListener extends SerializableEventListener {
public void windowResized(ResizeEvent e);
}
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* @since 8.0
*/
@FunctionalInterface
-public interface ColumnReorderListener extends Serializable {
+public interface ColumnReorderListener extends SerializableEventListener {
/**
* Called when the columns of the grid have been reordered.
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* @since 8.0
*/
@FunctionalInterface
-public interface ColumnResizeListener extends Serializable {
+public interface ColumnResizeListener extends SerializableEventListener {
/**
* Called when the columns of the grid have been resized.
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* @since 8.0
*/
@FunctionalInterface
-public interface ColumnVisibilityChangeListener extends Serializable {
+public interface ColumnVisibilityChangeListener extends SerializableEventListener {
/**
* Called when a column has become hidden or unhidden.
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* the bean type
*/
@FunctionalInterface
-public interface EditorCancelListener<T> extends Serializable {
+public interface EditorCancelListener<T> extends SerializableEventListener {
/**
* Called when the editor is cancelled.
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* @see Editor#addOpenListener(EditorOpenListener)
*/
@FunctionalInterface
-public interface EditorOpenListener<T> extends Serializable {
+public interface EditorOpenListener<T> extends SerializableEventListener {
/**
* Called when the editor is opened.
*/
package com.vaadin.ui.components.grid;
-import java.io.Serializable;
-
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.ui.Grid;
/**
* @see Editor#addSaveListener(EditorSaveListener)
*/
@FunctionalInterface
-public interface EditorSaveListener<T> extends Serializable {
+public interface EditorSaveListener<T> extends SerializableEventListener {
/**
* Called when the editor is saved.
import java.lang.reflect.Method;
import java.util.EventObject;
+import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.AbstractExtension;
import com.vaadin.tests.widgetset.client.minitutorials.v7a3.RefresherRpc;
import com.vaadin.tests.widgetset.client.minitutorials.v7a3.RefresherState;
import com.vaadin.util.ReflectTools;
public class Refresher extends AbstractExtension {
- public interface RefreshListener {
+ public interface RefreshListener extends SerializableEventListener {
static Method METHOD = ReflectTools.findMethod(RefreshListener.class,
"refresh", RefreshEvent.class);