@Override
 public void dispose() {
   super.dispose();
   if (selection != null) {
     selection.removeSelectionListener(this);
   }
 }
 public DropDbObjectAction(
     String labelKey, DbObjectList client, WbSelectionModel list, Reloadable r) {
   super();
   this.initMenuDefinition(labelKey);
   this.source = client;
   this.data = r;
   selection = list;
   selectionChanged(list);
   selection.addSelectionListener(this);
 }
 private CreateDummySqlAction(
     String key, DbObjectList client, WbSelectionModel list, String type) {
   super();
   isConfigurable = false;
   initMenuDefinition(key);
   source = client;
   scriptType = type;
   selection = list;
   checkEnabled();
   selection.addSelectionListener(this);
 }
 private void checkEnabled() {
   if (selection.hasSelection()) {
     List<? extends DbObject> objects = source.getSelectedObjects();
     for (DbObject dbo : objects) {
       if (!(dbo instanceof TableIdentifier)) {
         setEnabled(false);
         return;
       }
     }
     setEnabled(true);
   } else {
     setEnabled(false);
   }
 }