org.jfor.jfor.rtflib.rtfdoc
Class RtfHyperLink

java.lang.Object
  extended by org.jfor.jfor.rtflib.rtfdoc.RtfElement
      extended by org.jfor.jfor.rtflib.rtfdoc.RtfContainer
          extended by org.jfor.jfor.rtflib.rtfdoc.RtfHyperLink
All Implemented Interfaces:
IRtfTextContainer

public class RtfHyperLink
extends RtfContainer
implements IRtfTextContainer

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  java.lang.String url
          The url of the image
 
Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
m_attrib, m_parent, m_writer
 
Constructor Summary
RtfHyperLink(IRtfTextContainer parent, java.io.Writer writer, java.lang.String str, RtfAttributes attr)
          Default constructor.
 
Method Summary
 RtfAttributes getTextContainerAttributes()
          IRtfTextContainer requirement: return a copy of our attributes
 boolean isEmpty()
          true if this element would generate no "useful" RTF content.
 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.
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, getChildCount, getChildren, getOptions, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
Default constructor.

Parameters:
container - a RtfContainer value
writer - a Writer value
attributes - a RtfAttributes value
Throws:
java.io.IOException
Method Detail

writeRtfPrefix

public void writeRtfPrefix()
                    throws java.io.IOException
Writes the RTF content to m_writer.

Overrides:
writeRtfPrefix in class RtfElement
Throws:
java.io.IOException - On error

writeRtfSuffix

public void writeRtfSuffix()
                    throws java.io.IOException
Writes the RTF content to m_writer.

Overrides:
writeRtfSuffix in class RtfElement
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 interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
Throws:
java.io.IOException

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 interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
Throws:
java.io.IOException

getTextContainerAttributes

public RtfAttributes getTextContainerAttributes()
IRtfTextContainer requirement: return a copy of our attributes

Specified by:
getTextContainerAttributes in interface IRtfTextContainer

newLineBreak

public void newLineBreak()
                  throws java.io.IOException
add a line break

Specified by:
newLineBreak in interface IRtfTextContainer
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()
Description copied from class: RtfContainer
true if this element would generate no "useful" RTF content. For an RtfContainer, true if it has no children where isEmpty() is false

Overrides:
isEmpty in class RtfContainer