public XDDFHyperlink getHyperlink() { return findDefinedProperty(props -> props.isSetHlinkClick(), props -> props.getHlinkClick()) .map(link -> new XDDFHyperlink(link)) .orElse(null); }
public void setHyperlink(XDDFHyperlink link) { if (link == null) { if (props.isSetHlinkClick()) { props.unsetHlinkClick(); } } else { props.setHlinkClick(link.getXmlObject()); } }
/** * Insert a line break * * @return text run representing this line break ('\n') */ @SuppressWarnings("WeakerAccess") public XSLFTextRun addLineBreak(){ XSLFLineBreak run = new XSLFLineBreak(_p.addNewBr(), this); CTTextCharacterProperties brProps = run.getRPr(true); if(_runs.size() > 0){ // by default line break has the font size of the last text run CTTextCharacterProperties prevRun = _runs.get(_runs.size() - 1).getRPr(true); brProps.set(prevRun); // don't copy hlink properties if (brProps.isSetHlinkClick()) { brProps.unsetHlinkClick(); } if (brProps.isSetHlinkMouseOver()) { brProps.unsetHlinkMouseOver(); } } _runs.add(run); return run; }
public XDDFHyperlink getHyperlink() { return findDefinedProperty(props -> props.isSetHlinkClick(), props -> props.getHlinkClick()) .map(link -> new XDDFHyperlink(link)) .orElse(null); }
public void setHyperlink(XDDFHyperlink link) { if (link == null) { if (props.isSetHlinkClick()) { props.unsetHlinkClick(); } } else { props.setHlinkClick(link.getXmlObject()); } }
public XSLFHyperlink getHyperlink(){ if(!_r.getRPr().isSetHlinkClick()) return null; return new XSLFHyperlink(_r.getRPr().getHlinkClick(), this); }
/** * Insert a line break * * @return text run representing this line break ('\n') */ @SuppressWarnings("WeakerAccess") public XSLFTextRun addLineBreak(){ XSLFLineBreak run = new XSLFLineBreak(_p.addNewBr(), this); CTTextCharacterProperties brProps = run.getRPr(true); if(_runs.size() > 0){ // by default line break has the font size of the last text run CTTextCharacterProperties prevRun = _runs.get(_runs.size() - 1).getRPr(true); brProps.set(prevRun); // don't copy hlink properties if (brProps.isSetHlinkClick()) { brProps.unsetHlinkClick(); } if (brProps.isSetHlinkMouseOver()) { brProps.unsetHlinkMouseOver(); } } _runs.add(run); return run; }