这是FXML:
<TableView fx:id="tvETLTransformationFiles" prefHeight="200.0" prefWidth="780.0">
<columns>
<TableColumn editable="false" prefWidth="75.0" text="File Name">
<cellValueFactory>
<PropertyValueFactory property="fileName" />
</cellValueFactory>
</TableColumn>
<TableColumn editable="false" prefWidth="75.0" text="ETL Stage">
<cellValueFactory>
<PropertyValueFactory property="etlStage" />
</cellValueFactory>
</TableColumn>
</columns>
</TableView>
而且我有知道如何进行双击的逻辑:
public void someControl_OnClick(MouseEvent event) {
if (event.getButton() == MouseButton.PRIMARY) {
int clickCount = 0;
clickCount = event.getClickCount();
if (clickCount == 2) { // It's a double click!
// do something
}
}
}
现在,如何在事件处理程序中引用单元格?是否将fx:id标记添加到TableColumn或cellValueProperty?