}
public void refreshComments() {
Charset latin1 = Charset.forName("ISO-8859-1");
CharsetDecoder decoder = null;
if (latin1 != null)
decoder = latin1.newDecoder();
ImageIcon hostIcon = _map.getIcon_Vertex(_h.getName()).getOriginal();
if (hostIcon != null) {
jLblHostImage.setIcon(hostIcon);
}
TableColumn col = jTableComments.getColumnModel().getColumn(0);
col.setPreferredWidth(30);
col = jTableComments.getColumnModel().getColumn(3);
col.setPreferredWidth(70);
col = jTableComments.getColumnModel().getColumn(2);
col.setPreferredWidth(50);
if (_h != null) {
_hcomments = _map.getHostComments(_h.getName());
if (_hcomments != null) {
DefaultTableModel model = (DefaultTableModel)jTableComments.getModel();
// jTableComments.getColumn("Delete").setCellEditor(new DefaultCellEditor(jChkDeleteComment));
// jTableComments.getColumn("Delete").setCellRenderer(deleteCommentRenderer);
int rows = jTableComments.getRowCount();
int sindex = -1;
int eindex = -1;
for (int i = 0; i < rows; i++)
model.removeRow(0);
for (StatHostComment shc: _hcomments) {
sindex = -1;
eindex = -1;
Vector vector = new Vector();
vector.add(shc.getCommentId());
if (shc.getCommentData().toLowerCase().startsWith("issue <a href")) {
sindex = shc.getCommentData().indexOf("\">");
if (sindex > 0)
eindex = shc.getCommentData().indexOf("<", sindex);
if (sindex > 0 && eindex > sindex)
vector.add("Issue " + shc.getCommentData().substring(sindex + 2,eindex));
else {
if (decoder != null) {
try {
vector.add(decoder.decode(ByteBuffer.wrap(shc.getCommentData().getBytes())).toString());
} catch (CharacterCodingException ex) {
// let's not give up insert the comment data as is
vector.add(shc.getCommentData());
}
} else {
vector.add(shc.getCommentData());
System.out.println("adding default");
}
}
} else {
if (decoder != null) {
try {
vector.add(decoder.decode(ByteBuffer.wrap(shc.getCommentData().getBytes())).toString());
} catch (CharacterCodingException ex) {
// let's not give up insert the comment data as is
vector.add(shc.getCommentData());
}
} else {