示例#1
0
  /** Prepares the cell for editing */
  @Override
  public void startEdit() {
    super.startEdit();

    if (textField == null) {
      createTextField();
    }
    setText(null);
    setGraphic(textField);
    textField.setText(getString());
    textField.selectAll();
  }
 @Override
 public void startEdit() {
   super.startEdit();
   if (textField == null) {
     createTextField();
   }
   setGraphic(textField);
   setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
   Platform.runLater(
       new Runnable() {
         @Override
         public void run() {
           textField.selectAll();
           textField.requestFocus();
         }
       });
 }
示例#3
0
  private void updateEditing() {
    if (getIndex() == -1 || getTableView() == null) return;

    TablePosition editCell = getTableView().getEditingCell();
    boolean match = match(editCell);

    if (match && !isEditing()) {
      startEdit();
    } else if (!match && isEditing()) {
      // If my index is not the one being edited then I need to cancel
      // the edit. The tricky thing here is that as part of this call
      // I cannot end up calling list.edit(-1) the way that the standard
      // cancelEdit method would do. Yet, I need to call cancelEdit
      // so that subclasses which override cancelEdit can execute. So,
      // I have to use a kind of hacky flag workaround.
      updateEditingIndex = false;
      cancelEdit();
      updateEditingIndex = true;
    }
  }
示例#4
0
 @Override
 public void startEdit() {
   if (!isEmpty()) {
     super.startEdit();
   }
 }