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
FieldsFields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer -
Constructor Summary
ConstructorsConstructorDescriptionRtfHyperLink(IRtfTextContainer parent, Writer writer, String str, RtfAttributes attr) A constructor.RtfHyperLink(RtfTextrun parent, Writer writer, RtfAttributes attr) A constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcloseAll()private voidIRtfTextContainer requirement:Returns the current RtfTextrun object.booleanisEmpty()voidadd 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 onevoidsetExternalURL(String url) Sets the url of the external link.voidsetInternalURL(String jumpTo) Sets the url of the external link.voidWrites the RTF content to m_writer.voidWrites 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, writeRtfContentMethods 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 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- aRtfContainervaluewriter- aWritervaluestr- text of the linkattr- aRtfAttributesvalue- Throws:
IOException- for I/O problems
-
RtfHyperLink
A constructor.- Parameters:
parent- aRtfContainervaluewriter- aWritervalueattr- aRtfAttributesvalue- Throws:
IOException- for I/O problems
-
-
Method Details
-
writeRtfPrefix
Writes the RTF content to m_writer.- Overrides:
writeRtfPrefixin classRtfElement- Throws:
IOException- On error
-
writeRtfSuffix
Writes the RTF content to m_writer.- Overrides:
writeRtfSuffixin classRtfElement- Throws:
IOException- On error
-
newText
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:
IOException- for I/O problems
-
newText
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:
IOException- for I/O problems
-
getTextContainerAttributes
IRtfTextContainer requirement:- Specified by:
getTextContainerAttributesin interfaceIRtfTextContainer- Returns:
- a copy of our attributes
- Throws:
FOPException- if attributes cannot be cloned
-
newLineBreak
add a line break- Specified by:
newLineBreakin interfaceIRtfTextContainer- Throws:
IOException- for I/O problems
-
closeCurrentText
- Throws:
IOException
-
closeAll
- Throws:
IOException
-
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:
isEmptyin classRtfContainer- Returns:
- false (always)
-
getTextrun
Description copied from interface:IRtfTextrunContainerReturns the current RtfTextrun object. Opens a new one if necessary.- Specified by:
getTextrunin interfaceIRtfTextrunContainer- Returns:
- a text run
- Throws:
IOException- if not caught
-