if (table.getRowCount ()>0) { PatchEdit.saveAction.setEnabled (true); PatchEdit.menuSaveAs.setEnabled (true); PatchEdit.searchAction.setEnabled (true); } if (table.getRowCount ()>1) { PatchEdit.sortAction.setEnabled (true); PatchEdit.dupAction.setEnabled (true); } if (table.getSelectedRowCount ()>0) { PatchEdit.extractAction.setEnabled (true); PatchEdit.sendAction.setEnabled (true); PatchEdit.sendToAction.setEnabled (false); PatchEdit.reassignAction.setEnabled (false); PatchEdit.playAction.setEnabled (true); PatchEdit.storeAction.setEnabled (true); Patch myPatch=((Patch)myModel.getPatchAt(0,0)); 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); }; PatchEdit.cutAction.setEnabled (true); PatchEdit.copyAction.setEnabled (true); PatchEdit.deleteAction.setEnabled (true); PatchEdit.exportAction.setEnabled (true); }
if (table.getRowCount() > 0) { PatchEdit.saveAction.setEnabled(true); PatchEdit.menuSaveAs.setEnabled(true); PatchEdit.searchAction.setEnabled(true); } if (table.getRowCount() > 1) { PatchEdit.sortAction.setEnabled(true); PatchEdit.dupAction.setEnabled(true); } if (table.getSelectedRowCount() > 0) { PatchEdit.extractAction.setEnabled(true); PatchEdit.sendAction.setEnabled(true); PatchEdit.sendToAction.setEnabled(false); PatchEdit.reassignAction.setEnabled(false); PatchEdit.playAction.setEnabled(true); PatchEdit.storeAction.setEnabled(true);
            public void internalFrameActivated (InternalFrameEvent e)            {                PatchEdit.receiveAction.setEnabled (false);                PatchEdit.pasteAction.setEnabled (true);                PatchEdit.importAction.setEnabled (true);                PatchEdit.importAllAction.setEnabled (true);                PatchEdit.newPatchAction.setEnabled (true);                if (table.getRowCount ()>0)                {                    PatchEdit.saveAction.setEnabled (true);                    PatchEdit.menuSaveAs.setEnabled (true);                    PatchEdit.searchAction.setEnabled (true);                }                if (table.getRowCount ()>1)                {                    PatchEdit.sortAction.setEnabled (true);                    PatchEdit.dupAction.setEnabled (true);                }                if (table.getSelectedRowCount ()>0)                {                    PatchEdit.extractAction.setEnabled (true);                    PatchEdit.sendAction.setEnabled (true);                    PatchEdit.sendToAction.setEnabled (false);	// not available yet!                    PatchEdit.reassignAction.setEnabled (false);// not available yet!                    PatchEdit.playAction.setEnabled (true);                    PatchEdit.storeAction.setEnabled (true);                    Patch myPatch=((Patch)myModel.getPatchAt(0,0)); // All entries are of the same type, so we can check the first one....                    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);                    };                    PatchEdit.cutAction.setEnabled (true);                    PatchEdit.copyAction.setEnabled (true);                    PatchEdit.deleteAction.setEnabled (true);                    PatchEdit.exportAction.setEnabled (true);                }                //System.out.println ("Frame activated"+table.getSelectedRowCount ());            }