net.sf.jett.tag
Class CommentTag

java.lang.Object
  extended by net.sf.jett.tag.BaseTag
      extended by net.sf.jett.tag.CommentTag
All Implemented Interfaces:
Tag

public class CommentTag
extends BaseTag

A CommentTag represents a Cell that needs to have an Excel Comment attached to it. It controls Comment properties such author, the Rich Text string comment, and whether the Comment is initially visible.

This tag uses the POI method createDrawingPatriarch to create an Excel comment on the Cell on which the tag is located. The POI documentation warns of corrupting other "drawings" such as charts and "complex" drawings when calling getDrawingPatriarch (HSSF code). When testing both .xls and .xlsx template spreadsheets, it appears that drawings and charts do get corrupted in .xls spreadsheets, but they do NOT get corrupted in .xlsx spreadsheets.


Attributes:

Since:
0.2.0
Author:
Randy Gettman

Field Summary
static java.lang.String ATTR_AUTHOR
          Attribute that specifies the author of the Comment to be created.
static java.lang.String ATTR_COMMENT
          Attribute that specifies the comment text.
static java.lang.String ATTR_VALUE
          Attribute that specifies the value of the Cell itself after transformation.
static java.lang.String ATTR_VISIBLE
          Attribute that specifies whether the comment is initially visible.
 
Fields inherited from class net.sf.jett.tag.BaseTag
ATTR_ON_PROCESSED, SPEC_SEP
 
Constructor Summary
CommentTag()
           
 
Method Summary
 java.lang.String getName()
          Returns this Tag's name.
protected  java.util.List<java.lang.String> getOptionalAttributes()
          Returns a List of optional attribute names.
protected  java.util.List<java.lang.String> getRequiredAttributes()
          Returns a List of required attribute names.
 boolean process()
          Place the "value" attribute in the cell, and the rest of the attributes control the creation of a cell comment.
 void validateAttributes()
          Validates the attributes for this Tag.
 
Methods inherited from class net.sf.jett.tag.BaseTag
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setWorkbookContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_VALUE

public static final java.lang.String ATTR_VALUE
Attribute that specifies the value of the Cell itself after transformation.

See Also:
Constant Field Values

ATTR_AUTHOR

public static final java.lang.String ATTR_AUTHOR
Attribute that specifies the author of the Comment to be created.

See Also:
Constant Field Values

ATTR_COMMENT

public static final java.lang.String ATTR_COMMENT
Attribute that specifies the comment text.

See Also:
Constant Field Values

ATTR_VISIBLE

public static final java.lang.String ATTR_VISIBLE
Attribute that specifies whether the comment is initially visible. Even if not initially visible, the user can mouseover a cell with a comment to view the comment text as a pop-up.

See Also:
Constant Field Values
Constructor Detail

CommentTag

public CommentTag()
Method Detail

getName

public java.lang.String getName()
Returns this Tag's name.

Returns:
This Tag's name.

getRequiredAttributes

protected java.util.List<java.lang.String> getRequiredAttributes()
Returns a List of required attribute names.

Overrides:
getRequiredAttributes in class BaseTag
Returns:
A List of required attribute names.

getOptionalAttributes

protected java.util.List<java.lang.String> getOptionalAttributes()
Returns a List of optional attribute names.

Overrides:
getOptionalAttributes in class BaseTag
Returns:
A List of optional attribute names.

validateAttributes

public void validateAttributes()
                        throws TagParseException
Validates the attributes for this Tag. This tag must be bodiless.

Overrides:
validateAttributes in class BaseTag
Throws:
TagParseException - If the attribute values are illegal or unacceptable.

process

public boolean process()

Place the "value" attribute in the cell, and the rest of the attributes control the creation of a cell comment.

Specified by:
process in class BaseTag
Returns:
Whether the first Cell in the Block associated with this Tag was processed.


Copyright © 2012-2013 Jett Team. All Rights Reserved.