this.add(txtNote, gbc_txtNote);
}
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
HistoryReference ref = (HistoryReference) value;
txtId.setText(Integer.toString(ref.getHistoryId()));
Color markedBgColor = new Color(200,100,120);
Color markedFgColor = new Color(255,255,255);
final ImageIcon tag_standard = new ImageIcon(getClass().getResource("/resource/icons/tag_gray.png"));
final ImageIcon tag_highRisk = new ImageIcon(getClass().getResource("/resource/icons/flag_red.png"));
final ImageIcon tag_mediumRisk = new ImageIcon(getClass().getResource("/resource/icons/flag_orange.png"));
final ImageIcon tag_lowRisk = new ImageIcon(getClass().getResource("/resource/icons/flag_yellow.png"));
final ImageIcon tag_infoRisk = new ImageIcon(getClass().getResource("/resource/icons/flag_blue.png"));
boolean isMarked = false;
HttpMessage msg = new HttpMessage();
try {
msg = ref.getHttpMessage();
txtMethod.setText(msg.getRequestHeader().getMethod());
txtURI.setText(msg.getRequestHeader().getURI().toString());
txtStatus.setText(Integer.toString(msg.getResponseHeader().getStatusCode()));
txtReason.setText(msg.getResponseHeader().getReasonPhrase());
txtRTT.setText(msg.getTimeElapsedMillis() + "ms");
String date = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").format(new Date (msg.getTimeSentMillis()));
txtTimestamp.setText(date);
// ZAP: Support for multiple tags
StringBuffer sb = new StringBuffer();
for (String tag : msg.getTags()) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(tag);
}
txtTag.setText(sb.toString());
// Andiparos: Message marking
isMarked = msg.getFlag();
// ZAP: Alert flagging
if (ref.getAlerts().size() > 0) {
switch (ref.getHighestAlert()) {
case Alert.RISK_INFO:
txtFlag.setIcon(tag_infoRisk);
break;
case Alert.RISK_LOW:
txtFlag.setIcon(tag_lowRisk);