@Override public void setContainerDataSource(Container newDataSource) { if (!(newDataSource instanceof ThumbnailContainer)) { throw new IllegalArgumentException("Container must implement info.magnolia.ui.vaadin.layout.data.ThumbnailContainer..."); } if (this.container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) this.container).removeItemSetChangeListener(this); } this.container = (ThumbnailContainer) newDataSource; if (this.container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) this.container).addItemSetChangeListener(this); } refresh(); }
@Override public void setParent(ClientConnector parent) { if (parent == null) { // We're being detached, release various listeners internalDropItems(activeItemHandler.getActiveItemIds()); if (container instanceof ItemSetChangeNotifier) { ((ItemSetChangeNotifier) container) .removeItemSetChangeListener(itemListener); } } else if (!(parent instanceof Grid)) { throw new IllegalStateException( "Grid is the only accepted parent type"); } super.setParent(parent); }
if (items instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) items) .removeItemSetChangeListener(this);
@Override public void removeItemSetChangeListener(ItemSetChangeListener listener) { ((Container.ItemSetChangeNotifier) container).removeItemSetChangeListener(listener); }
@Override public void removeItemSetChangeListener( Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) .removeItemSetChangeListener( new PiggybackListener(listener)); } }
@Override public void removeItemSetChangeListener( Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) .removeItemSetChangeListener( new PiggybackListener(listener)); } }
/** * Removes listeners from the container so no events are processed */ private void ignoreContainerEvents() { if (container instanceof ItemSetChangeNotifier) { ((ItemSetChangeNotifier) container) .removeItemSetChangeListener(this); } if (container instanceof ValueChangeNotifier) { ((ValueChangeNotifier) container).removeValueChangeListener(this); } }
protected void doCancelEditor() { editedItemId = null; editorActive = false; editorFieldGroup.discard(); editorFieldGroup.setItemDataSource(null); if (datasource instanceof ItemSetChangeNotifier) { ((ItemSetChangeNotifier) datasource) .removeItemSetChangeListener(editorClosingItemSetListener); } // Mark Grid as dirty so the client side gets to know that the editors // are no longer attached markAsDirty(); }