Source Code Cross Referenced for HtmlDataTable2D.java in  » J2EE » Sofia » com » salmonllc » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        //** Copyright Statement ***************************************************
0002:        //The Salmon Open Framework for Internet Applications (SOFIA)
0003:        // Copyright (C) 1999 - 2002, Salmon LLC
0004:        //
0005:        // This program is free software; you can redistribute it and/or
0006:        // modify it under the terms of the GNU General Public License version 2
0007:        // as published by the Free Software Foundation;
0008:        //
0009:        // This program is distributed in the hope that it will be useful,
0010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
0011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012:        // GNU General Public License for more details.
0013:        //
0014:        // You should have received a copy of the GNU General Public License
0015:        // along with this program; if not, write to the Free Software
0016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
0017:        //
0018:        // For more information please visit http://www.salmonllc.com
0019:        //** End Copyright Statement ***************************************************
0020:        package com.salmonllc.html;
0021:
0022:        /////////////////////////
0023:        //$Archive: /SOFIA/SourceCode/com/salmonllc/html/HtmlDataTable2D.java $
0024:        //$Author: Fred $
0025:        //$Revision: 26 $
0026:        //$Modtime: 10/02/03 12:26p $
0027:        /////////////////////////
0028:
0029:        import com.salmonllc.util.*;
0030:        import com.salmonllc.sql.*;
0031:
0032:        import java.util.*;
0033:        import java.io.*;
0034:
0035:        /**
0036:         * This component will generate an in a fashon similar to the HTMLDataTable parent. HtmlDataTables can only generate one row per band, however. The 2D version allows multiple rows per band.
0037:         */
0038:
0039:        public class HtmlDataTable2D extends HtmlDataTable {
0040:
0041:            private Vector2D _headingComponents2D = new Vector2D();
0042:            private Vector2D _rowComponents2D = new Vector2D();
0043:            private Vector2D _footerComponents2D = new Vector2D();
0044:            private Vector2D _controlBreakFooterComponents2D = new Vector2D();
0045:            private Vector2D _controlBreakHeadingComponents2D = new Vector2D();
0046:
0047:            public HtmlDataTable2D(String name, DataStoreBuffer d, HtmlPage p) {
0048:                this (name, d, null, p);
0049:            }
0050:
0051:            public HtmlDataTable2D(String name, DataStoreBuffer d,
0052:                    String theme, HtmlPage p) {
0053:                super (name, d, theme, p);
0054:            }
0055:
0056:            public boolean executeEvent(int eventType) throws Exception {
0057:                if (eventType == HtmlComponent.EVENT_OTHER) {
0058:                    for (int i = 0; i < _headingComponents2D.size(); i++) {
0059:                        TwoObjectContainer t = (TwoObjectContainer) _headingComponents2D
0060:                                .elementAt(i);
0061:                        if (t != null) {
0062:                            HtmlComponent h = (HtmlComponent) t.getObject1();
0063:                            if (h != null)
0064:                                if (!h.executeEvent(eventType))
0065:                                    return false;
0066:                        }
0067:
0068:                    }
0069:                    for (int i = 0; i < _rowComponents2D.size(); i++) {
0070:                        TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0071:                                .elementAt(i);
0072:                        if (t != null) {
0073:                            HtmlComponent h = (HtmlComponent) t.getObject1();
0074:                            if (h != null)
0075:                                if (!h.executeEvent(eventType))
0076:                                    return false;
0077:                        }
0078:                    }
0079:                    for (int i = 0; i < _footerComponents2D.size(); i++) {
0080:                        TwoObjectContainer t = (TwoObjectContainer) _footerComponents2D
0081:                                .elementAt(i);
0082:                        if (t != null) {
0083:                            HtmlComponent h = (HtmlComponent) t.getObject1();
0084:                            if (h != null)
0085:                                if (!h.executeEvent(eventType))
0086:                                    return false;
0087:                        }
0088:
0089:                    }
0090:                } else if (_submit != null
0091:                        && eventType == HtmlComponent.EVENT_SUBMIT) {
0092:                    boolean retVal = true;
0093:                    if (_submit == this ) {
0094:                        if (_newRowsPerPage > -1) {
0095:                            _rowsPerPage = _newRowsPerPage;
0096:                            _firstSubmitButton = 0;
0097:                            setFirstRowOnPage(0);
0098:                            _newRowsPerPage = -1;
0099:                        }
0100:                        if (_newStartRow > -1)
0101:                            setFirstRowOnPage(_newStartRow);
0102:                        if (_newFirstButton > -1)
0103:                            _firstSubmitButton = _newFirstButton;
0104:                        if (_clickSortColumn > -1) {
0105:                            TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0106:                                    .elementAt(_clickSortColumn);
0107:                            HtmlComponent sortComp = findSortComponent((HtmlComponent) t
0108:                                    .getObject1());
0109:                            if (sortComp != null)
0110:                                sortOnComponent(sortComp, _clickSortColumn);
0111:                        }
0112:
0113:                    } else
0114:                        retVal = _submit.executeEvent(eventType);
0115:                    _submit = null;
0116:                    return retVal;
0117:                }
0118:
0119:                return true;
0120:            }
0121:
0122:            public void generateHTML(java.io.PrintWriter p, int rowNo)
0123:                    throws Exception {
0124:                if (!getVisible()) {
0125:                    _didSubmit = false;
0126:                    return;
0127:                }
0128:
0129:                int rowsPerPage = _rowsPerPage;
0130:                boolean rowPerPageSel = _rowPerPageSel;
0131:                if (getParent() instanceof  HtmlInlineFrame
0132:                        && getPage().getUseIFrames()) {
0133:                    rowsPerPage = 100000;
0134:                    rowPerPageSel = false;
0135:                }
0136:                _newStartRow = -1;
0137:
0138:                if (_center)
0139:                    p.print("<CENTER>");
0140:
0141:                p.println("<A NAME=\"" + getFullName() + "TableStart\"></A>");
0142:
0143:                String tableHeading = "<TABLE";
0144:
0145:                if (_containerWidth > -1) {
0146:                    tableHeading += " WIDTH=\"" + _containerWidth;
0147:                    if (_sizeOption == SIZE_PERCENT) {
0148:                        tableHeading += "%";
0149:                    }
0150:                    tableHeading += "\"";
0151:                }
0152:
0153:                if (_border > -1)
0154:                    tableHeading += " BORDER=\"" + _border + "\"";
0155:
0156:                if (_bgColor != null) {
0157:                    if (!_bgColor.equals("")) {
0158:                        tableHeading += " BGCOLOR=\"" + _bgColor + "\"";
0159:                    }
0160:                }
0161:
0162:                if (_cellPadding > -1)
0163:                    tableHeading += " CELLPADDING=\"" + _cellPadding + "\"";
0164:
0165:                if (_cellPadding > -1)
0166:                    tableHeading += " CELLSPACING=\"" + _cellSpacing + "\"";
0167:
0168:                if (_align != null) {
0169:                    if (_align.equals(ALIGN_LEFT) || _align.equals(ALIGN_RIGHT)
0170:                            || _align.equals(ALIGN_CENTER))
0171:                        tableHeading += " align=\"" + _align + "\"";
0172:                }
0173:
0174:                tableHeading += ">";
0175:
0176:                p.println(tableHeading);
0177:
0178:                if (_clickSort) {
0179:                    p.println("<INPUT TYPE=\"HIDDEN\" NAME=\"" + getFullName()
0180:                            + "_SORTITEM\" VALUE=\"-1\">");
0181:                    p.print("<SCRIPT>");
0182:                    p.print("function " + getFullName() + "_clickSort(i) {");
0183:                    p.print(getFormString() + getFullName()
0184:                            + "_SORTITEM.value = i;");
0185:                    p.print(getFormString() + "submit();");
0186:                    p.print("}");
0187:                    p.print("</SCRIPT>");
0188:                }
0189:
0190:                StringBuffer td = new StringBuffer();
0191:
0192:                int maxSize = _headingComponents2D.getColumnCount();
0193:                if (_rowComponents2D.getColumnCount() > maxSize)
0194:                    maxSize = _rowComponents2D.getColumnCount();
0195:                if (_footerComponents2D.getColumnCount() > maxSize)
0196:                    maxSize = _footerComponents2D.getColumnCount();
0197:
0198:                //do the heading components
0199:                if (_headingComponents2D.size() > 0)
0200:                    generateHtmlForBand(_headingComponents2D, p,
0201:                            _defaultHeadingBackground, maxSize, _clickSort,
0202:                            "TD");
0203:
0204:                //get the data
0205:                _ds.waitForRetrieve();
0206:                if (_firstRowOnPage >= _ds.getRowCount()) {
0207:                    _firstRowOnPage = 0;
0208:                    _firstSubmitButton = 0;
0209:                }
0210:
0211:                //find the first row for control breaks (if used)
0212:                int lastBreak = -1;
0213:                if (_breakColumns != null) {
0214:                    lastBreak = 0;
0215:                    if (_firstRowOnPage != 0) {
0216:                        lastBreak = 0;
0217:                        for (int i = _firstRowOnPage; i >= 0; i--) {
0218:                            if (_ds.compareRows(_firstRowOnPage, i,
0219:                                    _breakColumns) != 0) {
0220:                                lastBreak = i + 1;
0221:                                break;
0222:                            }
0223:                        }
0224:                    }
0225:                }
0226:
0227:                //do the row components
0228:                String backgroundColor = _defaultRowBackground2;
0229:
0230:                //p.println("<TR>");
0231:                for (int j = _firstRowOnPage; (j < _ds.getRowCount())
0232:                        && (j < (_firstRowOnPage + rowsPerPage)); j++) {
0233:                    backgroundColor = getBackgroundColor(backgroundColor);
0234:
0235:                    //check for control breaks
0236:                    if (_breakColumns != null) {
0237:                        if (_contMessage != null)
0238:                            _contMessage.setVisible(false);
0239:
0240:                        if (j == _firstRowOnPage) {
0241:                            if (_controlBreakHeadingComponents2D.size() > 0) {
0242:                                if (_contMessage != null
0243:                                        && lastBreak != _firstRowOnPage)
0244:                                    _contMessage.setVisible(true);
0245:
0246:                                generateHtmlForBand(
0247:                                        _controlBreakHeadingComponents2D, p,
0248:                                        backgroundColor, maxSize, false,
0249:                                        lastBreak, lastBreak, "TD");
0250:                                backgroundColor = getBackgroundColor(backgroundColor);
0251:                            }
0252:                        } else if (_ds.compareRows(lastBreak, j, _breakColumns) != 0) {
0253:                            if (_controlBreakFooterComponents2D.size() > 0) {
0254:                                generateHtmlForBand(
0255:                                        _controlBreakFooterComponents2D, p,
0256:                                        backgroundColor, maxSize, false,
0257:                                        lastBreak, j - 1, "TD");
0258:                                backgroundColor = getBackgroundColor(backgroundColor);
0259:                            }
0260:                            if (_controlBreakHeadingComponents2D.size() > 0) {
0261:                                generateHtmlForBand(
0262:                                        _controlBreakHeadingComponents2D, p,
0263:                                        backgroundColor, maxSize, false, j, j,
0264:                                        "TD");
0265:                                backgroundColor = getBackgroundColor(backgroundColor);
0266:                            }
0267:                            lastBreak = j;
0268:                        }
0269:                    }
0270:
0271:                    processPropertyExpressions(j);
0272:
0273:                    //do the rows and columns
0274:                    for (int row = 0; row < _rowComponents2D.getRowCount(); row++) {
0275:                        p.println("<TR>");
0276:                        for (int col = 0; col < _rowComponents2D
0277:                                .getColumnCount(); col++) {
0278:                            int addTo = 0;
0279:                            td.setLength(0);
0280:                            td.append("<TD");
0281:
0282:                            int width = getColumnWidth(col);
0283:                            if (width > 0) {
0284:                                td.append(" WIDTH=\"" + width);
0285:                                if (_sizeOption == SIZE_PERCENT)
0286:                                    td.append("%");
0287:                                td.append("\"");
0288:                            }
0289:
0290:                            TwoObjectContainer cont = (TwoObjectContainer) _rowComponents2D
0291:                                    .elementAt(row, col);
0292:
0293:                            HtmlComponent comp = null;
0294:                            HtmlTableCellProperties props = null;
0295:
0296:                            if (cont != null) {
0297:                                comp = (HtmlComponent) cont.getObject1();
0298:                                props = (HtmlTableCellProperties) cont
0299:                                        .getObject2();
0300:                            }
0301:
0302:                            if (props != null) {
0303:                                if (props.getAlign() != null)
0304:                                    if (!props.getAlign().equals(ALIGN_NONE))
0305:                                        td.append(" ALIGN=\""
0306:                                                + props.getAlign() + "\"");
0307:
0308:                                if (props.getVertAlign() != null)
0309:                                    if (!props.getVertAlign().equals(
0310:                                            VALIGN_NONE))
0311:                                        td.append(" VALIGN=\""
0312:                                                + props.getVertAlign() + "\"");
0313:
0314:                                if (props.getBackgroundColor() != null)
0315:                                    if (!props.getBackgroundColor().equals(""))
0316:                                        backgroundColor = props
0317:                                                .getBackgroundColor();
0318:
0319:                                if (!props.getWrap())
0320:                                    td.append(" NOWRAP");
0321:
0322:                                if (props.getColumnSpan() > 1) {
0323:                                    td.append(" COLSPAN=\""
0324:                                            + props.getColumnSpan() + "\"");
0325:                                    addTo = props.getColumnSpan() - 1;
0326:                                }
0327:                            }
0328:
0329:                            if (backgroundColor != null)
0330:                                if (!backgroundColor.equals(""))
0331:                                    td.append(" BGCOLOR=\"" + backgroundColor
0332:                                            + "\"");
0333:
0334:                            td.append('>');
0335:                            p.println(td.toString());
0336:
0337:                            if (comp != null)
0338:                                comp.generateHTML(p, j);
0339:                            else
0340:                                p.println("&nbsp;");
0341:
0342:                            p.println("</TD>");
0343:                            col += addTo;
0344:                        }
0345:                        p.println("</TR>");
0346:                    }
0347:                }
0348:
0349:                int nextRow = _firstRowOnPage + rowsPerPage;
0350:                if (_breakColumns != null) {
0351:                    if (nextRow >= _ds.getRowCount()) {
0352:                        if (_controlBreakFooterComponents2D.size() > 0) {
0353:                            backgroundColor = getBackgroundColor(backgroundColor);
0354:                            generateHtmlForBand(
0355:                                    _controlBreakFooterComponents2D, p,
0356:                                    backgroundColor, maxSize, false, lastBreak,
0357:                                    _ds.getRowCount() - 1, "TD");
0358:                        }
0359:                    } else if (_ds.compareRows(lastBreak, nextRow,
0360:                            _breakColumns) != 0) {
0361:                        if (_controlBreakFooterComponents2D.size() > 0) {
0362:                            backgroundColor = getBackgroundColor(backgroundColor);
0363:                            generateHtmlForBand(
0364:                                    _controlBreakFooterComponents2D, p,
0365:                                    backgroundColor, maxSize, false, lastBreak,
0366:                                    nextRow - 1, "TD");
0367:                        }
0368:                    }
0369:                }
0370:
0371:                if (_footerComponents2D.size() > 0
0372:                        && nextRow >= _ds.getRowCount()) {
0373:                    backgroundColor = getBackgroundColor(backgroundColor);
0374:                    generateHtmlForBand(_footerComponents2D, p,
0375:                            backgroundColor, maxSize, false, "TD");
0376:                }
0377:
0378:                int rowCount = _ds.getRowCount();
0379:                if (rowCount > rowsPerPage) {
0380:                    if (_pageSelectRenderer == null) {
0381:                        if (_pageButtonType == PAGE_BUTTON_TYPE_SUBMIT)
0382:                            _pageSelectRenderer = DataTablePageSelectRenderer
0383:                                    .getSubmitButtonRenderer();
0384:                        else if (_pageButtonType == PAGE_BUTTON_TYPE_IMAGE)
0385:                            _pageSelectRenderer = DataTablePageSelectRenderer
0386:                                    .getImageButtonRenderer();
0387:                        else
0388:                            _pageSelectRenderer = DataTablePageSelectRenderer
0389:                                    .getLinkRenderer();
0390:                    }
0391:                    backgroundColor = getBackgroundColor(backgroundColor);
0392:                    p.println("<TR><TD VALIGN=\"MIDDLE\" COLSPAN=\""
0393:                            + _rowComponents2D.size() + "\"" + " BGCOLOR=\""
0394:                            + backgroundColor + "\">");
0395:                    int noButtons = (rowCount / rowsPerPage);
0396:                    if (rowCount % rowsPerPage > 0)
0397:                        noButtons++;
0398:                    int page = (_firstRowOnPage / rowsPerPage) + 1;
0399:                    p.println(_pageSelectRenderer.generateRowSelector(this ,
0400:                            _theme, "Page", "of", page, _firstSubmitButton,
0401:                            noButtons, _maxPageButtons, _imageURL));
0402:                    p.println("</TD></TR>");
0403:                }
0404:
0405:                if (rowPerPageSel && rowCount > 10) {
0406:                    if (_rowsPerPageRenderer == null)
0407:                        _rowsPerPageRenderer = DataTableRowsPerPageRenderer
0408:                                .getDefaultRenderer();
0409:                    backgroundColor = getBackgroundColor(backgroundColor);
0410:                    p.println("<TR><TD VALIGN=\"MIDDLE\" COLSPAN=\""
0411:                            + _rowComponents2D.size() + "\"" + " BGCOLOR=\""
0412:                            + backgroundColor + "\">");
0413:                    p.println(_rowsPerPageRenderer.generateRowSelector(this ,
0414:                            _theme, "Total Rows", "Rows displayed per page",
0415:                            _summaryRowText, rowsPerPage, rowCount));
0416:                    p.println("</TD></TR>");
0417:                }
0418:
0419:                p.println("</TABLE>");
0420:
0421:                if (_center)
0422:                    p.print("</CENTER>");
0423:
0424:                if (_scroll) {
0425:                    _scroll = false;
0426:                }
0427:
0428:                _didSubmit = false;
0429:            }
0430:
0431:            private void generateHtmlForBand(Vector2D components,
0432:                    PrintWriter p, String bgColor, int maxSize,
0433:                    boolean clickSort, int startRow, int endRow, String cellType)
0434:                    throws Exception {
0435:
0436:                processPropertyExpressions(endRow);
0437:
0438:                StringBuffer td = new StringBuffer();
0439:                for (int row = 0; row < components.getRowCount(); row++) {
0440:                    p.println("<TR>");
0441:                    int addTo = 0;
0442:                    for (int col = 0; col < maxSize; col++) {
0443:                        td.setLength(0);
0444:                        td.append("<");
0445:                        td.append(cellType);
0446:
0447:                        int width = getColumnWidth(col);
0448:                        if (width > 0) {
0449:                            td.append(" WIDTH=\"" + width);
0450:                            if (_sizeOption == SIZE_PERCENT)
0451:                                td.append("%");
0452:                            td.append("\"");
0453:                        }
0454:
0455:                        TwoObjectContainer cont = null;
0456:                        if (col < components.getColumnCount())
0457:                            cont = (TwoObjectContainer) components.elementAt(
0458:                                    row, col);
0459:
0460:                        HtmlComponent comp = null;
0461:                        HtmlTableCellProperties props = null;
0462:
0463:                        if (cont != null) {
0464:                            comp = (HtmlComponent) cont.getObject1();
0465:                            props = (HtmlTableCellProperties) cont.getObject2();
0466:                        }
0467:
0468:                        String backgroundColor = bgColor;
0469:                        if (props != null) {
0470:                            if (props.getAlign() != null)
0471:                                if (!props.getAlign().equals(ALIGN_NONE))
0472:                                    td.append(" ALIGN=\"" + props.getAlign()
0473:                                            + "\"");
0474:
0475:                            if (props.getVertAlign() != null)
0476:                                if (!props.getVertAlign().equals(VALIGN_NONE))
0477:                                    td.append(" VALIGN=\""
0478:                                            + props.getVertAlign() + "\"");
0479:
0480:                            if (props.getBackgroundColor() != null)
0481:                                if (!props.getBackgroundColor().equals(""))
0482:                                    backgroundColor = props
0483:                                            .getBackgroundColor();
0484:
0485:                            if (!props.getWrap())
0486:                                td.append(" NOWRAP");
0487:
0488:                            if (props.getColumnSpan() > 1) {
0489:                                td.append(" COLSPAN=\"" + props.getColumnSpan()
0490:                                        + "\"");
0491:                                addTo = props.getColumnSpan() - 1;
0492:                            }
0493:                        }
0494:
0495:                        if (backgroundColor != null)
0496:                            if (!backgroundColor.equals(""))
0497:                                td.append(" BGCOLOR=\"" + backgroundColor
0498:                                        + "\"");
0499:                        td.append('>');
0500:
0501:                        p.println(td.toString());
0502:                        if (comp != null) {
0503:                            boolean underLine = false;
0504:                            if (col < _rowComponents2D.getColumnCount()
0505:                                    && row < _rowComponents2D.getRowCount())
0506:                                if (clickSort
0507:                                        && _rowComponents2D.elementAt(row, col) != null)
0508:                                    underLine = true;
0509:
0510:                            if (underLine)
0511:                                p.print("<A HREF=\"javascript:" + getFullName()
0512:                                        + "_clickSort("
0513:                                        + components.indexAt(row, col)
0514:                                        + ");\">");
0515:                            if (startRow > -1)
0516:                                comp.generateHTML(p, startRow, endRow);
0517:                            else
0518:                                comp.generateHTML(p, -1);
0519:
0520:                            if (underLine)
0521:                                p.print("</A>");
0522:                        } else
0523:                            p.println("&nbsp;");
0524:                        p.print("</");
0525:                        p.print(cellType);
0526:                        p.println(">");
0527:                        col += addTo;
0528:                        addTo = 0;
0529:                    }
0530:                    p.println("</TR>");
0531:                }
0532:
0533:            }
0534:
0535:            private void generateHtmlForBand(Vector2D components,
0536:                    PrintWriter p, String bgColor, int maxSize,
0537:                    boolean clickSort, String cellType) throws Exception {
0538:                generateHtmlForBand(components, p, bgColor, maxSize, clickSort,
0539:                        -1, -1, cellType);
0540:            }
0541:
0542:            public void generateInitialHTML(PrintWriter p) throws Exception {
0543:                if (!_visible)
0544:                    return;
0545:
0546:                generateInitialHtmlForBand(_headingComponents2D, p);
0547:                generateInitialHtmlForBand(_rowComponents2D, p);
0548:                generateInitialHtmlForBand(_footerComponents2D, p);
0549:                generateInitialHtmlForBand(_controlBreakFooterComponents2D, p);
0550:                generateInitialHtmlForBand(_controlBreakHeadingComponents2D, p);
0551:
0552:            }
0553:
0554:            public void generateInitialHtmlForBand(Vector2D components,
0555:                    PrintWriter p) throws Exception {
0556:
0557:                for (int i = 0; i < components.size(); i++) {
0558:                    TwoObjectContainer cont = (TwoObjectContainer) components
0559:                            .elementAt(i);
0560:
0561:                    if (cont != null && cont.getObject1() != null)
0562:                        ((HtmlComponent) cont.getObject1())
0563:                                .generateInitialHTML(p);
0564:
0565:                }
0566:            }
0567:
0568:            /**
0569:             * This method returns all the elements in the container.
0570:             */
0571:            public Enumeration getComponents() {
0572:                Vector comp = new Vector();
0573:
0574:                for (int i = 0; i < _headingComponents2D.size(); i++) {
0575:                    TwoObjectContainer t = (TwoObjectContainer) _headingComponents2D
0576:                            .elementAt(i);
0577:                    if (t != null) {
0578:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0579:                        if (h != null)
0580:                            comp.addElement(h);
0581:                    }
0582:                }
0583:
0584:                for (int i = 0; i < _rowComponents2D.size(); i++) {
0585:                    TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0586:                            .elementAt(i);
0587:                    if (t != null) {
0588:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0589:                        if (h != null)
0590:                            comp.addElement(h);
0591:
0592:                    }
0593:                }
0594:
0595:                for (int i = 0; i < _footerComponents2D.size(); i++) {
0596:                    TwoObjectContainer t = (TwoObjectContainer) _footerComponents2D
0597:                            .elementAt(i);
0598:                    if (t != null) {
0599:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0600:                        if (h != null)
0601:                            comp.addElement(h);
0602:
0603:                    }
0604:                }
0605:
0606:                for (int i = 0; i < _controlBreakHeadingComponents2D.size(); i++) {
0607:                    TwoObjectContainer t = (TwoObjectContainer) _controlBreakHeadingComponents2D
0608:                            .elementAt(i);
0609:                    if (t != null) {
0610:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0611:                        if (h != null)
0612:                            comp.addElement(h);
0613:
0614:                    }
0615:                }
0616:
0617:                for (int i = 0; i < _controlBreakFooterComponents2D.size(); i++) {
0618:                    TwoObjectContainer t = (TwoObjectContainer) _controlBreakFooterComponents2D
0619:                            .elementAt(i);
0620:                    if (t != null) {
0621:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0622:                        if (h != null)
0623:                            comp.addElement(h);
0624:
0625:                    }
0626:                }
0627:
0628:                return comp.elements();
0629:            }
0630:
0631:            /**
0632:             * This method returns the heading component at the specified position or null if none is found.
0633:             */
0634:            public HtmlComponent getHeadingComponentAt(int row, int col) {
0635:                TwoObjectContainer t = (TwoObjectContainer) _headingComponents2D
0636:                        .elementAt(row, col);
0637:                if (t == null)
0638:                    return null;
0639:
0640:                return (HtmlComponent) t.getObject1();
0641:
0642:            }
0643:
0644:            /**
0645:             * This method returns the row component at the specified position or null if non is found.
0646:             */
0647:            public HtmlComponent getRowComponentAt(int row, int col) {
0648:                TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0649:                        .elementAt(row, col);
0650:                if (t == null)
0651:                    return null;
0652:
0653:                return (HtmlComponent) t.getObject1();
0654:
0655:            }
0656:
0657:            public boolean processParms(Hashtable parms, int rowNo)
0658:                    throws Exception {
0659:                if (!getVisible())
0660:                    return false;
0661:
0662:                for (int i = 0; i < _headingComponents2D.size(); i++) {
0663:                    TwoObjectContainer t = (TwoObjectContainer) _headingComponents2D
0664:                            .elementAt(i);
0665:                    if (t != null) {
0666:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0667:                        if (h != null)
0668:                            if (h.processParms(parms, -1))
0669:                                _submit = h;
0670:                    }
0671:                }
0672:
0673:                for (int j = _firstRowOnPage; (j < _ds.getRowCount())
0674:                        && (j < (_firstRowOnPage + _rowsPerPage)); j++) {
0675:                    processPropertyExpressions(j);
0676:                    for (int i = 0; i < _rowComponents2D.size(); i++) {
0677:                        TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0678:                                .elementAt(i);
0679:                        if (t != null) {
0680:                            HtmlComponent h = (HtmlComponent) t.getObject1();
0681:                            if (h != null)
0682:                                if (h.processParms(parms, j))
0683:                                    _submit = h;
0684:                        }
0685:                    }
0686:                }
0687:
0688:                for (int i = 0; i < _footerComponents2D.size(); i++) {
0689:                    TwoObjectContainer t = (TwoObjectContainer) _footerComponents2D
0690:                            .elementAt(i);
0691:                    if (t != null) {
0692:                        HtmlComponent h = (HtmlComponent) t.getObject1();
0693:                        if (h != null)
0694:                            if (h.processParms(parms, -1))
0695:                                _submit = h;
0696:                    }
0697:                }
0698:
0699:                for (int j = _firstRowOnPage; (j < _ds.getRowCount())
0700:                        && (j < (_firstRowOnPage + _rowsPerPage)); j++) {
0701:                    for (int i = 0; i < _controlBreakHeadingComponents2D.size(); i++) {
0702:                        TwoObjectContainer t = (TwoObjectContainer) _controlBreakHeadingComponents2D
0703:                                .elementAt(i);
0704:                        if (t != null) {
0705:                            HtmlComponent h = (HtmlComponent) t.getObject1();
0706:                            if (h != null)
0707:                                if (h.processParms(parms, j))
0708:                                    _submit = h;
0709:                        }
0710:                    }
0711:                }
0712:
0713:                int noButtons = _ds.getRowCount() / _rowsPerPage;
0714:                if (_ds.getRowCount() % _rowsPerPage > 0)
0715:                    noButtons++;
0716:
0717:                Object rpp = parms.get(getFullName() + "_rows_per_page_hidden");
0718:                if (rpp != null) {
0719:                    String val = ((String[]) rpp)[0];
0720:                    if (val.equals("1")) {
0721:                        rpp = parms.get(getFullName() + "row_per_page_dd");
0722:                        _newRowsPerPage = new Integer(((String[]) rpp)[0])
0723:                                .intValue();
0724:                        _submit = this ;
0725:                    } else if (!val.equals("-1")) {
0726:                        _newRowsPerPage = new Integer(val.trim()).intValue();
0727:                        _submit = this ;
0728:                    }
0729:                }
0730:
0731:                _newStartRow = -1;
0732:                _newFirstButton = -1;
0733:                _clickSortColumn = -1;
0734:                Object s1 = parms.get(getFullName() + "_SORTITEM");
0735:                String sort = "-1";
0736:                if (s1 != null)
0737:                    sort = ((String[]) s1)[0];
0738:
0739:                if (!sort.equals("-1")) {
0740:                    if (_breakColumns == null) {
0741:                        _newFirstButton = 0;
0742:                        _newStartRow = 0;
0743:                    }
0744:                    _clickSortColumn = Integer.parseInt(sort);
0745:                    _submit = this ;
0746:                }
0747:                if (parms.get(getFullName() + "_page_first") != null
0748:                        || parms.get(getFullName() + "_page_first.x") != null) {
0749:                    _newFirstButton = 0;
0750:                    _newStartRow = 0;
0751:                    _submit = this ;
0752:                } else if (parms.get(getFullName() + "_page_prior") != null
0753:                        || parms.get(getFullName() + "_page_prior.x") != null) {
0754:                    _newFirstButton = _firstSubmitButton
0755:                            - (_maxPageButtons == 0 ? 1 : _maxPageButtons);
0756:                    _submit = this ;
0757:                    if (_newFirstButton < 0)
0758:                        _newFirstButton = 0;
0759:                    _newStartRow = _rowsPerPage
0760:                            * (_newFirstButton
0761:                                    + (_maxPageButtons == 0 ? 1
0762:                                            : _maxPageButtons) - 1);
0763:                } else if (parms.get(getFullName() + "_page_next") != null
0764:                        || parms.get(getFullName() + "_page_next.x") != null) {
0765:                    _newFirstButton = _firstSubmitButton
0766:                            + (_maxPageButtons == 0 ? 1 : _maxPageButtons);
0767:                    _submit = this ;
0768:                    if ((_newFirstButton + _maxPageButtons) >= noButtons)
0769:                        _newFirstButton = (noButtons - (_maxPageButtons == 0 ? 1
0770:                                : _maxPageButtons));
0771:                    _newStartRow = _rowsPerPage * _newFirstButton;
0772:                } else if (parms.get(getFullName() + "_page_last") != null
0773:                        || parms.get(getFullName() + "_page_last.x") != null) {
0774:                    _submit = this ;
0775:                    _newFirstButton = (noButtons - (_maxPageButtons == 0 ? 1
0776:                            : _maxPageButtons));
0777:                    _newStartRow = _ds.getRowCount() - _rowsPerPage;
0778:                    if (_newStartRow < 0)
0779:                        _newStartRow = 0;
0780:                } else {
0781:                    for (int i = _firstSubmitButton; (i < noButtons)
0782:                            && ((i - _firstSubmitButton) < _maxPageButtons); i++) {
0783:                        if (parms.get(getFullName() + "_page_" + i) != null
0784:                                || parms.get(getFullName() + "_page_" + i
0785:                                        + ".x") != null) {
0786:                            _newStartRow = _rowsPerPage * i;
0787:                            _submit = this ;
0788:                            break;
0789:                        }
0790:                    }
0791:                }
0792:
0793:                if (_submit == null) {
0794:                    _scroll = false;
0795:                    return false;
0796:                } else {
0797:                    _scroll = _scrollOnSort;
0798:                    if (_scrollOnSort)
0799:                        getPage().scrollToItem(getFullName() + "TableStart");
0800:                    _didSubmit = true;
0801:                    return true;
0802:                }
0803:            }
0804:
0805:            /**
0806:             * Removes an html component from the heading container.
0807:             * @param comp The component to remove
0808:             */
0809:            public void removeHeadingComponent(HtmlComponent comp) {
0810:                for (int i = 0; i < _headingComponents2D.size(); i++) {
0811:                    TwoObjectContainer t = (TwoObjectContainer) _headingComponents2D
0812:                            .elementAt(i);
0813:                    HtmlComponent h = (HtmlComponent) t.getObject1();
0814:                    if (h == comp) {
0815:                        _headingComponents2D.setElementAt(i, null);
0816:                        return;
0817:                    }
0818:                }
0819:            }
0820:
0821:            /**
0822:             * Removes an html component from the row container.
0823:             * @param comp The component to remove
0824:             */
0825:            public void removeRowComponent(HtmlComponent comp) {
0826:                for (int i = 0; i < _rowComponents2D.size(); i++) {
0827:                    TwoObjectContainer t = (TwoObjectContainer) _rowComponents2D
0828:                            .elementAt(i);
0829:                    HtmlComponent h = (HtmlComponent) t.getObject1();
0830:                    if (h == comp) {
0831:                        _rowComponents2D.setElementAt(i, null);
0832:                        return;
0833:                    }
0834:                }
0835:            }
0836:
0837:            /**
0838:             * This method will remove all  Control Break Footer Components from the DataTable.
0839:             */
0840:            public void resetControlBreakFooterComponents() {
0841:                _controlBreakFooterComponents2D.removeAll();
0842:            }
0843:
0844:            /**
0845:             * This method will remove all Control Break Heading Components from the DataTable.
0846:             */
0847:            public void resetControlBreakHeadingComponents() {
0848:                _controlBreakHeadingComponents2D.removeAll();
0849:            }
0850:
0851:            /**
0852:             * This method will remove all Footer Components from the DataTable.
0853:             */
0854:            public void resetFooterComponents() {
0855:                _footerComponents2D.removeAll();
0856:            }
0857:
0858:            /**
0859:             * This method will remove all Heading Components from the DataTable.
0860:             */
0861:            public void resetHeadingComponents() {
0862:                _headingComponents2D.removeAll();
0863:            }
0864:
0865:            /**
0866:             * This method will remove all Row Components from the DataTable.
0867:             */
0868:            public void resetRowComponents() {
0869:                _rowComponents2D.removeAll();
0870:            }
0871:
0872:            /**
0873:             * Sets a control break footer component at a particular row position in the table.
0874:             */
0875:            public void setControlBreakFooterComponentAt(int row, int column,
0876:                    HtmlComponent comp) {
0877:                setControlBreakFooterComponentAt(row, column, comp, null);
0878:            }
0879:
0880:            /**
0881:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
0882:             */
0883:            public void setControlBreakFooterComponentAt(int row, int column,
0884:                    HtmlComponent comp, HtmlTableCellProperties props) {
0885:                if (column < 0)
0886:                    return;
0887:
0888:                TwoObjectContainer cont = new TwoObjectContainer(comp, props);
0889:
0890:                if (column >= _controlBreakFooterComponents2D.getColumnCount())
0891:                    _controlBreakFooterComponents2D
0892:                            .addColumns((column - _controlBreakFooterComponents2D
0893:                                    .getColumnCount()) + 1);
0894:                if (row >= _controlBreakFooterComponents2D.getRowCount())
0895:                    _controlBreakFooterComponents2D
0896:                            .addRows((row - _controlBreakFooterComponents2D
0897:                                    .getRowCount()) + 1);
0898:
0899:                _controlBreakFooterComponents2D.setElementAt(row, column, cont);
0900:
0901:                comp.setParent(this );
0902:
0903:            }
0904:
0905:            /**
0906:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
0907:             */
0908:            public void setControlBreakFooterComponentAt(int column,
0909:                    HtmlComponent comp) {
0910:                setControlBreakFooterComponentAt(0, column, comp, null);
0911:
0912:            }
0913:
0914:            /**
0915:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
0916:             */
0917:            public void setControlBreakFooterComponentAt(int column,
0918:                    HtmlComponent comp, HtmlTableCellProperties props) {
0919:                setControlBreakFooterComponentAt(0, column, comp, props);
0920:
0921:            }
0922:
0923:            /**
0924:             * Sets all the control break footer components on a particular row in the table.
0925:             * If you want to use HtmlTableCellProperties you will have to use setControlBreakFooterComponentAt(int,HtmlComponent,HtmlTableCellProperties)
0926:             */
0927:            public void setControlBreakFooterComponents(HtmlComponent comp[][]) {
0928:                for (int row = 0; row < comp.length; row++) {
0929:                    for (int col = 0; col < comp[row].length; col++)
0930:                        setControlBreakFooterComponentAt(row, col,
0931:                                comp[row][col], null);
0932:                }
0933:            }
0934:
0935:            /**
0936:             * Sets all the control break footer components on a particular row in the table.
0937:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
0938:             * with the ones that do not need cell props it as null.
0939:             */
0940:            public void setControlBreakFooterComponents(HtmlComponent comp[][],
0941:                    HtmlTableCellProperties props[][]) {
0942:                for (int row = 0; row < comp.length; row++) {
0943:                    for (int col = 0; col < comp[row].length; col++)
0944:                        setControlBreakFooterComponentAt(row, col,
0945:                                comp[row][col], props[row][col]);
0946:                }
0947:            }
0948:
0949:            /**
0950:             * Sets all the control break footer components on a particular row in the table.
0951:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
0952:             * with the ones that do not need cell props it as null.
0953:             */
0954:            public void setControlBreakFooterComponents(HtmlComponent comp[]) {
0955:                for (int col = 0; col < comp.length; col++)
0956:                    setControlBreakFooterComponentAt(0, col, comp[col], null);
0957:            }
0958:
0959:            /**
0960:             * Sets all the control break footer components on a particular row in the table.
0961:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
0962:             * with the ones that do not need cell props it as null.
0963:             */
0964:            public void setControlBreakFooterComponents(HtmlComponent comp[],
0965:                    HtmlTableCellProperties props[]) {
0966:                for (int col = 0; col < comp.length; col++)
0967:                    setControlBreakFooterComponentAt(0, col, comp[col],
0968:                            props[col]);
0969:            }
0970:
0971:            /**
0972:             * Sets a control break heading component at a particular row position in the table.
0973:             */
0974:            public void setControlBreakHeadingComponentAt(int row, int column,
0975:                    HtmlComponent comp) {
0976:                setControlBreakHeadingComponentAt(row, column, comp, null);
0977:            }
0978:
0979:            /**
0980:             * Sets a control break heading component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
0981:             */
0982:            public void setControlBreakHeadingComponentAt(int row, int column,
0983:                    HtmlComponent comp, HtmlTableCellProperties props) {
0984:                TwoObjectContainer cont = new TwoObjectContainer(comp, props);
0985:
0986:                if (column >= _controlBreakHeadingComponents2D.getColumnCount())
0987:                    _controlBreakHeadingComponents2D
0988:                            .addColumns((column - _controlBreakHeadingComponents2D
0989:                                    .getColumnCount()) + 1);
0990:                if (row >= _controlBreakHeadingComponents2D.getRowCount())
0991:                    _controlBreakHeadingComponents2D
0992:                            .addRows((row - _controlBreakHeadingComponents2D
0993:                                    .getRowCount()) + 1);
0994:
0995:                _controlBreakHeadingComponents2D
0996:                        .setElementAt(row, column, cont);
0997:
0998:                comp.setParent(this );
0999:
1000:            }
1001:
1002:            /**
1003:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1004:             */
1005:            public void setControlBreakHeadingComponentAt(int column,
1006:                    HtmlComponent comp) {
1007:                setControlBreakHeadingComponentAt(0, column, comp, null);
1008:
1009:            }
1010:
1011:            /**
1012:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1013:             */
1014:            public void setControlBreakHeadingComponentAt(int column,
1015:                    HtmlComponent comp, HtmlTableCellProperties props) {
1016:                setControlBreakHeadingComponentAt(0, column, comp, props);
1017:
1018:            }
1019:
1020:            /**
1021:             * Sets all the control break heading components on a particular row in the table.
1022:             * If you want to use HtmlTableCellProperties you will have to use setControlBreakHeadingComponentAt(int,HtmlComponent,HtmlTableCellProperties)
1023:             */
1024:            public void setControlBreakHeadingComponents(HtmlComponent comp[][]) {
1025:                for (int row = 0; row < comp.length; row++) {
1026:                    for (int col = 0; col < comp[row].length; col++)
1027:                        setControlBreakHeadingComponentAt(row, col,
1028:                                comp[row][col], null);
1029:                }
1030:            }
1031:
1032:            /**
1033:             * Sets all the control break heading components on a particular row in the table.
1034:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1035:             * with the ones that do not need cell props it as null.
1036:             */
1037:            public void setControlBreakHeadingComponents(
1038:                    HtmlComponent comp[][], HtmlTableCellProperties props[][]) {
1039:                for (int row = 0; row < comp.length; row++) {
1040:                    for (int col = 0; col < comp[row].length; col++)
1041:                        setControlBreakHeadingComponentAt(row, col,
1042:                                comp[row][col], props[row][col]);
1043:                }
1044:            }
1045:
1046:            /**
1047:             * Sets all the control break heading components on a particular row in the table.
1048:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1049:             * with the ones that do not need cell props it as null.
1050:             */
1051:            public void setControlBreakHeadingComponents(HtmlComponent comp[]) {
1052:                for (int col = 0; col < comp.length; col++)
1053:                    setControlBreakHeadingComponentAt(0, col, comp[col], null);
1054:            }
1055:
1056:            /**
1057:             * Sets all the control break heading components on a particular row in the table.
1058:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1059:             * with the ones that do not need cell props it as null.
1060:             */
1061:            public void setControlBreakHeadingComponents(HtmlComponent comp[],
1062:                    HtmlTableCellProperties props[]) {
1063:                for (int col = 0; col < comp.length; col++)
1064:                    setControlBreakHeadingComponentAt(0, col, comp[col],
1065:                            props[col]);
1066:            }
1067:
1068:            /**
1069:             * Sets a footer component at a particular row position in the table.
1070:             */
1071:            public void setFooterComponentAt(int row, int column,
1072:                    HtmlComponent comp) {
1073:                setFooterComponentAt(row, column, comp, null);
1074:            }
1075:
1076:            /**
1077:             * Sets a footer component at a particular row position in the table. The cell in the table will use properties specified in the props argument.
1078:             */
1079:            public void setFooterComponentAt(int row, int column,
1080:                    HtmlComponent comp, HtmlTableCellProperties props) {
1081:                TwoObjectContainer cont = new TwoObjectContainer(comp, props);
1082:
1083:                if (column >= _footerComponents2D.getColumnCount())
1084:                    _footerComponents2D
1085:                            .addColumns((column - _footerComponents2D
1086:                                    .getColumnCount()) + 1);
1087:                if (row >= _footerComponents2D.getRowCount())
1088:                    _footerComponents2D.addRows((row - _footerComponents2D
1089:                            .getRowCount()) + 1);
1090:
1091:                _footerComponents2D.setElementAt(row, column, cont);
1092:
1093:                if (comp != null)
1094:                    comp.setParent(this );
1095:
1096:            }
1097:
1098:            /**
1099:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1100:             */
1101:            public void setFooterComponentAt(int column, HtmlComponent comp) {
1102:                setFooterComponentAt(0, column, comp, null);
1103:
1104:            }
1105:
1106:            /**
1107:             * Sets a footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1108:             */
1109:            public void setFooterComponentAt(int column, HtmlComponent comp,
1110:                    HtmlTableCellProperties props) {
1111:                setFooterComponentAt(0, column, comp, props);
1112:
1113:            }
1114:
1115:            /**
1116:             * Sets all the footer components on a particular row in the table.
1117:             * If you want to use HtmlTableCellProperties you will have to use setFooterComponentAt(int,HtmlComponent,HtmlTableCellProperties)
1118:             */
1119:            public void setFooterComponents(HtmlComponent comp[][]) {
1120:                for (int row = 0; row < comp.length; row++) {
1121:                    for (int col = 0; col < comp[row].length; col++)
1122:                        setFooterComponentAt(row, col, comp[row][col], null);
1123:                }
1124:            }
1125:
1126:            /**
1127:             * Sets all the footer components on a particular row in the table.
1128:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1129:             * with the ones that do not need cell props it as null.
1130:             */
1131:            public void setFooterComponents(HtmlComponent comp[][],
1132:                    HtmlTableCellProperties props[][]) {
1133:                for (int row = 0; row < comp.length; row++) {
1134:                    for (int col = 0; col < comp[row].length; col++)
1135:                        setFooterComponentAt(row, col, comp[row][col],
1136:                                props[row][col]);
1137:                }
1138:            }
1139:
1140:            /**
1141:             * Sets all the footer components on a particular row in the table.
1142:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1143:             * with the ones that do not need cell props it as null.
1144:             */
1145:            public void setFooterComponents(HtmlComponent comp[]) {
1146:                for (int col = 0; col < comp.length; col++)
1147:                    setFooterComponentAt(0, col, comp[col], null);
1148:            }
1149:
1150:            /**
1151:             * Sets all the footer components on a particular row in the table.
1152:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1153:             * with the ones that do not need cell props it as null.
1154:             */
1155:            public void setFooterComponents(HtmlComponent comp[],
1156:                    HtmlTableCellProperties props[]) {
1157:                for (int col = 0; col < comp.length; col++)
1158:                    setFooterComponentAt(0, col, comp[col], props[col]);
1159:            }
1160:
1161:            /**
1162:             * Sets a heading component at a particular row position in the table.
1163:             */
1164:            public void setHeadingComponentAt(int row, int column,
1165:                    HtmlComponent comp) {
1166:                setHeadingComponentAt(row, column, comp, null);
1167:            }
1168:
1169:            /**
1170:             * Sets a heading component at a particular row position in the table. The cell in the table will use properties specified in the props argument.
1171:             */
1172:            public void setHeadingComponentAt(int row, int column,
1173:                    HtmlComponent comp, HtmlTableCellProperties props) {
1174:                TwoObjectContainer cont = new TwoObjectContainer(comp, props);
1175:
1176:                if (column >= _headingComponents2D.getColumnCount())
1177:                    _headingComponents2D
1178:                            .addColumns((column - _headingComponents2D
1179:                                    .getColumnCount()) + 1);
1180:                if (row >= _headingComponents2D.getRowCount())
1181:                    _headingComponents2D.addRows((row - _headingComponents2D
1182:                            .getRowCount()) + 1);
1183:
1184:                _headingComponents2D.setElementAt(row, column, cont);
1185:
1186:                if (comp != null)
1187:                    comp.setParent(this );
1188:
1189:            }
1190:
1191:            /**
1192:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1193:             */
1194:            public void setHeadingComponentAt(int column, HtmlComponent comp) {
1195:                setHeadingComponentAt(0, column, comp, null);
1196:
1197:            }
1198:
1199:            /**
1200:             * Sets a heading component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1201:             */
1202:            public void setHeadingComponentAt(int column, HtmlComponent comp,
1203:                    HtmlTableCellProperties props) {
1204:                setHeadingComponentAt(0, column, comp, props);
1205:
1206:            }
1207:
1208:            /**
1209:             * Sets all the heading components on a particular row in the table.
1210:             * If you want to use HtmlTableCellProperties you wil have to use setHeadingComponentAt(int,HtmlComponent,HtmlTableCellProperties)
1211:             */
1212:
1213:            public void setHeadingComponents(HtmlComponent comp[][]) {
1214:                for (int row = 0; row < comp.length; row++) {
1215:                    for (int col = 0; col < comp[row].length; col++)
1216:                        setHeadingComponentAt(row, col, comp[row][col], null);
1217:                }
1218:            }
1219:
1220:            /**
1221:             * Sets all the heading components on a particular row in the table.
1222:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1223:             * with the ones that do not need cell props it as null.
1224:             */
1225:
1226:            public void setHeadingComponents(HtmlComponent comp[][],
1227:                    HtmlTableCellProperties props[][]) {
1228:                for (int row = 0; row < comp.length; row++) {
1229:                    for (int col = 0; col < comp[row].length; col++)
1230:                        setHeadingComponentAt(row, col, comp[row][col],
1231:                                props[row][col]);
1232:                }
1233:
1234:            }
1235:
1236:            /**
1237:             * Sets all the heading components on a particular row in the table.
1238:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1239:             * with the ones that do not need cell props it as null.
1240:             */
1241:            public void setHeadingComponents(HtmlComponent comp[]) {
1242:                for (int col = 0; col < comp.length; col++)
1243:                    setHeadingComponentAt(0, col, comp[col], null);
1244:            }
1245:
1246:            /**
1247:             * Sets all the heading components on a particular row in the table.
1248:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1249:             * with the ones that do not need cell props it as null.
1250:             */
1251:            public void setHeadingComponents(HtmlComponent comp[],
1252:                    HtmlTableCellProperties props[]) {
1253:                for (int col = 0; col < comp.length; col++)
1254:                    setHeadingComponentAt(0, col, comp[col], props[col]);
1255:            }
1256:
1257:            /**
1258:             * Sets a row component at a particular row position in the table.
1259:             */
1260:            public void setRowComponentAt(int row, int column,
1261:                    HtmlComponent comp) {
1262:                setRowComponentAt(row, column, comp, null);
1263:            }
1264:
1265:            /**
1266:             * Sets a row component at a particular row position in the table. The cell in the table will use properties specified in the props argument.
1267:             */
1268:            public void setRowComponentAt(int row, int column,
1269:                    HtmlComponent comp, HtmlTableCellProperties props) {
1270:                TwoObjectContainer cont = new TwoObjectContainer(comp, props);
1271:
1272:                if (column >= _rowComponents2D.getColumnCount())
1273:                    _rowComponents2D.addColumns((column - _rowComponents2D
1274:                            .getColumnCount()) + 1);
1275:                if (row >= _rowComponents2D.getRowCount())
1276:                    _rowComponents2D.addRows((row - _rowComponents2D
1277:                            .getRowCount()) + 1);
1278:
1279:                _rowComponents2D.setElementAt(row, column, cont);
1280:
1281:                if (comp != null)
1282:                    comp.setParent(this );
1283:
1284:            }
1285:
1286:            /**
1287:             * Sets a control break footer component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1288:             */
1289:            public void setRowComponentAt(int column, HtmlComponent comp) {
1290:                setRowComponentAt(0, column, comp, null);
1291:
1292:            }
1293:
1294:            /**
1295:             * Sets a row component at a particular column position in the table. The cell in the table will use properties specified in the props argument.
1296:             */
1297:            public void setRowComponentAt(int column, HtmlComponent comp,
1298:                    HtmlTableCellProperties props) {
1299:                setRowComponentAt(0, column, comp, props);
1300:
1301:            }
1302:
1303:            /**
1304:             * Sets a row component at a particular row position in the table.
1305:             */
1306:            public void setRowComponents(HtmlComponent comp[][]) {
1307:                for (int row = 0; row < comp.length; row++) {
1308:                    for (int col = 0; col < comp[row].length; col++)
1309:                        setRowComponentAt(row, col, comp[row][col], null);
1310:                }
1311:            }
1312:
1313:            /**
1314:             * Sets a row component at a particular row position in the table.
1315:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1316:             * with the ones that do not need cell props it as null.
1317:             */
1318:            public void setRowComponents(HtmlComponent comp[][],
1319:                    HtmlTableCellProperties props[][]) {
1320:                for (int row = 0; row < comp.length; row++) {
1321:                    for (int col = 0; col < comp[row].length; col++)
1322:                        setRowComponentAt(row, col, comp[row][col],
1323:                                props[row][col]);
1324:                }
1325:            }
1326:
1327:            /**
1328:             * Sets all the row components on a particular row in the table.
1329:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1330:             * with the ones that do not need cell props it as null.
1331:             */
1332:            public void setRowComponents(HtmlComponent comp[]) {
1333:                for (int col = 0; col < comp.length; col++)
1334:                    setRowComponentAt(0, col, comp[col], null);
1335:            }
1336:
1337:            /**
1338:             * Sets all the row components on a particular row in the table.
1339:             * If you want to use HtmlTableCellProperties pass an array of HtmlTableCellProperties
1340:             * with the ones that do not need cell props it as null.
1341:             */
1342:            public void setRowComponents(HtmlComponent comp[],
1343:                    HtmlTableCellProperties props[]) {
1344:                for (int col = 0; col < comp.length; col++)
1345:                    setRowComponentAt(0, col, comp[col], props[col]);
1346:            }
1347:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.