Examples of XWPFHyperlink


Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

       }

       boolean addedHREF = false;
       if(run instanceof XWPFHyperlinkRun) {
          XWPFHyperlinkRun linkRun = (XWPFHyperlinkRun)run;
          XWPFHyperlink link = linkRun.getHyperlink(document);
          if(link != null && link.getURL() != null) {
             xhtml.startElement("a", "href", link.getURL());
             addedHREF = true;
          } else if(linkRun.getAnchor() != null && linkRun.getAnchor().length() > 0) {
             xhtml.startElement("a", "href", "#" + linkRun.getAnchor());
             addedHREF = true;
          }
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

          }

          boolean addedHREF = false;
          if(run instanceof XWPFHyperlinkRun) {
             XWPFHyperlinkRun linkRun = (XWPFHyperlinkRun)run;
             XWPFHyperlink link = linkRun.getHyperlink(document);
             if(link != null && link.getURL() != null) {
                xhtml.startElement("a", "href", link.getURL());
                addedHREF = true;
             } else if(linkRun.getAnchor() != null && linkRun.getAnchor().length() > 0) {
                xhtml.startElement("a", "href", "#" + linkRun.getAnchor());
                addedHREF = true;
             }
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink


          for(IRunElement run : paragraph.getRuns()) {
              text.append(run.toString());
              if(run instanceof XWPFHyperlinkRun && fetchHyperlinks) {
                  XWPFHyperlink link = ((XWPFHyperlinkRun)run).getHyperlink(document);
                  if(link != null)
                      text.append(" <" + link.getURL() + ">");
              }
          }

          // Add comments
          XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink


          for(IRunElement run : paragraph.getRuns()) {
              text.append(run.toString());
              if(run instanceof XWPFHyperlinkRun && fetchHyperlinks) {
                  XWPFHyperlink link = ((XWPFHyperlinkRun)run).getHyperlink(document);
                  if(link != null)
                      text.append(" <" + link.getURL() + ">");
              }
          }

          // Add comments
          XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

       // Do the text
       for(XWPFRun run : paragraph.getRuns()) {
          List<String> tags = new ArrayList<String>();
          if(run instanceof XWPFHyperlinkRun) {
             XWPFHyperlinkRun linkRun = (XWPFHyperlinkRun)run;
             XWPFHyperlink link = linkRun.getHyperlink(document);
             if(link != null && link.getURL() != null) {
                xhtml.startElement("a", "href", link.getURL());
                tags.add("a");
             }
          }
          if(run.isBold()) {
             xhtml.startElement("b");
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink


          for(IRunElement run : paragraph.getRuns()) {
              text.append(run.toString());
              if(run instanceof XWPFHyperlinkRun && fetchHyperlinks) {
                  XWPFHyperlink link = ((XWPFHyperlinkRun)run).getHyperlink(document);
                  if(link != null)
                      text.append(" <" + link.getURL() + ">");
              }
          }

          // Add comments
          XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

    try  {
      Iterator <PackageRelationship> relIter =
        getCorePart().getRelationshipsByType(HYPERLINK_RELATION_TYPE).iterator();
      while(relIter.hasNext()) {
        PackageRelationship rel = relIter.next();
        hyperlinks.add(new XWPFHyperlink(rel.getId(), rel.getTargetURI().toString()));
      }
    } catch(Exception e) {
      throw new OpenXML4JException(e.getLocalizedMessage());
    }
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

  public XWPFHyperlink getHyperlinkByID(String id)
  {
    Iterator<XWPFHyperlink> iter = hyperlinks.iterator();
    while(iter.hasNext())
    {
      XWPFHyperlink link = iter.next();
      if(link.getId().equals(id))
        return link;
    }
   
    return null;
  }
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

        // Do the paragraph text
        for(XWPFRun run : paragraph.getRuns()) {
           text.append(run.toString());
           if(run instanceof XWPFHyperlinkRun && fetchHyperlinks) {
              XWPFHyperlink link = ((XWPFHyperlinkRun)run).getHyperlink(document);
              if(link != null)
                 text.append(" <" + link.getURL() + ">");
           }
        }

        // Add comments
        XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFHyperlink

    try  {
      Iterator <PackageRelationship> relIter =
        getCorePart().getRelationshipsByType(HYPERLINK_RELATION_TYPE).iterator();
      while(relIter.hasNext()) {
        PackageRelationship rel = relIter.next();
        hyperlinks.add(new XWPFHyperlink(rel.getId(), rel.getTargetURI().toString()));
      }
    } catch(Exception e) {
      throw new OpenXML4JException(e.getLocalizedMessage());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.