this.tableViews.add(tableView);
if (tableView.getContextMenu()==null){
tableView.setContextMenu(new ContextMenu());
}
final MenuItem copyMenuItem = new MenuItem("copy table");
final MenuItem copyCellMenuItem = new MenuItem("copy cell");
fillContextMenu(tableView, copyMenuItem,copyCellMenuItem);
// tableView.contextMenuProperty().addListener(new ChangeListener<ContextMenu>() {
// @Override
// public void changed(ObservableValue<? extends ContextMenu> observable, ContextMenu oldValue, ContextMenu newValue) {
// if (newValue!=null){
// fillContextMenu(tableView, copyMenuItem,copyCellMenuItem);
// }
// }
// });
final CheckBox regExp = new CheckBox("RegExp");
HBox pane= new HBox();
BorderPane.setMargin(pane,new Insets(3));
pane.setSpacing(3);
pane.setAlignment(Pos.CENTER_LEFT);
Button copy = new Button("copy");
copy.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
copyTable(tableView);
}
});
copyMenuItem.setOnAction(copy.getOnAction());
pane.getChildren().add(copy);
Button copyCell = new Button("copy cell");
copyCell.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
copyTableCell(tableView);
}
});
copyCellMenuItem.setOnAction(copyCell.getOnAction());
pane.getChildren().add(copyCell);
pane.getChildren().add(new Label("Search"));
final TextField textField = new TextField();
textField.textProperty().addListener(new ChangeListener<String>() {
@Override