add type column
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 14 May 2008 22:05:45 +0000 (22:05 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 14 May 2008 22:05:45 +0000 (22:05 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@885 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/jsite/gui/RequestTableModel.java

index c238cb1..1c37437 100644 (file)
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
 import javax.swing.table.AbstractTableModel;
 
 import net.pterodactylus.jsite.core.Request;
+import net.pterodactylus.jsite.core.Request.Type;
 import net.pterodactylus.util.logging.Logging;
 
 /**
@@ -46,7 +47,7 @@ public class RequestTableModel extends AbstractTableModel implements PropertyCha
        private static final Logger logger = Logging.getLogger(RequestTableModel.class.getName());
 
        /** The column names. */
-       private static final String[] COLUMN_NAMES = new String[] { "ID", "Progress" };
+       private static final String[] COLUMN_NAMES = new String[] { "ID", "Progress", "Type" };
 
        /** The requests. */
        private final List<Request> requests = Collections.synchronizedList(new ArrayList<Request>());
@@ -121,6 +122,8 @@ public class RequestTableModel extends AbstractTableModel implements PropertyCha
                                        return "unknown";
                                }
                                return String.valueOf((request.getSuccessfulBlocks() * 10000 / request.getRequiredBlocks()) / 100.0) + "%";
+                       case 2:
+                               return ((request.getType() != null) ? request.getType() : Type.unknown).name();
                }
                return null;
        }