Accept literal group keys in DataGrid column FXML

This commit is contained in:
2026-11-25 13:30:55 +01:00
parent 9522ed90ce
commit 2625616b2f
3 changed files with 27 additions and 0 deletions
@@ -55,6 +55,22 @@ class DataGridFxmlTest {
</DataGrid>
""";
@Test
void groupLabelEntriesRetainLiteralKeysAlongsideMapAttributes() throws IOException {
String xml = """
<?import de.neitzel.fx.view.DataGridColumn?>
<DataGridColumn>
<groupLabels Post="Postfach"/>
<DataGridColumn.groupLabel><javafx.util.Pair key="/" value="Wurzel"/></DataGridColumn.groupLabel>
<DataGridColumn.groupLabel><javafx.util.Pair key="Post/Eingang" value="Eingang"/></DataGridColumn.groupLabel>
<DataGridColumn.groupLabel><javafx.util.Pair key="Ohne Endung" value="Sonstige"/></DataGridColumn.groupLabel>
</DataGridColumn>
""";
DataGridColumn column = new FXMLLoader().load(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
assertEquals(Map.of("Post", "Postfach", "/", "Wurzel", "Post/Eingang", "Eingang", "Ohne Endung", "Sonstige"),
column.getGroupLabels());
}
@Test
void loadsReusableTagAndCompletionControls() throws Exception {
DataGridTest.fx(() -> {