Fixed stuff.
[FinalKeyGui.git] / src / fkgui / FkManager.java
index cda22a7..ca86d2a 100644 (file)
@@ -25,17 +25,27 @@ public class FkManager implements ActionListener {
        {
                public String name;
                public String num;
        {
                public String name;
                public String num;
-               
+               private Boolean showNumInName;
                public Account( String acNum, String acName )
                {
                        name = acName;
                        num = acNum;
                }
                public Account( String acNum, String acName )
                {
                        name = acName;
                        num = acNum;
                }
-               
+
+               //Used by the ListView
                public String toString()
                {
                public String toString()
                {
+                       if( showNumInName )
+                       {
+                               return( "["+num+"] "+name);
+                       }
                        return(name);
                }
                        return(name);
                }
+
+               public Account showNumInName(Boolean showAccountId) {
+                       showNumInName=showAccountId;
+                       return this;
+               }
        }
                
        private Vector<Account> list;
        }
                
        private Vector<Account> list;
@@ -249,11 +259,28 @@ public class FkManager implements ActionListener {
                list.clear();
        }
        
                list.clear();
        }
        
+       //Return the full list
        public Vector<Account> getList()
        {
                return(list);
        }
        
        public Vector<Account> getList()
        {
                return(list);
        }
        
+       //Return a vector of accounts matching the keyword
+       public Vector<Account> getList(String key)
+       {
+               Vector<Account> res = new Vector<Account>();
+               String k = key.toLowerCase();
+               for( Account a : list )
+               {
+                       if( a.name.toLowerCase().contains( k ) ) 
+                       {
+                               res.add(a);
+                       }
+               }
+               
+               return(res);
+       }
+       
        public void getCurrentLayout()
        {
                
        public void getCurrentLayout()
        {