< prev index next >

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

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 683                         TestResult.Section s = subpanelTest.getSection(sectIndex);
 684                         for (int i = 0; i < tocEntries.size(); i++) {
 685                             TOCEntry entry = tocEntries.get(i);
 686                             if (entry.getSection() == s) {
 687                                 // found match, select this entry
 688                                 toc.setSelectedIndex(i);
 689                                 return;
 690                             }
 691                         }
 692 
 693                     }
 694                     catch (TestResult.ReloadFault f) {
 695                         throw new JavaTestError("Error loading result file for " +
 696                                                 subpanelTest.getTestName());
 697                     }
 698                 }
 699             }
 700         }
 701 
 702         public void valueChanged(ListSelectionEvent e) {
 703             JList l = (JList) (e.getSource());
 704             TOCEntry entry = (TOCEntry) (l.getSelectedValue());
 705             if (entry == null)
 706                 return;
 707             titleField.setText(entry.getTitle());
 708             currentTOCEntry = entry.getID();
 709             String outputName = entry.getOutputName();
 710 
 711             if (entry.section == null) {
 712                 if (subpanelTest.getStatus().getType() == Status.NOT_RUN)
 713                     showHTML(createNotRunSummary());
 714                 else
 715                     showHTML(createStatusSummary());
 716             }
 717             else if (outputName != null)
 718                 showText(entry.getSection().getOutput(outputName));
 719             else if (entry.isScriptMessagesSection())
 720                 showHTML(createSummary());
 721             else
 722                 showHTML(createSectionSummary(entry.getSection()));
 723         }
 724     }


 860                 Status s = section.getStatus();
 861                 //return (s == null ? null : sectIcons[s.getType()]);
 862                 return (s == null ? null : IconFactory.getTestSectionIcon(s.getType()));
 863             }
 864         }
 865 
 866         String getID() {
 867             String s = "";
 868             if (section != null ) {
 869                 s = section.getTitle() + ":" +
 870                         (outputName == null ? "" : outputName);
 871             }
 872             return s;
 873         }
 874 
 875         private TestResult.Section section;
 876         private String outputName;  // null for section entry
 877     }
 878 
 879     private class TOCRenderer extends DefaultListCellRenderer {
 880         public Component getListCellRendererComponent(JList list,
 881                                                       Object value,
 882                                                       int index,
 883                                                       boolean isSelected,
 884                                                       boolean cellHasFocus) {
 885             JLabel l = (JLabel) super.getListCellRendererComponent(list, null, index,
 886                                                                    isSelected, cellHasFocus);
 887             if (value instanceof TOCEntry) {
 888                 TOCEntry e = (TOCEntry) value;
 889                 l.setText(e.getText());
 890                 l.setIcon(e.getIcon());
 891             }
 892             else
 893                 l.setText(value.toString());
 894             return l;
 895         }
 896     }
 897 
 898 
 899 }


 683                         TestResult.Section s = subpanelTest.getSection(sectIndex);
 684                         for (int i = 0; i < tocEntries.size(); i++) {
 685                             TOCEntry entry = tocEntries.get(i);
 686                             if (entry.getSection() == s) {
 687                                 // found match, select this entry
 688                                 toc.setSelectedIndex(i);
 689                                 return;
 690                             }
 691                         }
 692 
 693                     }
 694                     catch (TestResult.ReloadFault f) {
 695                         throw new JavaTestError("Error loading result file for " +
 696                                                 subpanelTest.getTestName());
 697                     }
 698                 }
 699             }
 700         }
 701 
 702         public void valueChanged(ListSelectionEvent e) {
 703             JList<TOCEntry> l = (JList<TOCEntry>) (e.getSource());
 704             TOCEntry entry = (l.getSelectedValue());
 705             if (entry == null)
 706                 return;
 707             titleField.setText(entry.getTitle());
 708             currentTOCEntry = entry.getID();
 709             String outputName = entry.getOutputName();
 710 
 711             if (entry.section == null) {
 712                 if (subpanelTest.getStatus().getType() == Status.NOT_RUN)
 713                     showHTML(createNotRunSummary());
 714                 else
 715                     showHTML(createStatusSummary());
 716             }
 717             else if (outputName != null)
 718                 showText(entry.getSection().getOutput(outputName));
 719             else if (entry.isScriptMessagesSection())
 720                 showHTML(createSummary());
 721             else
 722                 showHTML(createSectionSummary(entry.getSection()));
 723         }
 724     }


 860                 Status s = section.getStatus();
 861                 //return (s == null ? null : sectIcons[s.getType()]);
 862                 return (s == null ? null : IconFactory.getTestSectionIcon(s.getType()));
 863             }
 864         }
 865 
 866         String getID() {
 867             String s = "";
 868             if (section != null ) {
 869                 s = section.getTitle() + ":" +
 870                         (outputName == null ? "" : outputName);
 871             }
 872             return s;
 873         }
 874 
 875         private TestResult.Section section;
 876         private String outputName;  // null for section entry
 877     }
 878 
 879     private class TOCRenderer extends DefaultListCellRenderer {
 880         public Component getListCellRendererComponent(JList<?> list,
 881                                                       Object value,
 882                                                       int index,
 883                                                       boolean isSelected,
 884                                                       boolean cellHasFocus) {
 885             JLabel l = (JLabel) super.getListCellRendererComponent(list, null, index,
 886                                                                    isSelected, cellHasFocus);
 887             if (value instanceof TOCEntry) {
 888                 TOCEntry e = (TOCEntry) value;
 889                 l.setText(e.getText());
 890                 l.setIcon(e.getIcon());
 891             }
 892             else
 893                 l.setText(value.toString());
 894             return l;
 895         }
 896     }
 897 
 898 
 899 }
< prev index next >