//
// Add/remove listeners for navigation control
if (document instanceof NavigableComponent) {
final NavigableComponent component = (NavigableComponent) document;
for (final ListSelectionListener listener : messageSelectionListeners) {
component.getListSelectionModel().addListSelectionListener(listener);
}
document.addDocumentComponentListener(new DocumentComponetListenerSupport() {
@Override
public void documentComponentClosed(DocumentComponentEvent arg0) {
for (final ListSelectionListener listener : messageSelectionListeners) {
component.getListSelectionModel().removeListSelectionListener(listener);
}
}
});
}