public class RtfHyperLink extends RtfContainer implements IRtfTextContainer, IRtfTextrunContainer
Creates an hyperlink.
This class belongs to the
This work was authored by Andreas Putz (a.putz@skynamics.com).
Modifier and Type | Field and Description |
---|---|
protected RtfText |
mText
RtfText
|
protected java.lang.String |
url
The url of the image
|
attrib, parent, writer
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
RtfAttributes |
getTextContainerAttributes()
IRtfTextContainer requirement:
|
RtfTextrun |
getTextrun()
Returns the current RtfTextrun object.
|
boolean |
isEmpty() |
void |
newLineBreak()
add a line break
|
RtfText |
newText(java.lang.String str)
close current text run if any and start a new one with default attributes
|
RtfText |
newText(java.lang.String str,
RtfAttributes attr)
close current text run if any and start a new one
|
void |
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.
|
addChild, findChildren, getChildCount, getChildren, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
protected java.lang.String url
protected RtfText mText
public RtfHyperLink(IRtfTextContainer parent, java.io.Writer writer, java.lang.String str, RtfAttributes attr) throws java.io.IOException
parent
- a RtfContainer
valuewriter
- a Writer
valuestr
- text of the linkattr
- a RtfAttributes
valuejava.io.IOException
- for I/O problemspublic RtfHyperLink(RtfTextrun parent, java.io.Writer writer, RtfAttributes attr) throws java.io.IOException
parent
- a RtfContainer
valuewriter
- a Writer
valueattr
- a RtfAttributes
valuejava.io.IOException
- for I/O problemspublic void writeRtfPrefix() throws java.io.IOException
writeRtfPrefix
in class RtfElement
java.io.IOException
- On errorpublic void writeRtfSuffix() throws java.io.IOException
writeRtfSuffix
in class RtfElement
java.io.IOException
- On errorpublic RtfText newText(java.lang.String str) throws java.io.IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdjava.io.IOException
- for I/O problemspublic RtfText newText(java.lang.String str, RtfAttributes attr) throws java.io.IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdattr
- attributes of text to addjava.io.IOException
- for I/O problemspublic RtfAttributes getTextContainerAttributes() throws FOPException
getTextContainerAttributes
in interface IRtfTextContainer
FOPException
- if attributes cannot be clonedpublic void newLineBreak() throws java.io.IOException
newLineBreak
in interface IRtfTextContainer
java.io.IOException
- for I/O problemspublic void setExternalURL(java.lang.String url)
url
- Link url like "http://..."public void setInternalURL(java.lang.String jumpTo)
jumpTo
- Name of the text markpublic boolean isEmpty()
isEmpty
in class RtfContainer
public RtfTextrun getTextrun() throws java.io.IOException
IRtfTextrunContainer
getTextrun
in interface IRtfTextrunContainer
java.io.IOException
- if not caughtCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.