functional/ControlsTests/src/javafx/scene/control/test/treetable/TreeTableNewApp.java

Print this page

        

*** 22,35 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package javafx.scene.control.test.treetable; ! import com.sun.javafx.scene.control.skin.NestedTableColumnHeader; ! import com.sun.javafx.scene.control.skin.TableColumnHeader; ! import com.sun.javafx.scene.control.skin.TableHeaderRow; ! import com.sun.javafx.scene.control.skin.TreeTableViewSkin; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.Map; --- 22,35 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package javafx.scene.control.test.treetable; ! import javafx.scene.control.skin.NestedTableColumnHeader; ! import javafx.scene.control.skin.TableColumnHeader; ! import javafx.scene.control.skin.TableHeaderRow; ! import javafx.scene.control.skin.TreeTableViewSkin; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.Map;
*** 52,61 **** --- 52,62 ---- import javafx.scene.control.TreeTableColumn.CellDataFeatures; import javafx.scene.control.cell.ChoiceBoxTreeTableCell; import javafx.scene.control.cell.ComboBoxTreeTableCell; import javafx.scene.control.cell.TextFieldTreeTableCell; import javafx.scene.control.test.tableview.NewTableViewApp; + import static javafx.scene.control.test.treetable.ResetButtonNames.HARD_RESET_BUTTON_ID; import javafx.scene.control.test.treeview.TreeViewConstants; import javafx.scene.control.test.utils.CommonPropertiesScene; import javafx.scene.control.test.utils.ComponentsFactory.MultipleIndexFormComponent; import javafx.scene.control.test.utils.ComponentsFactory.MultipleIndexFormComponent.MultipleIndicesAction; import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
*** 191,201 **** HBox hb = (HBox) getRoot(); hb.setPadding(new Insets(5, 5, 5, 5)); hb.setStyle("-fx-border-color : green;"); ! Button resetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Reset").build(); resetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { HBox hb = (HBox) getRoot(); hb.getChildren().clear(); prepareMainSceneStructure(); --- 192,203 ---- HBox hb = (HBox) getRoot(); hb.setPadding(new Insets(5, 5, 5, 5)); hb.setStyle("-fx-border-color : green;"); ! Button resetButton = new Button("Reset"); ! resetButton.setId(HARD_RESET_BUTTON_ID); resetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { HBox hb = (HBox) getRoot(); hb.getChildren().clear(); prepareMainSceneStructure();
*** 626,636 **** testedControl.setSkin(new TreeTableViewSkin(testedControl) { @Override public String toString() { return "CUSTOM " + super.toString(); } ! @Override protected TableHeaderRow createTableHeaderRow() { return new TableHeaderRow(this) { @Override protected NestedTableColumnHeader createRootHeader() { --- 628,638 ---- testedControl.setSkin(new TreeTableViewSkin(testedControl) { @Override public String toString() { return "CUSTOM " + super.toString(); } ! /* @Override protected TableHeaderRow createTableHeaderRow() { return new TableHeaderRow(this) { @Override protected NestedTableColumnHeader createRootHeader() {
*** 649,658 **** --- 651,661 ---- } }; } }; } + */ }); } }); return replaceButton;
*** 705,716 **** return vb; } private HBox getScrollToHBox() { HBox hb = new HBox(); ! Button button = ButtonBuilder.create().text("ScrollTo").id(SCROLL_TO_BUTTON_ID).build(); ! final TextField tf = TextFieldBuilder.create().text("0").id(SCROLL_TO_TEXT_FIELD_ID).prefWidth(50).build(); button.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { testedControl.scrollTo(Integer.parseInt(tf.getText())); } --- 708,722 ---- return vb; } private HBox getScrollToHBox() { HBox hb = new HBox(); ! Button button = new Button("ScrollTo"); ! button.setId(SCROLL_TO_BUTTON_ID); ! final TextField tf = new TextField("0"); ! tf.setId(SCROLL_TO_TEXT_FIELD_ID); ! tf.setPrefWidth(50); button.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { testedControl.scrollTo(Integer.parseInt(tf.getText())); }
*** 720,731 **** return hb; } private HBox getEditHBox() { HBox hb = new HBox(); ! Button button = ButtonBuilder.create().text("Edit").id(EDIT_BUTTON_ID).build(); ! final TextField tf = TextFieldBuilder.create().promptText("name").id(EDIT_TEXT_FIELD_ID).prefWidth(50).build(); button.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { throw new IllegalStateException("In build 101 was changed API of this function. Instead of 0, write index of edited treeItem please."); //testedControl.edit(0/* searchTreeItem(tf.getText()) */, (TreeTableColumn) testedControl.getColumns().get(0)); --- 726,741 ---- return hb; } private HBox getEditHBox() { HBox hb = new HBox(); ! Button button = new Button("Edit"); ! button.setId(EDIT_BUTTON_ID); ! final TextField tf = new TextField(); ! tf.setPromptText("name"); ! tf.setId(EDIT_TEXT_FIELD_ID); ! tf.setPrefWidth(50); button.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { throw new IllegalStateException("In build 101 was changed API of this function. Instead of 0, write index of edited treeItem please."); //testedControl.edit(0/* searchTreeItem(tf.getText()) */, (TreeTableColumn) testedControl.getColumns().get(0));
*** 737,751 **** } private VBox setEventHandlersHBox() { VBox vb = new VBox(); ! Button btn = ButtonBuilder.create() ! .text("Set onEdit event hadlers") ! .id(BTN_SET_ON_EDIT_EVENT_HANDLERS) ! .build(); ! btn.setOnAction(new EventHandler<ActionEvent>() { final EventHandler eventHandlerOnEditStart = new EventHandler() { public void handle(Event t) { tb.incrementCounter(COUNTER_EDIT_START); } --- 747,758 ---- } private VBox setEventHandlersHBox() { VBox vb = new VBox(); ! Button btn = new Button("Set onEdit event hadlers"); ! btn.setId(BTN_SET_ON_EDIT_EVENT_HANDLERS); btn.setOnAction(new EventHandler<ActionEvent>() { final EventHandler eventHandlerOnEditStart = new EventHandler() { public void handle(Event t) { tb.incrementCounter(COUNTER_EDIT_START); }
*** 778,792 **** assertTrue(eventHandlerOnEditCancel == col.getOnEditCancel()); } } }); ! Button btnAddFactory = ButtonBuilder.create() ! .text("Set cell factory for editing") ! .id(SET_CELL_FACTORY_FOR_EDITING) ! .build(); ! btnAddFactory.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { for (Object obj : testedControl.getColumns()) { TreeTableColumn col = (TreeTableColumn) obj; col.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn()); --- 785,796 ---- assertTrue(eventHandlerOnEditCancel == col.getOnEditCancel()); } } }); ! Button btnAddFactory = new Button("Set cell factory for editing"); ! btnAddFactory.setId(SET_CELL_FACTORY_FOR_EDITING); btnAddFactory.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { for (Object obj : testedControl.getColumns()) { TreeTableColumn col = (TreeTableColumn) obj; col.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());