Tabnine Logo
CTHyperlink
Code IndexAdd Tabnine to your IDE (free)

How to use
CTHyperlink
in
org.openxmlformats.schemas.drawingml.x2006.main

Best Java code snippets using org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink (Showing top 20 results out of 315)

origin: org.apache.poi/poi-ooxml

  private void linkToRelativeSlide(String jump) {
    PackagePart thisPP = _sheet.getPackagePart();
    if (_link.isSetId() && !_link.getId().isEmpty()) {
      thisPP.removeRelationship(_link.getId());
    }
    _link.setId("");
    _link.setAction((jump.startsWith("ppaction") ? "" : "ppaction://hlinkshowjump?jump=") + jump);
  }
}
origin: org.apache.poi/poi-ooxml

@Override
public String getAddress() {
  final String id = _link.getId();
  if (id == null || id.isEmpty()) {
    return _link.getAction();
  }
  final PackageRelationship rel = _sheet.getPackagePart().getRelationship(id);
  if (rel == null) {
    return null;
  }
  final URI targetURI = rel.getTargetURI();
  return (targetURI == null) ? null : targetURI.toASCIIString();
}
origin: org.apache.poi/poi-ooxml

public Boolean getEndSound() {
  if (link.isSetEndSnd()) {
    return link.getEndSnd();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public Boolean getHistory() {
  if (link.isSetHistory()) {
    return link.getHistory();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public String getInvalidURL() {
  if (link.isSetInvalidUrl()) {
    return link.getInvalidUrl();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public String getTargetFrame() {
  if (link.isSetTgtFrame()) {
    return link.getTgtFrame();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

private void linkToExternal(String url) {
  PackagePart thisPP = _sheet.getPackagePart();
  if (_link.isSetId() && !_link.getId().isEmpty()) {
    thisPP.removeRelationship(_link.getId());
  }
  PackageRelationship rel = thisPP.addExternalRelationship(url, XSLFRelation.HYPERLINK.getRelation());
  _link.setId(rel.getId());
  if (_link.isSetAction()) {
    _link.unsetAction();
  }
}
origin: org.apache.poi/poi-ooxml

  break;
case DOCUMENT:
  final String idSrc = src._link.getId();
  if (idSrc == null || idSrc.isEmpty()) {
    if (pp != null) {
      RelationPart rp = _sheet.addRelation(null, XSLFRelation.SLIDE, pp);
      _link.setId(rp.getRelationship().getId());
      _link.setAction(src._link.getAction());
origin: apache/tika

private void extractHyperLinksFromShape(CTShape ctShape, XHTMLContentHandler xhtml) throws SAXException {
  if (ctShape == null)
    return;
  CTShapeNonVisual nvSpPR = ctShape.getNvSpPr();
  if (nvSpPR == null)
    return;
  CTNonVisualDrawingProps cNvPr = nvSpPR.getCNvPr();
  if (cNvPr == null)
    return;
  CTHyperlink ctHyperlink = cNvPr.getHlinkClick();
  if (ctHyperlink == null)
    return;
  String url = drawingHyperlinks.get(ctHyperlink.getId());
  if (url != null) {
    xhtml.startElement("a", "href", url);
    xhtml.characters(url);
    xhtml.endElement("a");
  }
  CTHyperlink ctHoverHyperlink = cNvPr.getHlinkHover();
  if (ctHoverHyperlink == null)
    return;
  url = drawingHyperlinks.get(ctHoverHyperlink.getId());
  if (url != null) {
    xhtml.startElement("a", "href", url);
    xhtml.characters(url);
    xhtml.endElement("a");
  }
}
origin: org.apache.poi/poi-ooxml

public String getId() {
  if (link.isSetId()) {
    return link.getId();
  } else {
    return null;
  }
}
origin: org.openl.rules/org.openl.lib.poi.dev

public void setAddress(XSLFSlide slide){
  XSLFSheet sheet = _r.getParentParagraph().getParentShape().getSheet();
  PackageRelationship rel =
      sheet.getPackagePart().
          addRelationship(slide.getPackagePart().getPartName(),
              TargetMode.INTERNAL,
              XSLFRelation.SLIDE.getRelation());
  _link.setId(rel.getId());
  _link.setAction("ppaction://hlinksldjump");
}
origin: org.apache.poi/poi-ooxml

public XDDFHyperlink(String id) {
  this(CTHyperlink.Factory.newInstance());
  this.link.setId(id);
}
origin: stackoverflow.com

public void example() throws Exception{
   XWPFDocument document = new XWPFDocument(); 
   //Append a link to 
   appendExternalHyperlink("https://poi.apache.org", " Link to POI", document.createParagraph());
   document.write(new FileOutputStream("resultat.docx"));
 }
 /**
  * Appends an external hyperlink to the paragraph.
  * 
  * @param url The URL to the external target
  * @param text The linked text
  * @param paragraph the paragraph the link will be appended to.
  */
 public static void appendExternalHyperlink(String url, String text, XWPFParagraph paragraph){
   //Add the link as External relationship
   String id=paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId();
   //Append the link and bind it to the relationship
   CTHyperlink cLink=paragraph.getCTP().addNewHyperlink();
   cLink.setId(id);
   //Create the linked text
   CTText ctText=CTText.Factory.newInstance();
   ctText.setStringValue(text);
   CTR ctr=CTR.Factory.newInstance();
   ctr.setTArray(new CTText[]{ctText});
   //Insert the linked text into the link
   cLink.setRArray(new CTR[]{ctr});
 }
origin: org.apache.poi/poi-ooxml

public String getAction() {
  if (link.isSetAction()) {
    return link.getAction();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public XDDFExtensionList getExtensionList() {
  if (link.isSetExtLst()) {
    return new XDDFExtensionList(link.getExtLst());
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public Boolean getHighlightClick() {
  if (link.isSetHighlightClick()) {
    return link.getHighlightClick();
  } else {
    return null;
  }
}
origin: org.apache.poi/poi-ooxml

public XDDFHyperlink(String id, String action) {
  this(id);
  this.link.setAction(action);
}
origin: org.apache.poi/poi-ooxml

@Override
public HyperlinkType getType() {
  String action = _link.getAction();
  if (action == null) {
    action = "";
  }
  if (action.equals("ppaction://hlinksldjump") || action.startsWith("ppaction://hlinkshowjump")) {
    return HyperlinkType.DOCUMENT;
  }
  String address = getAddress();
  if (address == null) {
    address = "";
  }
  if (address.startsWith("mailto:")) {
    return HyperlinkType.EMAIL;
  } else {
    return HyperlinkType.URL;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

private void linkToExternal(String url) {
  PackagePart thisPP = _sheet.getPackagePart();
  if (_link.isSetId() && !_link.getId().isEmpty()) {
    thisPP.removeRelationship(_link.getId());
  }
  PackageRelationship rel = thisPP.addExternalRelationship(url, XSLFRelation.HYPERLINK.getRelation());
  _link.setId(rel.getId());
  if (_link.isSetAction()) {
    _link.unsetAction();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  break;
case DOCUMENT:
  final String idSrc = src._link.getId();
  if (idSrc == null || idSrc.isEmpty()) {
    if (pp != null) {
      RelationPart rp = _sheet.addRelation(null, XSLFRelation.SLIDE, pp);
      _link.setId(rp.getRelationship().getId());
      _link.setAction(src._link.getAction());
org.openxmlformats.schemas.drawingml.x2006.mainCTHyperlink

Most used methods

  • getId
  • setId
  • setAction
  • getAction
  • getEndSnd
  • getExtLst
  • getHighlightClick
  • getHistory
  • getInvalidUrl
  • getTgtFrame
  • getTooltip
  • isSetAction
  • getTooltip,
  • isSetAction,
  • isSetEndSnd,
  • isSetExtLst,
  • isSetHighlightClick,
  • isSetHistory,
  • isSetId,
  • isSetInvalidUrl,
  • isSetTgtFrame,
  • isSetTooltip

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now