javafx.scene.control.TreeTableColumn.CellEditEvent Java Examples

The following examples show how to use javafx.scene.control.TreeTableColumn.CellEditEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChoiceBoxTreeTableSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private void updateObservableListProperties(TreeTableColumn<Employee, String> empColumn) {
    empColumn.setOnEditCommit(new EventHandler<TreeTableColumn.CellEditEvent<Employee, String>>() {

        @Override
        public void handle(CellEditEvent<Employee, String> t) {
            TreeItem<Employee> treeItem = t.getTreeTableView().getTreeItem(t.getTreeTablePosition().getRow());
            treeItem.getValue().setName(t.getNewValue());
        }
    });
}
 
Example #2
Source File: TextFieldTreeTableSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private void updateObservableListProperties(TreeTableColumn<Employee, String> empColumn) {
    empColumn.setOnEditCommit(new EventHandler<TreeTableColumn.CellEditEvent<Employee, String>>() {

        @Override
        public void handle(CellEditEvent<Employee, String> t) {
            TreeItem<Employee> treeItem = t.getTreeTableView().getTreeItem(t.getTreeTablePosition().getRow());
            treeItem.getValue().setName(t.getNewValue());
        }
    });
}
 
Example #3
Source File: ComboBoxTreeTableSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private void updateObservableListProperties(TreeTableColumn<Employee, String> empColumn) {
    empColumn.setOnEditCommit(new EventHandler<TreeTableColumn.CellEditEvent<Employee, String>>() {

        @Override
        public void handle(CellEditEvent<Employee, String> t) {
            TreeItem<Employee> treeItem = t.getTreeTableView().getTreeItem(t.getTreeTablePosition().getRow());
            treeItem.getValue().setName(t.getNewValue());
        }
    });
}
 
Example #4
Source File: Simulator.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Updates an integer register.
 *
 * @param e cell edit event
 */
private void updateXReg(CellEditEvent<RegisterItem, String> e) {
  try {
    program.getState().xregfile().setRegister("x" + e.getTreeTablePosition().getRow(), Data.atoi(e.getNewValue()));
  } catch (NumberFormatException ex) {
    rviTable.refresh();
    mainController.toast(String.format("Invalid register value: %s", e.getNewValue()), 3000);
  }
}
 
Example #5
Source File: Simulator.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Updates a float register.
 *
 * @param e cell edit event
 */
private void updateFReg(CellEditEvent<RegisterItem, String> e) {
  try {
    program.getState().fregfile().setRegister("f" + e.getTreeTablePosition().getRow(), Data.atof(e.getNewValue()));
  } catch (NumberFormatException ex) {
    rvfTable.refresh();
    mainController.toast(String.format("Invalid register value: %s", e.getNewValue()), 3000);
  }
}
 
Example #6
Source File: Simulator.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Updates a memory byte.
 *
 * @param e cell edit event
 * @param offset byte offset
 */
private void updateMemory(CellEditEvent<MemoryItem, String> e, int offset) {
  try {
    int addr = START - e.getTreeTablePosition().getRow() * Data.WORD_LENGTH + offset;
    program.getState().memory().store(addr, Data.atoi(e.getNewValue()));
  } catch (NumberFormatException ex) {
    memoryTable.refresh();
    mainController.toast(String.format("Invalid byte value: %s", e.getNewValue()), 3000);
  }
}