Changeset 26


Ignore:
Timestamp:
07/27/07 18:46:04 (6 years ago)
Author:
saua
Message:
  • add icons
  • try to guess icons for Root
File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbtracker/trunk/src/org/bbtracker/mobile/gui/BrowseForm.java

    r7 r26  
    1313 
    1414import org.bbtracker.mobile.BBTracker; 
     15import org.bbtracker.mobile.IconManager; 
    1516 
    1617public class BrowseForm extends List implements CommandListener { 
     
    5051        private void updateContent() { 
    5152                deleteAll(); 
     53                final IconManager im = IconManager.getInstance(); 
    5254                setTitle(path == null ? title : path + " - " + title); 
    5355                if (path == null) { 
     
    5557                        while (roots.hasMoreElements()) { 
    5658                                final String root = (String) roots.nextElement(); 
    57                                 append(root, null); 
     59                                append(root, im.getListImage(getRootIconName(root))); 
    5860                        } 
    5961                } else { 
     
    6567                                } 
    6668                                append("<select this directory>", null); 
    67                                 append("..", null); 
     69                                append("..", im.getListImage("go-up")); 
    6870                                final Enumeration list = connection.list(); 
    6971                                while (list.hasMoreElements()) { 
    7072                                        final String element = (String) list.nextElement(); 
    7173                                        if (element.endsWith("/")) { 
    72                                                 append(element, null); 
     74                                                append(element, im.getListImage("folder")); 
    7375                                        } 
    7476                                } 
     
    7779                        } 
    7880                } 
     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"; 
    7991        } 
    8092 
     
    101113                                                path = path.substring(0, slashIndex); 
    102114                                        } 
    103                                         System.out.println("..: " + path); 
    104115                                } else { 
    105116                                        path = path == null ? selected : path + selected; 
    106                                         System.out.println(selected + ": " + path); 
    107117                                } 
    108118                                updateContent(); 
Note: See TracChangeset for help on using the changeset viewer.