Edit single content slots, tab and split layouts, and grid setup declarations
This commit is contained in:
@@ -45,6 +45,28 @@ class FormDocumentTest {
|
||||
apply(doc.set(item, field, value == null ? "" : value, value == null));
|
||||
}
|
||||
|
||||
@Test
|
||||
void singleSlotsRespectReferencesAndDefaultTabContent() throws Exception {
|
||||
source =
|
||||
"""
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<BorderPane xmlns:fx="http://javafx.com/fxml/1" bottom="$footer">
|
||||
<center><TabPane fx:id="tabs"><Tab fx:id="first"><ScrollPane fx:id="scroll">
|
||||
<content><fx:include source="Other.fxml"/></content>
|
||||
</ScrollPane></Tab></TabPane></center>
|
||||
</BorderPane>
|
||||
""";
|
||||
add("Tab", "tabs", "tabs");
|
||||
assertThrows(IllegalArgumentException.class, () -> add("Label", "first", "content"));
|
||||
assertThrows(IllegalArgumentException.class, () -> add("Label", "scroll", "content"));
|
||||
assertThrows(IllegalArgumentException.class, () -> add("Label", "", "bottom"));
|
||||
assertThrows(IllegalArgumentException.class, () -> add("Label", "tabs", "tabs"));
|
||||
apply(doc().move(item("scroll"), slot("tab", "content"), 0));
|
||||
assertTrue(source.contains("<content><fx:include source=\"Other.fxml\"/></content>"));
|
||||
add("Label", "first", "content");
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyGridAndNamedListsKeepReferencesAndRejectCycles() throws Exception {
|
||||
assertEquals(
|
||||
|
||||
@@ -5,6 +5,25 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class GridDockDocumentTest {
|
||||
@Test
|
||||
void updatingOneGroupLabelRetainsReferencesCommentsAndNestedEntries() throws Exception {
|
||||
String source =
|
||||
"""
|
||||
<?import de.neitzel.fx.view.*?>
|
||||
<DataGrid><DataGridColumn id="folder" header="Folder"><groupLabels other="%localized" Post='old'>
|
||||
<!-- keep --><custom><Unknown/></custom></groupLabels></DataGridColumn></DataGrid>
|
||||
""";
|
||||
var doc = new GridDockDocument(source);
|
||||
var col = doc.branches(doc.roots().getFirst()).getFirst();
|
||||
assertEquals(
|
||||
source.replace("Post='old'", "Post='Post & Briefe'"),
|
||||
doc.xml.source.apply(doc.groupLabel(col, "Post", "Post & Briefe", false)));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class, () -> doc.groupLabel(col, "other", "changed", false));
|
||||
assertThrows(IllegalArgumentException.class, () -> doc.groupLabel(col, "custom", "", true));
|
||||
assertThrows(IllegalArgumentException.class, () -> doc.set(col, "fixedPosition", "2"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void implicitRowAttributeAndGroupingSurviveRename() throws Exception {
|
||||
var source =
|
||||
|
||||
Reference in New Issue
Block a user