Class RtfHyperLink
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHyperLink
-
- All Implemented Interfaces:
IRtfTextContainer,IRtfTextrunContainer
public class RtfHyperLink extends RtfContainer implements IRtfTextContainer, IRtfTextrunContainer
Creates an hyperlink. This class belongs to the fo:basic-link tag processing. This work was originally authored by Andreas Putz
-
-
Constructor Summary
Constructors Constructor Description RtfHyperLink(IRtfTextContainer parent, java.io.Writer writer, java.lang.String str, RtfAttributes attr)A constructor.RtfHyperLink(RtfTextrun parent, java.io.Writer writer, RtfAttributes attr)A constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RtfAttributesgetTextContainerAttributes()IRtfTextContainer requirement:RtfTextrungetTextrun()Returns the current RtfTextrun object.booleanisEmpty()voidnewLineBreak()add a line breakRtfTextnewText(java.lang.String str)close current text run if any and start a new one with default attributesRtfTextnewText(java.lang.String str, RtfAttributes attr)close current text run if any and start a new onevoidsetExternalURL(java.lang.String url)Sets the url of the external link.voidsetInternalURL(java.lang.String jumpTo)Sets the url of the external link.voidwriteRtfPrefix()Writes the RTF content to m_writer.voidwriteRtfSuffix()Writes the RTF content to m_writer.-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, findChildren, getChildCount, getChildren, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
-
-
-
-
Field Detail
-
url
protected java.lang.String url
The url of the image
-
mText
protected RtfText mText
RtfText
-
-
Constructor Detail
-
RtfHyperLink
public RtfHyperLink(IRtfTextContainer parent, java.io.Writer writer, java.lang.String str, RtfAttributes attr) throws java.io.IOException
A constructor.- Parameters:
parent- aRtfContainervaluewriter- aWritervaluestr- text of the linkattr- aRtfAttributesvalue- Throws:
java.io.IOException- for I/O problems
-
RtfHyperLink
public RtfHyperLink(RtfTextrun parent, java.io.Writer writer, RtfAttributes attr) throws java.io.IOException
A constructor.- Parameters:
parent- aRtfContainervaluewriter- aWritervalueattr- aRtfAttributesvalue- Throws:
java.io.IOException- for I/O problems
-
-
Method Detail
-
writeRtfPrefix
public void writeRtfPrefix() throws java.io.IOExceptionWrites the RTF content to m_writer.- Overrides:
writeRtfPrefixin classRtfElement- Throws:
java.io.IOException- On error
-
writeRtfSuffix
public void writeRtfSuffix() throws java.io.IOExceptionWrites the RTF content to m_writer.- Overrides:
writeRtfSuffixin classRtfElement- Throws:
java.io.IOException- On error
-
newText
public RtfText newText(java.lang.String str) throws java.io.IOException
close current text run if any and start a new one with default attributes- Specified by:
newTextin interfaceIRtfTextContainer- Parameters:
str- if not null, added to the RtfText created- Returns:
- new RtfText object
- Throws:
java.io.IOException- for I/O problems
-
newText
public RtfText newText(java.lang.String str, RtfAttributes attr) throws java.io.IOException
close current text run if any and start a new one- Specified by:
newTextin interfaceIRtfTextContainer- Parameters:
str- if not null, added to the RtfText createdattr- attributes of text to add- Returns:
- the new RtfText object
- Throws:
java.io.IOException- for I/O problems
-
getTextContainerAttributes
public RtfAttributes getTextContainerAttributes() throws FOPException
IRtfTextContainer requirement:- Specified by:
getTextContainerAttributesin interfaceIRtfTextContainer- Returns:
- a copy of our attributes
- Throws:
FOPException- if attributes cannot be cloned
-
newLineBreak
public void newLineBreak() throws java.io.IOExceptionadd a line break- Specified by:
newLineBreakin interfaceIRtfTextContainer- Throws:
java.io.IOException- for I/O problems
-
setExternalURL
public void setExternalURL(java.lang.String url)
Sets the url of the external link.- Parameters:
url- Link url like "http://..."
-
setInternalURL
public void setInternalURL(java.lang.String jumpTo)
Sets the url of the external link.- Parameters:
jumpTo- Name of the text mark
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classRtfContainer- Returns:
- false (always)
-
getTextrun
public RtfTextrun getTextrun() throws java.io.IOException
Description copied from interface:IRtfTextrunContainerReturns the current RtfTextrun object. Opens a new one if necessary.- Specified by:
getTextrunin interfaceIRtfTextrunContainer- Returns:
- a text run
- Throws:
java.io.IOException- if not caught
-
-