.getMethod("editPatch", new Class[]{myPatch.getClass()}) .getDeclaringClass() != Patch.class); } catch (NoSuchMethodException e) {}
.getMethod("editPatch", new Class[]{myPatch.getClass()}) .getDeclaringClass() != Patch.class); } catch (NoSuchMethodException e) { ErrorMsg.reportStatus(e); }
    protected void enableMenus() {	boolean b = (table.getSelectedRowCount()>0);	PatchEdit.extractAction.setEnabled(b);	PatchEdit.sendAction.setEnabled(b);	PatchEdit.sendToAction.setEnabled(b);	PatchEdit.playAction.setEnabled(b);	PatchEdit.storeAction.setEnabled(b);	PatchEdit.reassignAction.setEnabled(b);	if (b) {	    Patch myPatch=		((Patch)myModel.PatchList.get(table.getSelectedRow()));	    // check if the driver for the selected patch has an editor	    boolean hasEditor = false;	    try {		hasEditor = (myPatch.getDriver().getClass()		     .getMethod("editPatch", new Class[]{myPatch.getClass()})		     .getDeclaringClass() != Patch.class);	    } catch (NoSuchMethodException e) {}	    	    if (hasEditor)		    PatchEdit.editAction.setEnabled(true);	    // the driver has no editor. Is it a bank driver?	    else if (myPatch.getDriver() instanceof BankDriver) {		// for a bankDriver is it ok, since BankEditorFrame works		PatchEdit.editAction.setEnabled(true);	    } else {		// don't allow editing		PatchEdit.editAction.setEnabled(false);	    }	} else {	    PatchEdit.editAction.setEnabled(false);	}	PatchEdit.cutAction.setEnabled(b);	PatchEdit.copyAction.setEnabled(b);	PatchEdit.deleteAction.setEnabled(b);	PatchEdit.exportAction.setEnabled(b);    }