gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFTextRun.setText()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 08:33:05 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextRun.setText()方法的一些代码示例,展示了XSLFTextRun.setText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFTextRun.setText()方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFTextRun
类名称:XSLFTextRun
方法名:setText

XSLFTextRun.setText介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

run.setText(runText);
if (otherRPr != null) {
  run.getRPr(true).set(otherRPr);

代码示例来源:origin: stackoverflow.com

XSLFTextRun run1 = p.addNewTextRun(); 
   run1.setText("This is test"); 
   run1.setFontFamily(HSSFFont.FONT_ARIAL);
   run1.setFontColor(Color.red);    
   run1.setFontSize(24);

代码示例来源:origin: stackoverflow.com

XSLFTableRow headerRow = table.addRow();
 for(int i = 0; i < 3; i++) {
   XSLFTableCell th = headerRow.addCell();
   XSLFTextParagraph p = th.addNewTextParagraph();
   XSLFTextRun r = p.addNewTextRun();
   r.setText("Text");
 }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public void setText(String text){
  clearText();
  addNewTextParagraph().addNewTextRun().setText(text);
}

代码示例来源:origin: stackoverflow.com

par.setTextAlign(TextAlign.CENTER);
XSLFTextRun run = par.addNewTextRun();
run.setText("unicode ->\u30B4\u30DF\u7BB1<-");
run.setFontFamily("GE Inspira");
run.setFontSize(12.0);

代码示例来源:origin: stackoverflow.com

XSLFTableRow titleRow = tbl.addRow();
titleRow.setHeight(50);
XSLFTableCell titleCell1 = titleRow.addCell();
XSLFTextParagraph p1 = titleCell1.addNewTextParagraph();
p1.setTextAlign(TextAlign.CENTER);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Column title");
r1.setBold(true);
r1.setFontColor(new Color(0, 104, 145));
titleCell1.setFillColor(new Color(190, 230, 245));
r1.setFontSize(25.0);
titleCell1.setVerticalAlignment(VerticalAlignment.MIDDLE);

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 *  ensure that the paragraph contains at least one character.
 *  We need this trick to correctly measure text
 */
private void ensureNotEmpty(){
  XSLFTextRun r = addNewTextRun();
  r.setText(" ");
  CTTextCharacterProperties endPr = _p.getEndParaRPr();
  if(endPr != null) {
    if(endPr.isSetSz()) r.setFontSize(endPr.getSz() / 100);
  }
}

代码示例来源:origin: stackoverflow.com

par.setTextAlign(TextAlign.CENTER);
XSLFTextRun run = par.addNewTextRun();
run.setText("/\u02CCin\u0259\u02C8v\u0101SH\u0259n/");
run.setFontFamily("DejaVu Serif");
run.setFontSize(12);
par.addLineBreak();
run = par.addNewTextRun();
run.setText("/\u02CCin\u0259\u02C8v\u0101SH\u0259n/");
run.setFontFamily("GE Inspira");
run.setFontSize(12);

代码示例来源:origin: stackoverflow.com

XSLFTextParagraph p = textShape.addNewTextParagraph();
XSLFTextRun r1 = p.addNewTextRun();
r1.setText("The");
r1.setFontColor(Color.blue);
r1.setFontSize(24.);

代码示例来源:origin: org.apache.poi/poi-examples

public static void main(String[] args) throws IOException{
    try (XMLSlideShow ppt = new XMLSlideShow()) {
      XSLFSlide slide1 = ppt.createSlide();
      XSLFSlide slide2 = ppt.createSlide();

      XSLFTextBox shape1 = slide1.createTextBox();
      shape1.setAnchor(new Rectangle(50, 50, 200, 50));
      XSLFTextRun r1 = shape1.addNewTextParagraph().addNewTextRun();
      XSLFHyperlink link1 = r1.createHyperlink();
      r1.setText("http://poi.apache.org"); // visible text
      link1.setAddress("http://poi.apache.org");  // link address

      XSLFTextBox shape2 = slide1.createTextBox();
      shape2.setAnchor(new Rectangle(300, 50, 200, 50));
      XSLFTextRun r2 = shape2.addNewTextParagraph().addNewTextRun();
      XSLFHyperlink link2 = r2.createHyperlink();
      r2.setText("Go to the second slide"); // visible text
      link2.linkToSlide(slide2);  // link address

      try (FileOutputStream out = new FileOutputStream("hyperlinks.pptx")) {
        ppt.write(out);
      }
    }
  }
}

