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

Print this page

        

@@ -22,14 +22,14 @@
  * 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 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,10 +52,11 @@
 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,11 +192,12 @@
 
             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();
+            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,11 +628,11 @@
                     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,10 +651,11 @@
                                         }
                                     };
                                 }
                             };
                         }
+*/
                     });
                 }
             });
 
             return replaceButton;

@@ -705,12 +708,15 @@
             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 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,12 +726,16 @@
             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 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,15 +747,12 @@
         }
 
         private VBox setEventHandlersHBox() {
             VBox vb = new VBox();
 
-            Button btn = ButtonBuilder.create()
-                    .text("Set onEdit event hadlers")
-                    .id(BTN_SET_ON_EDIT_EVENT_HANDLERS)
-                    .build();
-
+            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,15 +785,12 @@
                         assertTrue(eventHandlerOnEditCancel == col.getOnEditCancel());
                     }
                 }
             });
 
-            Button btnAddFactory = ButtonBuilder.create()
-                    .text("Set cell factory for editing")
-                    .id(SET_CELL_FACTORY_FOR_EDITING)
-                    .build();
-
+            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());