 import com.threerings.util.Util;
 
 import com.threerings.presents.dobj.AttributeChangedEvent;
-import com.threerings.presents.dobj.AttributeChangeAdapter;
+import com.threerings.presents.dobj.DEvent;
 import com.threerings.presents.dobj.DObject;
 import com.threerings.presents.dobj.DSet;
 import com.threerings.presents.dobj.DSet_Entry;
 import com.threerings.presents.dobj.EntryAddedEvent;
 import com.threerings.presents.dobj.EntryUpdatedEvent;
 import com.threerings.presents.dobj.EntryRemovedEvent;
-import com.threerings.presents.dobj.SetAdapter;
+import com.threerings.presents.dobj.EventListener;
+import com.threerings.presents.dobj.NamedEvent;
 
 /**
  * A list that renders the contents of a DSet.
  */
 public class DSetList extends List
+    implements EventListener
 {
     public function DSetList (
         renderer :IFactory, sortFn :Function = null, filterFn :Function = null)

     */
    public function shutdown () :void
    {
        if (_attrListener != null) {
            _object.removeListener(_attrListener);
            _object.removeListener(_setListener);
            _attrListener = null;
            _setListener = null;
            _object = null;
            _field = null;
            _refreshFields = null;

    }

    /**
     * From com.threerings.presents.dobj.EventListener. Not actually part of the public API.
     */
    public function eventReceived (event :DEvent) :void
    {
        if (!(event is NamedEvent)) {
            return;
        }
        var name :String = NamedEvent(event).getName();
        if (name == _field) {
            if (event is EntryAddedEvent) {
                _data.list.addItem(EntryAddedEvent(event).getEntry());

            } else if (event is EntryUpdatedEvent) {
                var entry :DSet_Entry = EntryUpdatedEvent(event).getEntry();
                var upIdx :int = findKeyIndex(entry.getKey());
                if (upIdx != -1) {
                    _data.list.setItemAt(entry, upIdx);
                }

            } else if (event is EntryRemovedEvent) {
                var remIdx :int = findKeyIndex(EntryRemovedEvent(event).getKey());
                if (remIdx != -1) {
                    _data.list.removeItemAt(remIdx);
                }

            } else if (event is AttributeChangedEvent) {
                setEntries(AttributeChangedEvent(event).getValue() as DSet);
                return; // skip the full refresh
            }

        } else if (-1 == _refreshFields.indexOf(name)) {
            return; // this name is not our concern: do nothing
        }

        // we reach this line if the event was for a _refreshField, or a Set event on _field
        refresh();
    }

    /**
