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 testSingleCategory() {
      Category category = Category.of("Category",
          Group.of("Group 1",
              Setting.of("Setting 1", new SimpleBooleanProperty()),
              Setting.of("Setting 2", new SimpleBooleanProperty())
          ),
          Group.of("Group 2",
              Setting.of("Setting 3", new SimpleDoubleProperty()),
              Setting.of("Setting 4", new SimpleDoubleProperty())
          )
      );
  
      FxUtils.runOnFxThread(() -> controller.setRootCategories(Collections.singleton(category)));
  
      waitForFxEvents();
  
      // Check the tree view - there should only be one item
      TreeView<Category> tree = lookup(".settings-categories").query();
      ObservableList<TreeItem<Category>> children = tree.getRoot().getChildren();
      assertEquals(1, children.size(), "Only one category should be present");
      assertEquals(category, children.get(0).getValue(), "Root category was wrong");
  
      // Check the property sheet
      PropertySheet propertySheet = (PropertySheet) root.lookup(".property-sheet");
      assertNotNull(propertySheet, "Property sheet for category was not added");
  
      // Check group headers
      Set<Label> headers = lookup(".h5").queryAll();
      assertAll("Check header text",
          () -> assertEquals("Group 1", Iterables.get(headers, 0).getText(), "Different first header text"),
          () -> assertEquals("Group 2", Iterables.get(headers, 1).getText(), "Different second header text")
      );
  
      // Check settings editors are present
      assertAll("Check presence of editors for the settings",
          () -> assertNotNull(lookup(TextMatchers.hasText("Setting 1")).query()),
          () -> assertNotNull(lookup(TextMatchers.hasText("Setting 2")).query()),
          () -> assertNotNull(lookup(TextMatchers.hasText("Setting 3")).query()),
          () -> assertNotNull(lookup(TextMatchers.hasText("Setting 4")).query())
      );
    }
test_case.class_method_signature: SettingsDialogControllerTest.testSingleCategory()
test_case.full_signature: @Test public void testSingleCategory()
test_case.identifier: testSingleCategory
test_case.invocations: of of of of of of of runOnFxThread setRootCategories singleton waitForFxEvents query lookup getChildren getRoot assertEquals size assertEquals getValue get lookup assertNotNull queryAll lookup assertAll assertEquals getText get assertEquals getText get assertAll assertNotNull query lookup hasText assertNotNull query lookup hasText assertNotNull query lookup hasText assertNotNull query lookup hasText
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSingleCategory()
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)