title: javafx tableview how to get the row I clicked?
body: <p>here is my code</p>
  
  <pre><code>// this event is attached to TableCell
  public EventHandler dblclickDescription = new EventHandler&lt;MouseEvent&gt;(){
      @Override
      public void handle(MouseEvent event) {
          if(event.getButton().equals(MouseButton.PRIMARY)){
              if(event.getClickCount() == 2){
                  printRow(event.getTarget());
              }
          }
          event.consume();
      }
  };
  
  // print row
  public void printRow(Object o){
      Text text = (Text) o;
  
      // ??? don't know what to write here
  
     System.out.println(row.toString());
  }
  </code></pre>
  
  <p>1) how do I get from the cell I clicked to the row?</p>
  
  <p>2) can I attach the event to the whole row instead of each column?</p>
  
  <p>EDIT:
  3) I thought that I attached the event on <code>TableCell</code></p>
  
  <pre><code>TableCell cell = TableColumn.DEFAULT_CELL_FACTORY.call(p);
  cell.setOnMouseClicked(dblclickDescription);
  </code></pre>
  
  <p>but when I tested, </p>
  
  <pre><code>event.getSource();// is a TableColumn
  event.getTarget();// is a Text if clicked on text
  event.getTarget();// is a TableColumn if clicked on empty space, even if that cell has text
  </code></pre>
  
  <p>is there a way to get <code>TableCell</code> from <code>MouseEvent</code>?</p>