|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.print.BaseDocumentTag org.ujac.print.tag.BaseElementTag org.ujac.print.tag.BaseLoopTag org.ujac.print.tag.PrintTableTag
public class PrintTableTag
Name: PrintTableTag
Description: A class iterating over a given table and repeats the
nested body for each element of the table.
Nested Class Summary | |
---|---|
class |
PrintTableTag.DummyColumn
Name: DummyColumn Description: A class for dummy columns which are added through the insert-column tag. |
Field Summary | |
---|---|
static int |
DIRECTION_AFTER
Constant for the insert direction 'after'. |
static int |
DIRECTION_BEFORE
Constant for the insert direction 'before'. |
static int |
MAX_SEGMENT_SIZE
The maximum number of lines for a table segment. |
protected boolean |
outputStarted
Tells whether the output has already been started or not. |
static String |
TAG_NAME
The item's name. |
Fields inherited from class org.ujac.print.tag.BaseLoopTag |
---|
insertItems, iterationIdx, sequenceHolder, sequenceIterator |
Constructor Summary | |
---|---|
PrintTableTag()
Constructs a PrintTableTag instance with no specific attributes. |
Method Summary | |
---|---|
void |
addCell(BaseDocumentTag item,
com.lowagie.text.pdf.PdfPCell cell)
Adds a cell to the table. |
void |
addHeaderCell(BaseDocumentTag item,
com.lowagie.text.pdf.PdfPCell cell)
Adds a header cell to the table. |
void |
alterColumn(String name,
float width,
int hAlign,
String title,
String defaultContents)
Alters a column at the table. |
protected AttributeDefinitionMap |
buildSupportedAttributes()
Gets the list of supported attributes. |
ChildDefinitionMap |
buildSupportedChilds()
Gets the list of supported childs. |
protected AttributeDefinitionMap |
buildSupportedStyleAttributes()
Gets the list of supported style attributes. |
void |
closeItem()
Closes the item. |
void |
defineColumn(String name,
float width,
int hAlign,
String title,
String defaultContents)
Defines a column for the table. |
boolean |
fitsPage()
Checks whether the table fits the current page or not. |
CellAttributes |
getCellAttributes()
Gets the cell attributes. |
protected int |
getColumnIndex(String columnName)
Gets the index of the given column. |
protected String |
getDefaultContent(int idx)
Gets the default contents for the given column. |
String |
getDescription()
Gets a brief description for the item. |
float |
getLeading()
Gets the leading. |
float |
getLineSpacing()
Gets the line spacing. |
int |
getNumColumns()
Gets the number of columns by row to print. |
int |
getNumContentRows()
Gets the number of content rows, that have been added to the current table so far. |
protected int |
getNumRows()
Gets the number of rows, printed so far within the current row segment. |
PdfTableHolder |
getPdfTable()
Gets the PDF table holder. |
int |
getRemainingPdfColumns()
Gets the number of remaining columns of the current row. |
protected com.lowagie.text.pdf.PdfPTable |
getTable()
Gets the PDF table. |
Column[] |
getVisibleColumns()
Gets all visible columns. |
void |
initialize()
Initializes the item. |
void |
insertColumn(String name,
float width,
int hAlign,
String title,
String reference,
int direction,
String defaultContents)
Inserts a column into the table. |
boolean |
isOutputStarted()
Checks whether the table output has been started or not. |
boolean |
isStyleable()
Tells whether or not this tag does respect style attributes or not. |
boolean |
isTextBodyAllowed()
Tells whether textual content is allowed for the tag or not. |
void |
openItem()
Opens the item. |
void |
openItem(boolean resetData)
Opens the item. |
protected void |
postLoopChildItems()
Method called after the child items are printed. |
protected void |
postRepeatChildItems()
Post-processes the child items of the foreach item. |
protected void |
preLoopChildItems()
Method called before the child items are printed. |
protected boolean |
preRepeatChildItems()
Pre-processes the child items of the foreach item. |
void |
removeColumn(String name)
Removes a column from the table. |
boolean |
splitTable(boolean newPage,
boolean keepHeader)
Splits the table vertically. |
Methods inherited from class org.ujac.print.tag.BaseLoopTag |
---|
getCurrentValue, getLoopIdxVariable, getLoopVariable, getSequenceHolder, hasNext, isFirstLoop, isTrue, recordEvent, repeatChildItems, setCurrentValue, setLoopVariable, setSequenceHolder |
Methods inherited from class org.ujac.print.tag.BaseElementTag |
---|
getElementContainer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ujac.print.FontHolder |
---|
getFont |
Methods inherited from interface org.ujac.print.Condition |
---|
isTrue |
Methods inherited from interface org.ujac.print.StyleHolder |
---|
getStyleAttribute |
Field Detail |
---|
public static final int DIRECTION_BEFORE
public static final int DIRECTION_AFTER
public static final String TAG_NAME
public static final int MAX_SEGMENT_SIZE
protected boolean outputStarted
Constructor Detail |
---|
public PrintTableTag()
Method Detail |
---|
public String getDescription()
getDescription
in class BaseDocumentTag
protected AttributeDefinitionMap buildSupportedAttributes()
buildSupportedAttributes
in class BaseElementTag
protected AttributeDefinitionMap buildSupportedStyleAttributes()
buildSupportedStyleAttributes
in class BaseDocumentTag
public ChildDefinitionMap buildSupportedChilds()
buildSupportedChilds
in class BaseDocumentTag
public boolean isStyleable()
isStyleable
in class BaseDocumentTag
true
.public boolean isTextBodyAllowed()
isTextBodyAllowed
in class BaseDocumentTag
public Column[] getVisibleColumns()
public void initialize() throws DocumentHandlerException
initialize
in class BaseLoopTag
DocumentHandlerException
- If something went badly wrong.public void openItem() throws DocumentHandlerException
openItem
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong while opening the foreach item.public void openItem(boolean resetData) throws DocumentHandlerException
resetData
- tells whether to reset some specific data or not (don't blame for this silly comment).
DocumentHandlerException
- Thrown in case something went wrong while opening the document item.public void closeItem() throws DocumentHandlerException
closeItem
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong while closing the foreach item.protected boolean preRepeatChildItems() throws DocumentHandlerException
preRepeatChildItems
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong.protected void postRepeatChildItems() throws DocumentHandlerException
postRepeatChildItems
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong.protected void preLoopChildItems() throws DocumentHandlerException
preLoopChildItems
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong.protected void postLoopChildItems() throws DocumentHandlerException
postLoopChildItems
in class BaseLoopTag
DocumentHandlerException
- Thrown in case something went wrong.protected String getDefaultContent(int idx)
idx
- The index of the column to get the default contents for.
public boolean isOutputStarted()
public void addCell(BaseDocumentTag item, com.lowagie.text.pdf.PdfPCell cell) throws DocumentHandlerException
addCell
in interface PdfCellContainer
item
- The tag which performed the cell adding.cell
- The cell to be added.
DocumentHandlerException
- If something went wrong when adding the cell.public int getRemainingPdfColumns()
getRemainingPdfColumns
in interface PdfCellContainer
public PdfTableHolder getPdfTable()
getPdfTable
in interface PdfCellContainer
public void addHeaderCell(BaseDocumentTag item, com.lowagie.text.pdf.PdfPCell cell) throws DocumentHandlerException
item
- The tag which performed the cell adding.cell
- The header cell to be added.
DocumentHandlerException
- If something went wrong when adding the header cell.public boolean fitsPage() throws DocumentHandlerException
fitsPage
in interface PdfTableHolder
DocumentHandlerException
- In case something went wrong.public boolean splitTable(boolean newPage, boolean keepHeader) throws DocumentHandlerException
splitTable
in interface PdfTableHolder
newPage
- Tells whether to start a new page or not.keepHeader
- Tells whether to keep the old header or not.
DocumentHandlerException
- If something went wrong while splitting the table.public void defineColumn(String name, float width, int hAlign, String title, String defaultContents) throws DocumentHandlerException
name
- The name of the column.width
- The width of the column.hAlign
- The horizontal alignment of the column.title
- The title of the column.defaultContents
- The default contents to use for this column.
DocumentHandlerException
- In case the given reference column does not exist.public void insertColumn(String name, float width, int hAlign, String title, String reference, int direction, String defaultContents) throws DocumentHandlerException
name
- The name of the new column.width
- The width of the new column.hAlign
- The horizontal alignment of the new column.title
- The title of the column.reference
- The column at which to insert the new column.direction
- The insert direction.defaultContents
- The default contents to use for this column.
DocumentHandlerException
- In case the given reference column does not exist.DIRECTION_BEFORE
,
DIRECTION_AFTER
public void alterColumn(String name, float width, int hAlign, String title, String defaultContents) throws DocumentHandlerException
name
- The name of the new column.width
- The width of the new column.hAlign
- The horizontal alignment of the new column.title
- The title of the column.defaultContents
- The default contents to use for this column.
DocumentHandlerException
- In case the given reference column does not exist.public void removeColumn(String name) throws DocumentHandlerException
name
- The name of the new column.
DocumentHandlerException
- In case the given column does not exist.protected com.lowagie.text.pdf.PdfPTable getTable()
protected int getNumRows()
public int getNumColumns()
getNumColumns
in interface PdfTableHolder
public int getNumContentRows()
getNumContentRows
in interface PdfTableHolder
protected int getColumnIndex(String columnName)
columnName
- The name of the column to get the index for.
public CellAttributes getCellAttributes()
getCellAttributes
in interface PdfCellContainer
public float getLineSpacing()
getLineSpacing
in interface CommonAttributesHolder
public float getLeading()
getLeading
in interface CommonAttributesHolder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |