@SuppressWarnings("unchecked") public WeakCollectionChangeListener(CollectionContainer container, Consumer<CollectionContainer.CollectionChangeEvent<E>> collectionChangeListener) { reference = new WeakReference(collectionChangeListener); subscription = container.addCollectionChangeListener(this); }
public ContainerCalendarEventProvider(CollectionContainer<E> container) { this.container = container; collectionChangeListener = this.container.addCollectionChangeListener(this::onCollectionChanged); propertyChangeListener = this.container.addItemPropertyChangeListener(this::onItemPropertyChanged); }
public ContainerDataGridItems(CollectionContainer<E> container) { this.container = container; this.container.addItemChangeListener(this::containerItemChanged); this.container.addCollectionChangeListener(this::containerCollectionChanged); this.container.addItemPropertyChangeListener(this::containerItemPropertyChanged); }
public ContainerOptions(CollectionContainer<E> container) { this.container = container; if (container instanceof HasLoader) { this.loader = ((HasLoader) container).getLoader(); } this.container.addCollectionChangeListener(this::containerCollectionChanged); this.container.addItemPropertyChangeListener(this::containerItemPropertyChanged); }
public ContainerTreeItems(CollectionContainer<E> container, String hierarchyProperty) { this.container = container; this.hierarchyProperty = hierarchyProperty; this.container.addItemChangeListener(this::containerItemChanged); this.container.addCollectionChangeListener(this::containerCollectionChanged); this.container.addItemPropertyChangeListener(this::containerItemPropertyChanged); }
public ContainerTableItems(CollectionContainer<E> container) { this.container = container; this.container.addItemChangeListener(this::containerItemChanged); this.container.addCollectionChangeListener(this::containerCollectionChanged); this.container.addItemPropertyChangeListener(this::containerItemPropertyChanged); this.aggregatableDelegate = createAggregatableDelegate(); }
public ContainerDataProvider(CollectionContainer dataContainer) { this.dataContainer = dataContainer; collectionChangeListener = e -> { DataChangeOperation operation = null; switch (e.getChangeType()) { case REFRESH: operation = DataChangeOperation.REFRESH; break; case SET_ITEM: operation = DataChangeOperation.UPDATE; break; case ADD_ITEMS: operation = DataChangeOperation.ADD; break; case REMOVE_ITEMS: operation = DataChangeOperation.REMOVE; break; } fireCollectionChangeListener(operation, e.getChanges()); }; //noinspection unchecked this.dataContainer.addCollectionChangeListener(collectionChangeListener); }