mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 19:27:57 +08:00
PL-9799 Inherit WebAbstractComponent from EventRouter
This commit is contained in:
parent
ee36c4ad1c
commit
d9a3aa91df
@ -26,9 +26,9 @@ import java.util.function.BiConsumer;
|
||||
* Generic Event router with lazily initialized events map.
|
||||
*/
|
||||
@NotThreadSafe
|
||||
public final class EventRouter {
|
||||
protected static final int EVENTS_MAP_EXPECTED_MAX_SIZE = 4;
|
||||
protected static final int EVENTS_LIST_INITIAL_CAPACITY = 2;
|
||||
public class EventRouter {
|
||||
private static final int EVENTS_MAP_EXPECTED_MAX_SIZE = 4;
|
||||
private static final int EVENTS_LIST_INITIAL_CAPACITY = 2;
|
||||
|
||||
// Map with listener classes and listener lists
|
||||
// Lists are created on demand
|
||||
|
@ -36,6 +36,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class WebAbstractComponent<T extends com.vaadin.ui.AbstractComponent>
|
||||
extends EventRouter
|
||||
implements Component, Component.Wrapper, Component.HasXmlDescriptor, Component.BelongToFrame, Component.HasIcon,
|
||||
Component.HasCaption {
|
||||
|
||||
@ -56,19 +57,13 @@ public abstract class WebAbstractComponent<T extends com.vaadin.ui.AbstractCompo
|
||||
protected Alignment alignment = Alignment.TOP_LEFT;
|
||||
protected String icon;
|
||||
|
||||
private EventRouter eventRouter;
|
||||
|
||||
/**
|
||||
* Use EventRouter for listeners instead of fields with listeners List.
|
||||
*
|
||||
* @return lazily initialized {@link EventRouter} instance.
|
||||
* @see EventRouter
|
||||
*/
|
||||
protected EventRouter getEventRouter() {
|
||||
if (eventRouter == null) {
|
||||
eventRouter = new EventRouter();
|
||||
}
|
||||
return eventRouter;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user