s=PatchEdit.getDriver(p.deviceNum,p.driverNum).getPatchName(p).toLowerCase();
s=p.getDriver().getPatchName(p).toLowerCase();
void findString(String text, String command, boolean restart){   if ((PatchEdit.desktop.getSelectedFrame()==null)||(!(PatchEdit.desktop.getSelectedFrame() instanceof AbstractLibraryFrame)))      {ErrorMsg.reportError("Error","Library to search in must be focused.");       return;      }   AbstractLibraryFrame lf= ((AbstractLibraryFrame)PatchEdit.desktop.getSelectedFrame());   if (lf.getAbstractPatchListModel().getRowCount()==0) return;   int searchFrom;   if (restart || lf.getTable().getSelectedRow()==-1) searchFrom=0;     else searchFrom=lf.getTable().getSelectedRow()+1;   Patch p;   int field=0;   if (command.equals("P")) field=0;   if (command.equals("1")) field=1;   if (command.equals("2")) field=2;   if (command.equals("C")) field=3;   if (command.equals("A")) field=4;   text=text.toLowerCase();   String s;   int i;   boolean match=false;   for (i=searchFrom;i<lf.getAbstractPatchListModel().getRowCount();i++)     {       p=(Patch)lf.getAbstractPatchListModel().getPatchAt(i);              match=false;        if (field==0 || field==4)         {          s=PatchEdit.getDriver(p.deviceNum,p.driverNum).getPatchName(p).toLowerCase();          match=(s.indexOf(text)!=-1);          if (match) break;         }        if ((field==1 || field==4) && (lf instanceof LibraryFrame))         {          s=p.date.toString().toLowerCase();          match=(s.indexOf(text)!=-1);          if (match) break;         }        if ((field==2 || field==4) && (lf instanceof LibraryFrame))         {          s=p.author.toString().toLowerCase();          match=(s.indexOf(text)!=-1);          if (match) break;         }         if (field==3 || field==4)         {          s=lf.getAbstractPatchListModel().getCommentAt(i).toString().toLowerCase();          //s=p.comment.toString().toLowerCase();          match=(s.indexOf(text)!=-1);          if (match) break;         }     }   if (!match) {ErrorMsg.reportError("Search Complete","Not Found.");return;}   lf.getTable().changeSelection(i,0,false,false);      }