use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextTabStopList in project poi by apache.
the class XSLFTextParagraph method getTabStop.
public double getTabStop(final int idx) {
ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()) {
public boolean fetch(CTTextParagraphProperties props) {
if (props.isSetTabLst()) {
CTTextTabStopList tabStops = props.getTabLst();
if (idx < tabStops.sizeOfTabArray()) {
CTTextTabStop ts = tabStops.getTabArray(idx);
double val = Units.toPoints(ts.getPos());
setValue(val);
return true;
}
}
return false;
}
};
fetchParagraphProperty(fetcher);
return fetcher.getValue() == null ? 0. : fetcher.getValue();
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextTabStopList in project poi by apache.
the class XSLFTextParagraph method addTabStop.
public void addTabStop(double value) {
CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
CTTextTabStopList tabStops = pr.isSetTabLst() ? pr.getTabLst() : pr.addNewTabLst();
tabStops.addNewTab().setPos(Units.toEMU(value));
}
Aggregations