Changeset 26
- Timestamp:
- 07/27/07 18:46:04 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bbtracker/trunk/src/org/bbtracker/mobile/gui/BrowseForm.java
r7 r26 13 13 14 14 import org.bbtracker.mobile.BBTracker; 15 import org.bbtracker.mobile.IconManager; 15 16 16 17 public class BrowseForm extends List implements CommandListener { … … 50 51 private void updateContent() { 51 52 deleteAll(); 53 final IconManager im = IconManager.getInstance(); 52 54 setTitle(path == null ? title : path + " - " + title); 53 55 if (path == null) { … … 55 57 while (roots.hasMoreElements()) { 56 58 final String root = (String) roots.nextElement(); 57 append(root, null);59 append(root, im.getListImage(getRootIconName(root))); 58 60 } 59 61 } else { … … 65 67 } 66 68 append("<select this directory>", null); 67 append("..", null);69 append("..", im.getListImage("go-up")); 68 70 final Enumeration list = connection.list(); 69 71 while (list.hasMoreElements()) { 70 72 final String element = (String) list.nextElement(); 71 73 if (element.endsWith("/")) { 72 append(element, null);74 append(element, im.getListImage("folder")); 73 75 } 74 76 } … … 77 79 } 78 80 } 81 } 82 83 private String getRootIconName(final String string) { 84 if (string.startsWith("CF")) { 85 return "cf"; 86 } else if (string.startsWith("SD")) { 87 return "sd"; 88 } 89 // generic default 90 return "disk"; 79 91 } 80 92 … … 101 113 path = path.substring(0, slashIndex); 102 114 } 103 System.out.println("..: " + path);104 115 } else { 105 116 path = path == null ? selected : path + selected; 106 System.out.println(selected + ": " + path);107 117 } 108 118 updateContent();
Note: See TracChangeset
for help on using the changeset viewer.