test_class.declarator: controller
test_class.modifier: private
test_class.original_string: private SettingsDialogController controller;
test_class.type: SettingsDialogController
test_class.var_name: controller
test_class.declarator: root
test_class.modifier: private
test_class.original_string: private Node root;
test_class.type: Node
test_class.var_name: root
test_class.file: app/src/test/java/edu/wpi/first/shuffleboard/app/prefs/SettingsDialogControllerTest.java
test_class.identifier: SettingsDialogControllerTest
test_class.superclass: extends ApplicationTest
test_case.body: @Test
    public void testSubCategories() {
      Category subA1 = Category.of("Sub A1");
      Category subA2 = Category.of("Sub A2", ImmutableList.of(subA1), ImmutableList.of());
      Category rootA = Category.of("Root A", ImmutableList.of(subA2), ImmutableList.of());
      Category rootB = Category.of("Root B", ImmutableList.of(subA1), ImmutableList.of());
  
      FxUtils.runOnFxThread(() -> controller.setRootCategories(ImmutableList.of(rootA, rootB)));
  
      waitForFxEvents();
  
      // Category Hierarchy
      //-------------------
      // Root A
      //  - Sub A2
      //    - Sub A1
      // Root B
      //  - Sub A1
  
      // Should be two children
      TreeView<Category> tree = lookup(".settings-categories").query();
      ObservableList<TreeItem<Category>> children = tree.getRoot().getChildren();
      assertEquals(2, children.size(), "Two children should be present");
      assertEquals(rootA, children.get(0).getValue());
      assertEquals(rootB, children.get(1).getValue());
  
      // Check first root child
      TreeItem<Category> rootAItem = children.get(0);
      assertEquals(1, rootAItem.getChildren().size());
      TreeItem<Category> subA2Item = rootAItem.getChildren().get(0);
      assertEquals(subA2, subA2Item.getValue());
      assertEquals(1, subA2Item.getChildren().size());
      assertEquals(subA1, subA2Item.getChildren().get(0).getValue());
  
      // Check second root child
      TreeItem<Category> rootBItem = children.get(1);
      assertEquals(1, rootBItem.getChildren().size());
      assertEquals(subA1, rootBItem.getChildren().get(0).getValue());
    }
test_case.class_method_signature: SettingsDialogControllerTest.testSubCategories()
test_case.full_signature: @Test public void testSubCategories()
test_case.identifier: testSubCategories
test_case.invocations: of of of of of of of of of of runOnFxThread setRootCategories of waitForFxEvents query lookup getChildren getRoot assertEquals size assertEquals getValue get assertEquals getValue get get assertEquals size getChildren get getChildren assertEquals getValue assertEquals size getChildren assertEquals getValue get getChildren get assertEquals size getChildren assertEquals getValue get getChildren
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSubCategories()
focal_class.declarator: root
focal_class.modifier: @FXML
    private
focal_class.original_string: @FXML
    private SplitPane root;
focal_class.type: SplitPane
focal_class.var_name: root
focal_class.declarator: categories
focal_class.modifier: @FXML
    private
focal_class.original_string: @FXML
    private TreeView<Category> categories;
focal_class.type: TreeView<Category>
focal_class.var_name: categories
focal_class.declarator: rootItem
focal_class.modifier: @FXML
    private
focal_class.original_string: @FXML
    private TreeItem<Category> rootItem;
focal_class.type: TreeItem<Category>
focal_class.var_name: rootItem
focal_class.declarator: view
focal_class.modifier: @FXML
    private
focal_class.original_string: @FXML
    private StackPane view;
focal_class.type: StackPane
focal_class.var_name: view
focal_class.file: app/src/main/java/edu/wpi/first/shuffleboard/app/prefs/SettingsDialogController.java
focal_class.identifier: SettingsDialogController
focal_class.class_method_signature: SettingsDialogController.initialize()
focal_class.full_signature: @FXML private void initialize()
focal_class.identifier: initialize
focal_class.modifiers: @FXML private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void initialize()
focal_class.class_method_signature: SettingsDialogController.setViewForCategory(Category category)
focal_class.full_signature: private void setViewForCategory(Category category)
focal_class.identifier: setViewForCategory
focal_class.modifiers: private
focal_class.parameters: (Category category)
focal_class.return: void
focal_class.signature: void setViewForCategory(Category category)
focal_class.class_method_signature: SettingsDialogController.setRootCategories(Collection<Category> rootCategories)
focal_class.full_signature: public void setRootCategories(Collection<Category> rootCategories)
focal_class.identifier: setRootCategories
focal_class.modifiers: public
focal_class.parameters: (Collection<Category> rootCategories)
focal_class.return: void
focal_class.signature: void setRootCategories(Collection<Category> rootCategories)
focal_class.class_method_signature: SettingsDialogController.addSubcategories(TreeItem<Category> rootItem)
focal_class.full_signature: private void addSubcategories(TreeItem<Category> rootItem)
focal_class.identifier: addSubcategories
focal_class.modifiers: private
focal_class.parameters: (TreeItem<Category> rootItem)
focal_class.return: void
focal_class.signature: void addSubcategories(TreeItem<Category> rootItem)
focal_class.class_method_signature: SettingsDialogController.applySettings()
focal_class.full_signature: public void applySettings()
focal_class.identifier: applySettings
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void applySettings()
focal_class.class_method_signature: SettingsDialogController.applySettings(TreeItem<Category> item)
focal_class.full_signature: private void applySettings(TreeItem<Category> item)
focal_class.identifier: applySettings
focal_class.modifiers: private
focal_class.parameters: (TreeItem<Category> item)
focal_class.return: void
focal_class.signature: void applySettings(TreeItem<Category> item)
focal_method.body: public void setRootCategories(Collection<Category> rootCategories) {
      rootItem.getChildren().clear();
      for (Category rootCategory : rootCategories) {
        TreeItem<Category> item = new TreeItem<>(rootCategory);
        addSubcategories(item);
        rootItem.getChildren().add(item);
      }
    }
focal_method.class_method_signature: SettingsDialogController.setRootCategories(Collection<Category> rootCategories)
focal_method.full_signature: public void setRootCategories(Collection<Category> rootCategories)
focal_method.identifier: setRootCategories
focal_method.invocations: clear getChildren addSubcategories add getChildren
focal_method.modifiers: public
focal_method.parameters: (Collection<Category> rootCategories)
focal_method.return: void
focal_method.signature: void setRootCategories(Collection<Category> rootCategories)