代码示例来源:origin: org.apache.poi/poi-examples

body2.addNewTextParagraph().addNewTextRun().setText("First paragraph");
body2.addNewTextParagraph().addNewTextRun().setText("Second paragraph");
body2.addNewTextParagraph().addNewTextRun().setText("Third paragraph");

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

run.setText(runText);
if (otherRPr != null) {
  run.getRPr(true).set(otherRPr);

代码示例来源:origin: org.apache.poi/poi-examples

r1.setText("Paragraph Formatting");
r1.setFontSize(24d);
r1.setFontColor(new Color(85, 142, 213));
p2.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Paragraph  properties apply to all text residing within the corresponding paragraph.");
r2.setFontSize(16d);
r3.setText("Run Formatting");
r3.setFontSize(24d);
r3.setFontColor(new Color(85, 142, 213));
XSLFTextRun r4 = p4.addNewTextRun();
r4.setFontSize(16d);
r4.setText(
    "Run level formatting is the most granular property level and allows " +
        "for the specifying of all low level text properties. The text run is " +

代码示例来源:origin: org.apache.poi/poi-examples

p1.setBullet(true);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Bullet1");
p2.setIndentLevel(1);
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Bullet2");
p3.setIndentLevel(2);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Numbered List Item - 1");
p4.setIndentLevel(2);
XSLFTextRun r4 = p4.addNewTextRun();
r4.setText("Numbered List Item - 2");
p5.setIndentLevel(2);
XSLFTextRun r5 = p5.addNewTextRun();
r5.setText("Numbered List Item - 3");

代码示例来源:origin: org.apache.poi/poi-examples

XSLFTextParagraph p1 = bodyPlaceholder.addNewTextParagraph();
p1.setIndentLevel(0);
p1.addNewTextRun().setText("Level1 text");
XSLFTextParagraph p2 = bodyPlaceholder.addNewTextParagraph();
p2.setIndentLevel(1);
p2.addNewTextRun().setText("Level2 text");
XSLFTextParagraph p3 = bodyPlaceholder.addNewTextParagraph();
p3.setIndentLevel(2);
p3.addNewTextRun().setText("Level3 text");

代码示例来源:origin: org.apache.poi/poi-examples

p.setTextAlign(TextAlign.CENTER);
XSLFTextRun r = p.addNewTextRun();
r.setText("Header " + (i + 1));
r.setBold(true);
r.setFontColor(Color.white);
  XSLFTextRun r = p.addNewTextRun();
  r.setText("Cell " + (i + 1));
  if (rownum % 2 == 0)
    cell.setFillColor(new Color(208, 216, 232));

代码示例来源:origin: stackoverflow.com

Color fontColor = null;
String fontFamily = null;
double fontSize = 0.0;
boolean italic = false;
boolean bold = false;
boolean underline = false;
for (XSLFTextParagraph paragraph : autoShape.getTextParagraphs()) {
  for (XSLFTextRun text : paragraph.getTextRuns()) {
    fontColor = text.getFontColor();
    fontFamily = text.getFontFamily();
    fontSize = text.getFontSize();
    italic = text.isItalic();
    bold = text.isBold();
    underline = text.isUnderline();
  }
}
autoShape.clearText();
XSLFTextParagraph addNewTextParagraph = autoShape.addNewTextParagraph();

XSLFTextRun addNewTextRun = addNewTextParagraph.addNewTextRun();
addNewTextRun.setText(values.get(0)[1]);
addNewTextRun.setFontColor(fontColor);
addNewTextRun.setFontFamily(fontFamily);
addNewTextRun.setFontSize(fontSize);
addNewTextRun.setItalic(italic);
addNewTextRun.setBold(bold);
addNewTextRun.setUnderline(underline);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com