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 private void
closeAll()
private void
closeCurrentText()
RtfAttributes
getTextContainerAttributes()
IRtfTextContainer requirement:RtfTextrun
getTextrun()
Returns the current RtfTextrun object.boolean
isEmpty()
void
newLineBreak()
add a line breakRtfText
newText(java.lang.String str)
close current text run if any and start a new one with default attributesRtfText
newText(java.lang.String str, RtfAttributes attr)
close current text run if any and start a new onevoid
setExternalURL(java.lang.String url)
Sets the url of the external link.void
setInternalURL(java.lang.String jumpTo)
Sets the url of the external link.void
writeRtfPrefix()
Writes the RTF content to m_writer.void
writeRtfSuffix()
Writes the RTF content to m_writer.-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, findChildren, getChildCount, getChildren, getOptions, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, 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
- aRtfContainer
valuewriter
- aWriter
valuestr
- text of the linkattr
- aRtfAttributes
value- 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
- aRtfContainer
valuewriter
- aWriter
valueattr
- aRtfAttributes
value- Throws:
java.io.IOException
- for I/O problems
-
-
Method Detail
-
writeRtfPrefix
public void writeRtfPrefix() throws java.io.IOException
Writes the RTF content to m_writer.- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
java.io.IOException
- On error
-
writeRtfSuffix
public void writeRtfSuffix() throws java.io.IOException
Writes the RTF content to m_writer.- Overrides:
writeRtfSuffix
in 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:
newText
in 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:
newText
in 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:
getTextContainerAttributes
in interfaceIRtfTextContainer
- Returns:
- a copy of our attributes
- Throws:
FOPException
- if attributes cannot be cloned
-
newLineBreak
public void newLineBreak() throws java.io.IOException
add a line break- Specified by:
newLineBreak
in interfaceIRtfTextContainer
- Throws:
java.io.IOException
- for I/O problems
-
closeCurrentText
private void closeCurrentText() throws java.io.IOException
- Throws:
java.io.IOException
-
closeAll
private void closeAll() throws java.io.IOException
- Throws:
java.io.IOException
-
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:
isEmpty
in classRtfContainer
- Returns:
- false (always)
-
getTextrun
public RtfTextrun getTextrun() throws java.io.IOException
Description copied from interface:IRtfTextrunContainer
Returns the current RtfTextrun object. Opens a new one if necessary.- Specified by:
getTextrun
in interfaceIRtfTextrunContainer
- Returns:
- a text run
- Throws:
java.io.IOException
- if not caught
-
-