org.apache.fop.render.rtf.rtflib.rtfdoc

Class RtfHyperLink

Implemented Interfaces:
IRtfTextContainer, IRtfTextrunContainer

public class RtfHyperLink
extends RtfContainer
implements IRtfTextContainer, IRtfTextrunContainer

Creates an hyperlink. This class belongs to the tag processing.
Author:
Andreas Putz {\field {\*\fldinst HYPERLINK "http://www.test.de" }{\fldrslt Joe Smith}}

Field Summary

protected RtfText
mText
RtfText
protected String
url
The url of the image

Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

attrib, parent, writer

Constructor Summary

RtfHyperLink(IRtfTextContainer parent, Writer writer, String str, RtfAttributes attr)
Default constructor.
RtfHyperLink(RtfTextrun parent, Writer writer, RtfAttributes attr)

Method Summary

RtfAttributes
getTextContainerAttributes()
IRtfTextContainer requirement:
RtfTextrun
getTextrun()
Returns the current RtfTextrun object.
boolean
isEmpty()
void
newLineBreak()
add a line break
RtfText
newText(String str)
close current text run if any and start a new one with default attributes
RtfText
newText(String str, RtfAttributes attr)
close current text run if any and start a new one
void
setExternalURL(String url)
Sets the url of the external link.
void
setInternalURL(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, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent

Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

close, getRtfAttributes, isEmpty, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfContent, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS

Field Details

mText

protected RtfText mText
RtfText

url

protected String url
The url of the image

Constructor Details

RtfHyperLink

public RtfHyperLink(IRtfTextContainer parent,
                    Writer writer,
                    String str,
                    RtfAttributes attr)
            throws IOException
Default constructor.
Parameters:
parent - a RtfContainer value
writer - a Writer value
str - text of the link
attr - a RtfAttributes value

RtfHyperLink

public RtfHyperLink(RtfTextrun parent,
                    Writer writer,
                    RtfAttributes attr)
            throws IOException

Method Details

getTextContainerAttributes

public RtfAttributes getTextContainerAttributes()
IRtfTextContainer requirement:
Specified by:
getTextContainerAttributes in interface IRtfTextContainer
Returns:
a copy of our attributes

getTextrun

public RtfTextrun getTextrun()
            throws IOException
Returns the current RtfTextrun object. Opens a new one if necessary.
Specified by:
getTextrun in interface IRtfTextrunContainer
Returns:
The RtfTextrun object

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in interface RtfContainer
Returns:
false (always)

newLineBreak

public void newLineBreak()
            throws IOException
add a line break
Specified by:
newLineBreak in interface IRtfTextContainer

newText

public RtfText newText(String str)
            throws IOException
close current text run if any and start a new one with default attributes
Specified by:
newText in interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
Returns:
new RtfText object

newText

public RtfText newText(String str,
                       RtfAttributes attr)
            throws IOException
close current text run if any and start a new one
Specified by:
newText in interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
attr - attributes of text to add
Returns:
the new RtfText object

setExternalURL

public void setExternalURL(String url)
Sets the url of the external link.
Parameters:
url - Link url like "http://..."

setInternalURL

public void setInternalURL(String jumpTo)
Sets the url of the external link.
Parameters:
jumpTo - Name of the text mark

writeRtfPrefix

public void writeRtfPrefix()
            throws IOException
Writes the RTF content to m_writer.
Overrides:
writeRtfPrefix in interface RtfElement

writeRtfSuffix

public void writeRtfSuffix()
            throws IOException
Writes the RTF content to m_writer.
Overrides:
writeRtfSuffix in interface RtfElement

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.