table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent event) {
int row = table.getSelectedRow();
if( row != -1 )
{
SVNLogEntrada logEntrada = (SVNLogEntrada)table.getModel().getValueAt(//
table.convertRowIndexToModel(row)//
, table.getModel().getColumnCount());
fireEntradaSeleccionada(logEntrada);
// panelRevisionFicheros.setLogEntrada( logEntrada );
// mensaje.setText(logEntrada.getMensaje());
if( event.getButton() == MouseEvent.BUTTON3 ) {
}
}
}
public void mouseReleased(MouseEvent e) {
Point pt = e.getPoint();
int row = table.rowAtPoint(e.getPoint());
row = table.convertRowIndexToModel( row );
if( row != -1 ) {
SVNLogEntrada logEntrada = ((SVNRevisionTableModel)table.getModel()).getEntrada(row);
if (logEntrada != null) {
if (e.getButton() == MouseEvent.BUTTON3) {
JPopupMenu popup = SVNMenuPopupConstructor.getPopupMenu(logEntrada, controlador, null);
popup.show(table, pt.x, pt.y);
}
}
}
}
});
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent arg0) {
if( table.getSelectedRow() != -1 )
{
SVNLogEntrada logEntrada = (SVNLogEntrada)table.getModel().getValueAt( //
table.convertRowIndexToModel(table.getSelectedRow()) //
, table.getModel().getColumnCount());
fireEntradaSeleccionada(logEntrada);
// panelRevisionFicheros.setLogEntrada( logEntrada );