I have created a custom tablecell that changes to edit mode clicking by an option menu over that cell and doesnt change to read only view until the save button is pclicked. Now I have included that process in a thread to change the cursor to wait and not change to normal until it is finished. My problem is the cursor doesnt stay in waiting mode in all the view, if I am moving the cursor over any cell in edit mode the cursor changes to write mode instead of staying the waiting cursor. If anyone could help me, thanks in advance.
btSave.setOnAction((event) -> {
final Task task = new Task<Void>() {
@Override
protected Void call() throws InterruptedException {
try {
root.setCursor(Cursor.WAIT);
Set<Node> cells = table.lookupAll(".table-cell");
for (Node node : cells) {
TableCell<?, ?> cell = (TableCell<?, ?>) node;
if (cell.getGraphic() instanceof TextField) {
cell.getGraphic().setCursor(Cursor.WAIT);
}
}
int first = GuiUtil.getIndexToScroll(tvKontiMonths);
DataBean dataBean = new DataBean(table.getItems(),
results.isLevel());
Map<String, Boolean> listUpdates = (Map<String, Boolean>) DataProvider.getInstance()
.updateData(dataBean);
table.setCursor(Cursor.DEFAULT);
root.setCursor(Cursor.DEFAULT);
resetEditProperties();
refreshWithManualCells(listUpdates);
tvKontiMonths.scrollTo(first);
tvKonti.scrollTo(first);
} catch (Exception e) {
}
return null;
}
};
new Thread(task).start();
});