public void collectionChanged(CollectionChangeEvent e) { Object source = e.getSource(); if (source == this.localA) { if (!this.listeningToLocalA) { throw new IllegalStateException(ISE_MESSAGE); } } else if (source == this.localB) { this.localA.removeCollectionChangeListener(this); this.listeningToLocalA = false; } else { throw new IllegalStateException("bogus event source: " + source); } }
/** * One of the component collections changed; synchronize our caches by clearing out the * appropriate collection and then rebuilding it. */ protected void componentCollectionChanged(CollectionChangeEvent e) { CollectionValueModel component = (CollectionValueModel) e.getSource(); ArrayList items = this.getComponentCollection(component); this.clearComponentItems(items); this.addComponentItems(component, items); }
/** One of the component collections had items removed; synchronize our caches. */ protected void componentItemsRemoved(CollectionChangeEvent e) { this.removeComponentItems(e.items(), e.size(), (CollectionValueModel) e.getSource()); }
/** * Some component sources were removed; remove their corresponding items from our cache. * * @see * CollectionValueModelWrapper#itemsRemoved(org.eclipse.persistence.tools.workbench.utility.events.CollectionChangeEvent) */ protected void itemsRemoved(CollectionChangeEvent e) { this.removeComponentSources(e.items()); }
/** * Some component sources were added; add their corresponding items to our cache. * * @see * CollectionValueModelWrapper#itemsAdded(org.eclipse.persistence.tools.workbench.utility.events.CollectionChangeEvent) */ protected void itemsAdded(CollectionChangeEvent e) { this.addComponentSources(e.items()); }