private String testCaseSignatureHTML(Testable testCase) { return "<font color='blue'>" + geometrySignature(testCase.getGeometry(0)) + "</font>" + " :: " + "<font color='red'>" + geometrySignature(testCase.getGeometry(1)) + "</font>"; }
public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Testable testCase = (Testable) value; setText(testName(testCase)); setOpaque(true); setIcon(testCase.isPassed() ? tickIcon : (testCase.isFailed() ? crossIcon : clearIcon)); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); return this; }
private String testName(Testable testCase) { String name = testCase.getName(); if ((name == null || name.length() == 0) && testCase instanceof TestCaseEdit) { name = ((TestCaseEdit) testCase).getDescription(); } if (name == null || name.length() == 0) { name = ""; } int testSkey = 1 + JTSTestBuilderFrame.instance().getModel().getTestCases().indexOf(testCase); String nameFinal = "Test " + testSkey + " - " + testCaseSignatureHTML(testCase); if (name != "") nameFinal = nameFinal + " > " + name; return "<html>" + nameFinal + "<html>"; }