< prev index next >

src/com/sun/javatest/exec/ExcludeListBrowser.java

Print this page




 273     private static final int SYNOPSIS_COL = 4;
 274     private static final int COLUMN_COUNT = 5;
 275 
 276     private String[] columnNames;
 277 
 278     private class ExcludeListTableModel implements TableModel
 279     {
 280         ExcludeListTableModel(ExcludeList list) {
 281             if (columnNames == null) {
 282                 columnNames = new String[COLUMN_COUNT];
 283                 columnNames[TEST_NAME_COL] = uif.getI18NString("elb.col.testName");
 284                 columnNames[TEST_CASE_COL] = uif.getI18NString("elb.col.testCase");
 285                 columnNames[BUG_COL] = uif.getI18NString("elb.col.bugId");
 286                 columnNames[KEYWORDS_COL] = uif.getI18NString("elb.col.keywords");
 287                 columnNames[SYNOPSIS_COL] = uif.getI18NString("elb.col.synopsis");
 288             }
 289 
 290             // The following operation is slow and should arguably be
 291             // done by a worker thread, perhaps using the nested List class as
 292             // a Runnable.
 293             SortedSet sortedEntries = new TreeSet(new Comparator() {
 294                     public int compare(Object o1, Object o2) {
 295                         String s1 = entryToString((ExcludeList.Entry)o1);
 296                         String s2 = entryToString((ExcludeList.Entry)o2);
 297                         return s1.compareTo(s2);
 298                     }
 299                 });
 300 
 301             if (list != null) {
 302                 for (Iterator iter = list.getIterator(false); iter.hasNext(); ) {
 303                     ExcludeList.Entry ee = (ExcludeList.Entry) (iter.next());
 304                     sortedEntries.add(ee);
 305                 }
 306             }
 307 
 308             entries = new ExcludeList.Entry[sortedEntries.size()];
 309             sortedEntries.toArray(entries);
 310         }
 311 
 312         ExcludeList.Entry getEntry(int index) {
 313             return (index < 0 || index >= entries.length ? null : entries[index]);
 314         }
 315 
 316         public void addTableModelListener(TableModelListener l) {




 273     private static final int SYNOPSIS_COL = 4;
 274     private static final int COLUMN_COUNT = 5;
 275 
 276     private String[] columnNames;
 277 
 278     private class ExcludeListTableModel implements TableModel
 279     {
 280         ExcludeListTableModel(ExcludeList list) {
 281             if (columnNames == null) {
 282                 columnNames = new String[COLUMN_COUNT];
 283                 columnNames[TEST_NAME_COL] = uif.getI18NString("elb.col.testName");
 284                 columnNames[TEST_CASE_COL] = uif.getI18NString("elb.col.testCase");
 285                 columnNames[BUG_COL] = uif.getI18NString("elb.col.bugId");
 286                 columnNames[KEYWORDS_COL] = uif.getI18NString("elb.col.keywords");
 287                 columnNames[SYNOPSIS_COL] = uif.getI18NString("elb.col.synopsis");
 288             }
 289 
 290             // The following operation is slow and should arguably be
 291             // done by a worker thread, perhaps using the nested List class as
 292             // a Runnable.
 293             SortedSet<ExcludeList.Entry> sortedEntries = new TreeSet<>(new Comparator<ExcludeList.Entry>() {
 294                     public int compare(ExcludeList.Entry o1, ExcludeList.Entry o2) {
 295                         String s1 = entryToString(o1);
 296                         String s2 = entryToString(o2);
 297                         return s1.compareTo(s2);
 298                     }
 299                 });
 300 
 301             if (list != null) {
 302                 for (Iterator iter = list.getIterator(false); iter.hasNext(); ) {
 303                     ExcludeList.Entry ee = (ExcludeList.Entry) (iter.next());
 304                     sortedEntries.add(ee);
 305                 }
 306             }
 307 
 308             entries = new ExcludeList.Entry[sortedEntries.size()];
 309             sortedEntries.toArray(entries);
 310         }
 311 
 312         ExcludeList.Entry getEntry(int index) {
 313             return (index < 0 || index >= entries.length ? null : entries[index]);
 314         }
 315 
 316         public void addTableModelListener(TableModelListener l) {


< prev index next >