ru.curs.adocwrapper.block.table.Table.kt Maven / Gradle / Ivy
The newest version!
package ru.curs.adocwrapper.block.table
import ru.curs.adocwrapper.block.StructuralNode
open class Table : StructuralNode() {
private var tableRoles = ""
override fun toString(): String {
var returnString = "\n\n${getBlockMetaSyntax()}$tableRoles|===\n"
blocks.forEach {tableData -> returnString += tableData.toString() + "\n"}
returnString += "|===\n"
return returnString
}
fun td(init: TableData.() -> Unit): TableData {
val tData = TableData()
tData.apply(init)
this.blocks.add(tData)
return tData
}
@Deprecated("Use roles()")
fun role(vararg role: String) {
role.forEach { tableRoles += ".$it" }
tableRoles = "[$tableRoles]\n"
}
}