com.sqlapp.graphviz.labeltable.TrElement Maven / Gradle / Ivy
/**
* Copyright (C) 2007-2017 Tatsuo Satoh
*
* This file is part of sqlapp-graphviz.
*
* sqlapp-graphviz is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sqlapp-graphviz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with sqlapp-graphviz. If not, see .
*/
package com.sqlapp.graphviz.labeltable;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import javax.xml.stream.XMLStreamException;
import com.sqlapp.util.StaxWriter;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Accessors(chain=true)
@Getter
@Setter
@EqualsAndHashCode(callSuper=true)
public class TrElement extends AbstractHtmlElement{
private List cells=new ArrayList<>();
protected String getElementName(){
return "tr";
}
public TrElement addCell(Consumer c){
TdElement element=new TdElement();
element.setParent(this);
this.cells.add(element);
c.accept(element);
return instance();
}
public TrElement addCell(int index, Consumer c){
TdElement element=new TdElement();
element.setParent(this);
this.cells.add(index, element);
c.accept(element);
return instance();
}
public TrElement addCells(BiConsumer c, int cellSize){
for(int i=0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy