PatchEdit.receiveAction.setEnabled(true); PatchEdit.importAction.setEnabled(true); PatchEdit.importAllAction.setEnabled(true); PatchEdit.newPatchAction.setEnabled(true);  if (table.getRowCount()>0) { PatchEdit.saveAction.setEnabled(true); PatchEdit.saveAsAction.setEnabled(true); PatchEdit.searchAction.setEnabled(true); PatchEdit.transferSceneAction.setEnabled(true); }  if (table.getRowCount()>1) { PatchEdit.sortAction.setEnabled(true); PatchEdit.dupAction.setEnabled(true); PatchEdit.crossBreedAction.setEnabled(true); }  if (table.getSelectedRowCount()>0) { PatchEdit.extractAction.setEnabled(true); PatchEdit.sendAction.setEnabled(true); PatchEdit.sendToAction.setEnabled(true); PatchEdit.playAction.setEnabled(true); PatchEdit.storeAction.setEnabled(true); PatchEdit.reassignAction.setEnabled(true); PatchEdit.uploadAction.setEnabled(true);   Patch myPatch=((Scene)myModel.sceneList.get(table.getSelectedRow())).getPatch(); try{  myPatch.getDriver().getClass().getDeclaredMethod("editPatch", new Class[]{myPatch.getClass()});  PatchEdit.editAction.setEnabled(true); } catch(NoSuchMethodException ex) {  if (myPatch.getDriver() instanceof BankDriver) {  PatchEdit.editAction.setEnabled(true); } else {  PatchEdit.editAction.setEnabled(false); } };  PatchEdit.cutAction.setEnabled(true); PatchEdit.copyAction.setEnabled(true); PatchEdit.deleteAction.setEnabled(true); PatchEdit.exportAction.setEnabled(true); }  }
enableMenus(); }
            public void JSLFrameActivated(JSLFrameEvent e) {                PatchEdit.receiveAction.setEnabled(true);                PatchEdit.importAction.setEnabled(true);                PatchEdit.importAllAction.setEnabled(true);                PatchEdit.newPatchAction.setEnabled(true);                if (table.getRowCount()>0) {                    PatchEdit.saveAction.setEnabled(true);                    PatchEdit.saveAsAction.setEnabled(true);                    PatchEdit.searchAction.setEnabled(true);                    PatchEdit.transferSceneAction.setEnabled(true);                }                if (table.getRowCount()>1) {                    PatchEdit.sortAction.setEnabled(true);                    PatchEdit.dupAction.setEnabled(true);                    PatchEdit.crossBreedAction.setEnabled(true);                }                if (table.getSelectedRowCount()>0) {                    PatchEdit.extractAction.setEnabled(true);                    PatchEdit.sendAction.setEnabled(true);                    PatchEdit.sendToAction.setEnabled(true);                    PatchEdit.playAction.setEnabled(true);                    PatchEdit.storeAction.setEnabled(true);                    PatchEdit.reassignAction.setEnabled(true);		    PatchEdit.uploadAction.setEnabled(true);                    Patch myPatch=((Scene)myModel.sceneList.get(table.getSelectedRow())).getPatch();                    try{                        // look, if the driver for the selected patch brings his own editor                        myPatch.getDriver().getClass().getDeclaredMethod("editPatch", new Class[]{myPatch.getClass()});                        // since the call didn't throw an exception, the driver implements the method itself                        PatchEdit.editAction.setEnabled(true);                    }                    catch(NoSuchMethodException ex) {                        // oh, the driver has no own editor. Is it a bank driver?                        if (myPatch.getDriver() instanceof BankDriver) {                            // for a bankDriver is it ok, since the universal bankEditor works                            PatchEdit.editAction.setEnabled(true);                        }                        else {                            // don't allow editing                            PatchEdit.editAction.setEnabled(false);                        }                    };                    PatchEdit.cutAction.setEnabled(true);                    PatchEdit.copyAction.setEnabled(true);                    PatchEdit.deleteAction.setEnabled(true);                    PatchEdit.exportAction.setEnabled(true);                }            }