Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8089652

TableView: cannot start editing via keyboard initially

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • tbd
    • 8u60
    • javafx
    • 8u60b5, win 7

    Description

      At the very beginning after startup, we still can't start editing via keyboard, at least not by anything intuitive. All works as expected after having clicked once into a cell or (and this is the unintuitive part) having pressed ctrl-left/ctrl-right once.

      /**
       * Can't start editing via keyboard initially.
       * Left-over part of issue RT-38464
       *
       * To reproduce, run example
       * - press down (or any navigation key) to select a row
       * - press F2
       * - expected: editing started
       * - actual: nothing happens
       *
       */
      public class TableInitialCellEdit extends Application {
          
          ObservableList<MenuItem> data = FXCollections.observableArrayList(
                  new MenuItem("some"),
                  new MenuItem("dummy"),
                  new MenuItem("data")
                  );

          private Parent getContent() {
              TableView<MenuItem> table = new TableView<>(data);
              table.setEditable(true);
              TableColumn<MenuItem, String> text = new TableColumn<>("Text");
              text.setCellValueFactory(new PropertyValueFactory<>("text"));
              text.setCellFactory(TextFieldTableCell.forTableColumn());
              table.getColumns().addAll(text);
              return new BorderPane(table);
          }
          @Override
          public void start(Stage primaryStage) throws Exception {
              primaryStage.setScene(new Scene(getContent()));
              primaryStage.setTitle(VersionInfo.getRuntimeVersion());
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }

      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fastegal Jeanette Winzenburg
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Imported: