diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-05-02 12:07:36 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-05-02 12:07:36 +0100 |
| commit | 90680b0208bba24a970f8b7fd6f9092f5ca90407 (patch) | |
| tree | 4feeae49e3e130ce09c19e9b50ec8a28b6bd5ba8 /src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java | |
| parent | 3de728c3d0fecbb3fa3e9b8019941cb51a3d2867 (diff) | |
Read colspan for table cells
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java')
| -rw-r--r-- | src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java b/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java index 3048acd..04d8aef 100644 --- a/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java +++ b/src/test/java/org/zwobble/mammoth/tests/documents/DocumentElementMakers.java @@ -22,6 +22,7 @@ public class DocumentElementMakers { public static final Property<Run, Boolean> STRIKETHROUGH = newProperty(); public static final Property<Run, VerticalAlignment> VERTICAL_ALIGNMENT = newProperty(); public static final Property<HasChildren, List<DocumentElement>> CHILDREN = newProperty(); + public static final Property<TableCell, Integer> COLSPAN = newProperty(); public static final Instantiator<Paragraph> PARAGRAPH = propertyLookup -> new Paragraph( @@ -39,6 +40,15 @@ public class DocumentElementMakers { propertyLookup.valueOf(STYLE, Optional.empty()), propertyLookup.valueOf(CHILDREN, list())); + public static final Instantiator<TableCell> TABLE_CELL = + propertyLookup -> new TableCell( + propertyLookup.valueOf(COLSPAN, 1), + propertyLookup.valueOf(CHILDREN, list())); + + public static TableCell tableCell(List<DocumentElement> children) { + return make(a(TABLE_CELL, with(CHILDREN, children))); + } + public static Paragraph paragraphWithText(String text) { return make(a(PARAGRAPH, with(CHILDREN, list(runWithText(text))))); } |
