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
Creates an hyperlink.
This class belongs to the fo:basic-link tag processing.
This work was originally authored by Andreas Putz
-
Field Summary
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
Constructor Summary
ConstructorDescriptionRtfHyperLink
(IRtfTextContainer parent, Writer writer, String str, RtfAttributes attr) A constructor.RtfHyperLink
(RtfTextrun parent, Writer writer, RtfAttributes attr) A constructor. -
Method Summary
Modifier and TypeMethodDescriptionIRtfTextContainer requirement:Returns the current RtfTextrun object.boolean
isEmpty()
void
add a line breakclose current text run if any and start a new one with default attributesnewText
(String str, RtfAttributes attr) close current text run if any and start a new onevoid
setExternalURL
(String url) Sets the url of the external link.void
setInternalURL
(String jumpTo) Sets the url of the external link.void
Writes the RTF content to m_writer.void
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 Details
-
url
The url of the image -
mText
RtfText
-
-
Constructor Details
-
RtfHyperLink
public RtfHyperLink(IRtfTextContainer parent, Writer writer, String str, RtfAttributes attr) throws IOException A constructor.- Parameters:
parent
- aRtfContainer
valuewriter
- aWriter
valuestr
- text of the linkattr
- aRtfAttributes
value- Throws:
IOException
- for I/O problems
-
RtfHyperLink
A constructor.- Parameters:
parent
- aRtfContainer
valuewriter
- aWriter
valueattr
- aRtfAttributes
value- Throws:
IOException
- for I/O problems
-
-
Method Details
-
writeRtfPrefix
Writes the RTF content to m_writer.- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
IOException
- On error
-
writeRtfSuffix
Writes the RTF content to m_writer.- Overrides:
writeRtfSuffix
in classRtfElement
- Throws:
IOException
- On error
-
newText
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:
IOException
- for I/O problems
-
newText
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:
IOException
- for I/O problems
-
getTextContainerAttributes
IRtfTextContainer requirement:- Specified by:
getTextContainerAttributes
in interfaceIRtfTextContainer
- Returns:
- a copy of our attributes
- Throws:
FOPException
- if attributes cannot be cloned
-
newLineBreak
add a line break- Specified by:
newLineBreak
in interfaceIRtfTextContainer
- Throws:
IOException
- for I/O problems
-
setExternalURL
Sets the url of the external link.- Parameters:
url
- Link url like "http://..."
-
setInternalURL
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
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:
IOException
- if not caught
-