Source Code Cross Referenced for BasePanelessRcthTreeConsolePageContext.java in  » Workflow-Engines » JFolder » org » jfolder » console » base » context » 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 » Workflow Engines » JFolder » org.jfolder.console.base.context 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.console.base.context;
009:
010:        //base classes
011:        import java.io.IOException;
012:        import java.util.ArrayList;
013:        import java.util.HashMap;
014:
015:        //project specific classes
016:        import org.jfolder.common.UnexpectedSystemException;
017:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
018:        import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
019:        import org.jfolder.common.tagging.ConceptTagConstraint;
020:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
021:        import org.jfolder.common.tagging.ConceptTagHelper;
022:        import org.jfolder.common.tagging.ConceptTagMessageHolder;
023:        import org.jfolder.common.tagging.ConceptTagPreferences;
024:        import org.jfolder.common.tagging.RootConceptTagHolder;
025:        import org.jfolder.common.utils.misc.MiscHelper;
026:        import org.jfolder.common.utils.xml.XMLHelper;
027:        import org.jfolder.common.web.template.ConsoleParameterContext;
028:        import org.jfolder.common.web.template.SubmitActionContext;
029:        import org.jfolder.common.web.template.SubmitActionParameters;
030:        import org.jfolder.console.base.ConsolePageContext;
031:        import org.jfolder.console.base.ConsolePageHelper;
032:        import org.jfolder.console.base.ConsolePageParameters;
033:        import org.jfolder.console.base.ConsolePageSession;
034:        import org.jfolder.console.base.NamesForSubCpc;
035:
036:        //other classes
037:
038:        public class BasePanelessRcthTreeConsolePageContext extends
039:                BaseSubPaneContentConsolePageContext {
040:
041:            //
042:            //private final static int NODE_INDENT = 5;
043:            //
044:            private final static String STATIC_IMAGE__TREE_BRANCH = "STATIC_IMAGE__TREE_BRANCH";
045:            private final static String STATIC_IMAGE__TREE_BRANCH_ICON = "STATIC_IMAGE__TREE_BRANCH_ICON";
046:
047:            //
048:            private String sectionId = null;
049:            private int baseToggleLinkListLength = 0;
050:
051:            //
052:            public final static String OPEN_GIF = ConsolePageParameters.IMAGES_ROOT
053:                    + "/tree-open.gif";
054:            public final static String CLOSE_GIF = ConsolePageParameters.IMAGES_ROOT
055:                    + "/tree-close.gif";
056:            public final static String BLANK_GIF = ConsolePageParameters.IMAGES_ROOT
057:                    + "/tree-blank.gif";
058:
059:            //
060:            private BasePanelessRcthTreeConsolePageContext(
061:                    ConsolePageContext inCpc) {
062:
063:                super (inCpc, NamesForSubCpc.getBasePanelessRcthTreeCpcName());
064:                setColumnWidth(20);
065:
066:                //this.height = inHeight;
067:            }
068:
069:            public final static BasePanelessRcthTreeConsolePageContext newInstance(
070:                    ConsolePageContext inCpc) throws IOException {
071:
072:                BasePanelessRcthTreeConsolePageContext outValue = null;
073:
074:                if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
075:                        .getBasePanelessRcthTreeCpcName())) {
076:                    //
077:                    Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
078:                            .getBasePanelessRcthTreeCpcName());
079:                    outValue = (BasePanelessRcthTreeConsolePageContext) o;
080:                } else {
081:                    outValue = new BasePanelessRcthTreeConsolePageContext(inCpc);
082:                    inCpc.registerSubConsolePageContext(NamesForSubCpc
083:                            .getBasePanelessRcthTreeCpcName(), outValue);
084:                }
085:
086:                outValue.copyFromParent(inCpc);
087:                outValue.createConsolePage(inCpc.getWriter(), inCpc
088:                        .getPageSetupContext());
089:
090:                return outValue;
091:            }
092:
093:            //
094:            //
095:            //
096:            public final static void initializeGoToSac(
097:                    SubmitActionContext inSac, boolean inUseQuotes,
098:                    String inHandle) {
099:                //
100:                //
101:                inSac.addAction(ConsoleParameterContext.FIRST_INPUT,
102:                        singleQuotes(SubmitActionParameters.MOVE, inUseQuotes));
103:                //
104:                inSac.addParameter(ConsoleParameterContext.FIRST_INPUT,
105:                        singleQuotes(inHandle, inUseQuotes));
106:            }
107:
108:            public String getSectionId() {
109:                return this .sectionId;
110:            }
111:
112:            public String getDownShiftToHighlightHandle() {
113:                throw UnexpectedSystemException.unknownState();
114:            }
115:
116:            protected void renderConsolePage() throws IOException {
117:
118:                this .sectionId = getConsolePageSession().getToggleLink();
119:                //
120:                RootConceptTagHolder rcth = getConsolePageSession()
121:                        .getCurrentApplicationRootHolder();
122:                ConceptTagPreferences ctp = rcth.getPreferences();
123:                ConceptTagConstraintHolder ctconh = rcth
124:                        .getRootConstraintHolder();
125:
126:                String unconSymbol = ctp.getUnconstrainedSymbol();
127:                String rootConName = ctp.getRootConstraint();
128:                ConceptTagConstraint ctcon = null;
129:                if (!rootConName.equals(unconSymbol)) {
130:                    ctcon = ctconh.getConstraint(rootConName);
131:                } else {
132:                    ctcon = ctconh.getUndefinedConstraint();
133:                }
134:
135:                getConsolePageSession().pushToggleLinkTreeBase();
136:                this .baseToggleLinkListLength = getConsolePageSession()
137:                        .getToggleLinkAsArrayList().size();
138:                //
139:                //
140:                getConsolePageSession().registerCommonStem(
141:                        getConsolePageSession().getToggleLink());
142:                //alignTreeStateToCommonStem(getConsolePageSession());
143:                //
144:                //
145:                getConsolePageSession().pushToggleLink(ctp.getRootConstraint());
146:                getConsolePageSession().pushToggleLink("0");
147:                //
148:                //
149:                addDefaultTreeBranch(getConsolePageSession().getToggleLink());
150:                //
151:                renderConstraintHolder(ctcon.getConstraintHolder(0),
152:                        new ArrayList());
153:                //renderConstraintHolder(ctcon.getConstraintHolder(0),
154:                //    getTreeState(), new ArrayList());
155:                //
156:                getConsolePageSession().popToggleLink();
157:                getConsolePageSession().popToggleLink();
158:                //
159:                //
160:                //
161:                getConsolePageSession().popToggleLink();
162:            }
163:
164:            private void renderConstraint(ConceptTagConstraint inCtcon,
165:                    ArrayList inBranchDisplay) throws IOException {
166:
167:                ConceptTagCharacteristic ctchar = inCtcon.getCharacteristic();
168:                ConceptTagMessageHolder ctcharMh = ctchar
169:                        .getParentMessageHolder();
170:                //ConceptTagPreferences ctp = ctchar.getPreferences();
171:                //String hc = ctp.getHandleConjunction();
172:                //String unconstrainedName = ctp.getUnconstrainedSymbol();
173:
174:                if (inCtcon.isDisplayAsBranch()) {
175:                    Boolean branchOpen = null;
176:                    if (ctchar.getValueLength() > 0) {
177:                        //branchOpen = isBranchOpen(inOpenBranches);
178:                        branchOpen = isBranchOpen();
179:                    }
180:
181:                    String topNodeColor = getNodeColor(ctcharMh
182:                            .isErrorPresent(), ctcharMh.isWarningPresent()
183:                            || ConceptTagHelper
184:                                    .isErrorInMainOrSubPresent(ctchar));
185:                    //inCtcon.isParentSubErrorPresent());
186:                    createTreeNode(
187:                            inCtcon.getTitle(),
188:                            branchOpen,
189:                            topNodeColor,
190:                            (ConsolePageParameters.IMAGES_ROOT + "/folder.gif"),
191:                            inBranchDisplay);
192:
193:                    //
194:                    //int leftMargin = getLeftMargin();
195:                    //setLeftMargin(leftMargin + 1);
196:                    int branchValue = ctchar.getValueLength();
197:                    inBranchDisplay.add(new Integer(branchValue));
198:                    //
199:                    startAutoTogglingTableAndRowAndCell();
200:                }
201:
202:                for (int i = 0; i < ctchar.getValueLength(); i++) {
203:                    if (ctchar.isStatic(i, null)) {
204:
205:                        String topString = ctchar.getValueAsString(i, null);
206:
207:                        boolean staticError = false;
208:                        boolean staticWarning = false;
209:
210:                        int jCount = ctcharMh.getTotalIndexMessageCount(i);
211:                        for (int j = 0; j < jCount; j++) {
212:                            staticError |= ctcharMh.isErrorIndexMessage(i, j);
213:                            staticWarning |= ctcharMh.isWarningIndexMessage(i,
214:                                    j);
215:                        }
216:
217:                        String nodeColor = getNodeColor(staticError,
218:                                staticWarning);
219:                        //    inCtcon.isErrorPresent(i), inCtcon.isSubErrorPresent(i));
220:
221:                        getConsolePageSession().pushToggleLink(i + "");
222:                        createTreeNode(
223:                                topString,
224:                                null,
225:                                nodeColor,
226:                                (ConsolePageParameters.IMAGES_ROOT + "/text.gif"),
227:                                inBranchDisplay);
228:                        getConsolePageSession().popToggleLink();
229:                    } else if (ctchar.isHolder(i, null)) {
230:                        ConceptTagConstraintHolder ctconh = inCtcon
231:                                .getConstraintHolder(i);
232:                        getConsolePageSession().pushToggleLink(i + "");
233:                        renderConstraintHolder(ctconh, inBranchDisplay);
234:                        //renderConstraintHolder(ctconh, inOpenBranch, inBranchDisplay);
235:                        getConsolePageSession().popToggleLink();
236:                    } else {
237:                        //this case does not happen in this version
238:                        throw UnexpectedSystemException.unknownState();
239:                    }
240:                }
241:
242:                if (inCtcon.isDisplayAsBranch()) {
243:                    endEnclosingTableAndRowAndCell();
244:                    //
245:                    inBranchDisplay.remove(inBranchDisplay.size() - 1);
246:                }
247:                //setLeftMargin(leftMargin);
248:                //
249:            }
250:
251:            private void renderConstraintHolder(
252:                    ConceptTagConstraintHolder inCtconh,
253:                    //String inOpenBranches, ArrayList inBranchDisplay) throws IOException {
254:                    ArrayList inBranchDisplay) throws IOException {
255:
256:                ConceptTagCharacteristicHolder ctcharh = inCtconh
257:                        .getCharacteristicHolder();
258:                ConceptTagMessageHolder ctcharhMh = ctcharh
259:                        .getParentMessageHolder();
260:                //MiscHelper.println("BasPanlTree renConH isErr isParErr not impl");
261:                //
262:                //
263:                //
264:                //
265:                //
266:                //String candidateHandle =
267:                //    getConsoleSession().getToggleLinkSubSectionAsHandle(
268:                //        this.baseToggleLinkListLength);
269:                //String rootHandle = inCtconh.getPreferences().getRootHandle();
270:                //if (rootHandle.equals(candidateHandle)) {
271:                //}
272:                //
273:                //
274:                //
275:                //
276:                //
277:                //
278:                //
279:                ConceptTagConstraintHolder attrsCtconh = inCtconh
280:                        .getAttributes();
281:                boolean showAttrs = !ConsolePageHelper
282:                        .isConstraintHolderEmpty(attrsCtconh);
283:                //
284:                ConceptTagConstraintHolder styleCtconh = inCtconh.getStyles();
285:                boolean showStyle = !ConsolePageHelper
286:                        .isConstraintHolderEmpty(styleCtconh);
287:                //
288:                boolean showUndef = !ConsolePageHelper
289:                        .isConstraintEmpty(inCtconh.getUndefinedConstraint());
290:                //
291:                boolean showUndefAsBranch = false;
292:                if (inCtconh.getUndefinedConstraint() != null) {
293:                    ConceptTagCharacteristic undefCtchar = inCtconh
294:                            .getUndefinedConstraint().getCharacteristic();
295:                    showUndefAsBranch = (undefCtchar.getValueLength() > 0);
296:                }
297:                //(inCtconh.getUndefinedConstraint() != null
298:                //    && inCtconh.getUndefinedConstraint().getCharacteristic)
299:                //
300:                Boolean branchOpen = null;
301:                if (inCtconh.getConstraintCount() > 0
302:                        || (showAttrs || showStyle || showUndefAsBranch)) {
303:                    //branchOpen = isBranchOpen(inOpenBranches);
304:                    branchOpen = isBranchOpen();
305:                }
306:
307:                boolean errorInUnconstrained = false;
308:                if (ctcharh.getUndefinedCharacteristic() != null) {
309:                    //
310:                    ConceptTagCharacteristic undefCtchar = inCtconh
311:                            .getUndefinedConstraint().getCharacteristic();
312:                    errorInUnconstrained = undefCtchar.getParentMessageHolder()
313:                            .isErrorPresent();
314:                }
315:
316:                String nodeColor = getNodeColor(ctcharhMh.isErrorPresent()
317:                        || errorInUnconstrained, ctcharhMh.isWarningPresent()
318:                        || ConceptTagHelper.isErrorInMainOrSubPresent(ctcharh));
319:                //inCtconh.isParentSubErrorPresent());
320:                String icon = null;
321:                if (inCtconh.getCharacteristicHolder().isConceptTagPresent()) {
322:                    icon = inCtconh.getIcon();
323:                } else {
324:                    if (inCtconh.getIcon() != null) {
325:                        icon = inCtconh.getIcon();
326:                    } else {
327:                        icon = ConsolePageParameters.IMAGES_ROOT
328:                                + "/compound.gif";
329:                    }
330:                }
331:                createTreeNode(inCtconh.getTitle(), branchOpen, nodeColor,
332:                        icon, inBranchDisplay);
333:                //
334:                ConceptTagPreferences ctp = inCtconh.getPreferences();
335:                //String hc = ctp.getHandleConjunction();
336:                String unconName = ctp.getUnconstrainedSymbol();
337:                String attrsName = ctp.getAttributeConstraintName();
338:                String styleName = ctp.getStyleConstraintName();
339:                //
340:                int branchValue = 0;
341:                if (showAttrs) {
342:                    branchValue++;
343:                }
344:                if (showStyle) {
345:                    branchValue++;
346:                }
347:                for (int i = 0; i < inCtconh.getConstraintCount(); i++) {
348:                    ConceptTagConstraint nextCtcon = inCtconh.getConstraint(i);
349:                    branchValue = branchValue + getActualBranchCount(nextCtcon);
350:                }
351:                if (showUndef) {
352:                    branchValue = branchValue
353:                            + getActualBranchCount(inCtconh
354:                                    .getUndefinedConstraint());
355:                }
356:                inBranchDisplay.add(new Integer(branchValue));
357:                //
358:                //int leftMargin = getLeftMargin();
359:                //setLeftMargin(leftMargin + 1);
360:                startAutoTogglingTableAndRowAndCell();
361:                //
362:                //
363:                //
364:                ArrayList branchlessCtcons = new ArrayList();
365:                //
366:                if (showAttrs) {
367:                    getConsolePageSession().pushToggleLink(attrsName);
368:                    renderConstraintHolder(attrsCtconh, inBranchDisplay);
369:                    //    attrsCtconh, inOpenBranches, inBranchDisplay);
370:                    getConsolePageSession().popToggleLink();
371:                }
372:                if (showStyle) {
373:                    getConsolePageSession().pushToggleLink(styleName);
374:                    renderConstraintHolder(styleCtconh, inBranchDisplay);
375:                    //    styleCtconh, inOpenBranches, inBranchDisplay);
376:                    getConsolePageSession().popToggleLink();
377:                }
378:                for (int i = 0; i < inCtconh.getConstraintCount(); i++) {
379:                    ConceptTagConstraint nextCtcon = inCtconh.getConstraint(i);
380:                    getConsolePageSession().pushToggleLink(nextCtcon.getName());
381:                    if (isDisplayNow(nextCtcon, branchlessCtcons)) {
382:                        renderConstraint(nextCtcon, inBranchDisplay);
383:                    }
384:                    //renderConstraint(nextCtcon, inOpenBranch, inBranchDisplay, false);
385:                    getConsolePageSession().popToggleLink();
386:                }
387:                if (showUndef) {
388:                    ConceptTagConstraint undefCtcon = inCtconh
389:                            .getUndefinedConstraint();
390:                    getConsolePageSession().pushToggleLink(unconName);
391:                    if (isDisplayNow(undefCtcon, branchlessCtcons)) {
392:                        renderConstraint(undefCtcon, inBranchDisplay);
393:                    }
394:                    getConsolePageSession().popToggleLink();
395:                }
396:                //
397:                //
398:                //
399:                //process branchless here
400:                for (int i = 0; i < branchlessCtcons.size(); i++) {
401:                    //
402:                    ConceptTagConstraint nextCtcon = ((ConceptTagConstraint) branchlessCtcons
403:                            .get(i));
404:                    //
405:                    getConsolePageSession().pushToggleLink(nextCtcon.getName());
406:                    renderConstraint(nextCtcon, inBranchDisplay);
407:                    getConsolePageSession().popToggleLink();
408:                }
409:                //
410:                //
411:                endEnclosingTableAndRowAndCell();
412:                //
413:                inBranchDisplay.remove(inBranchDisplay.size() - 1);
414:                //setLeftMargin(leftMargin);
415:                //
416:            }
417:
418:            private final static int getActualBranchCount(
419:                    ConceptTagConstraint inCtcon) {
420:                //
421:                int outValue = 0;
422:
423:                if (inCtcon.isDisplayAsBranch()) {
424:                    outValue = 1;
425:                } else {
426:                    outValue = inCtcon.getCharacteristic().getValueLength();
427:                }
428:
429:                return outValue;
430:            }
431:
432:            private final static boolean isDisplayNow(
433:                    ConceptTagConstraint inCtcon, ArrayList inBranchlessCtcon) {
434:                //
435:                boolean outValue = true;
436:
437:                if (!inCtcon.isDisplayAsBranch()) {
438:
439:                    outValue = false;
440:
441:                    inBranchlessCtcon.add(inCtcon);
442:                }
443:
444:                return outValue;
445:            }
446:
447:            private void createTreeNode(String inLabel, Boolean inBranchOpen,
448:                    String inColor, String inIcon, ArrayList inBranchDisplay)
449:                    throws IOException {
450:
451:                startTable(20 + inBranchDisplay.size());
452:                startRow();
453:                if (!isMetaMode()) {
454:
455:                    ConsolePageSession localCps = getConsolePageSession();
456:                    if (inLabel != null) {
457:                        inLabel = XMLHelper.fromStringToCData(inLabel);
458:                    } else {
459:                        inLabel = "";
460:                    }
461:
462:                    //SubmitActionContext sacGoTo =
463:                    //    SubmitActionContext.newInstance(this);
464:                    //initializeGoToSac(
465:                    //    sacGoTo, true, localCps.getToggleLinkSubSectionAsHandle(
466:                    //        this.baseToggleLinkListLength));
467:                    //sacGoTo.setGoToPage(
468:                    //    ConsolePageParameters.SERVLET_WEB_STUDIO_FRAME);
469:                    //sacGoTo.setTarget(SubmitActionContext.TARGET_TOP);
470:                    //sacGoTo.setSourceFrame(ConsolePageParameters.SECTION_TAG);
471:
472:                    //"\" href=\"updateTargetAndSubmit('"
473:                    //+ inCurrentScriptTagHandle + "')
474:
475:                    for (int i = 0; i < inBranchDisplay.size(); i++) {
476:                        if (i < (inBranchDisplay.size() - 1)) {
477:                            Integer branchPresent = (Integer) inBranchDisplay
478:                                    .get(i);
479:                            if (branchPresent.intValue() > 0) {
480:                                //startAndEndCell(1, "|");
481:                                String nextIcon = ConsolePageParameters.IMAGES_ROOT
482:                                        + "/tree-up-down.gif";
483:                                startAndEndCell(1, "<img border=\"0\" src=\""
484:                                        + nextIcon + "\" height=\""
485:                                        + getColumnWidth() + "\" width=\""
486:                                        + getColumnWidth() + "\"/>");
487:                            } else {
488:                                //startAndEndCell(1, XMLHelper.NBSP_XML);
489:                                String nextIcon = ConsolePageParameters.IMAGES_ROOT
490:                                        + "/blank.gif";
491:                                startAndEndCell(1, "<img border=\"0\" src=\""
492:                                        + nextIcon + "\" height=\""
493:                                        + getColumnWidth() + "\" width=\""
494:                                        + getColumnWidth() + "\"/>");
495:                            }
496:                        } else {
497:                            int branchValue = ((Integer) inBranchDisplay.get(i))
498:                                    .intValue();
499:                            if (branchValue > 1) {
500:                                //startAndEndCell(1, "-");
501:                                String nextIcon = ConsolePageParameters.IMAGES_ROOT
502:                                        + "/tree-vertical-right.gif";
503:                                startAndEndCell(1, "<img border=\"0\" src=\""
504:                                        + nextIcon + "\" height=\""
505:                                        + getColumnWidth() + "\" width=\""
506:                                        + getColumnWidth() + "\"/>");
507:                            } else {
508:                                //startAndEndCell(1, "L");
509:                                String nextIcon = ConsolePageParameters.IMAGES_ROOT
510:                                        + "/tree-up-right.gif";
511:                                startAndEndCell(1, "<img border=\"0\" src=\""
512:                                        + nextIcon + "\" height=\""
513:                                        + getColumnWidth() + "\" width=\""
514:                                        + getColumnWidth() + "\"/>");
515:                            }
516:                            inBranchDisplay
517:                                    .set(i, new Integer(branchValue - 1));
518:                        }
519:                    }
520:                    //
521:                    String subBranchIconImage = null;
522:                    if (inBranchOpen == null) {
523:                        //
524:                        //
525:                        subBranchIconImage = "<img border=\"0\" src=\""
526:                                + BLANK_GIF + "\" height=\"" + getColumnWidth()
527:                                + "\" width=\"" + getColumnWidth() + "\"/>";
528:                    } else if (inBranchOpen.booleanValue()) {
529:                        //
530:                        HashMap branchAttrs = new HashMap();
531:                        branchAttrs.put("onclick",
532:                                "toggleSectionWithIcon(this, '"
533:                                        + getConsolePageSession()
534:                                                .getToggleLink() + "')");
535:                        branchAttrs.put("border", "0");
536:                        branchAttrs.put("height", getColumnWidth() + "");
537:                        branchAttrs.put("width", getColumnWidth() + "");
538:                        //
539:                        subBranchIconImage = createStaticImage(
540:                                STATIC_IMAGE__TREE_BRANCH, OPEN_GIF,
541:                                branchAttrs, null);
542:                        //
543:                        //subBranchIconImage =
544:                        //    "<img onclick=\"toggleSectionWithIcon(this, '"
545:                        //    + getConsolePageSession().getToggleLink()
546:                        //    + "')\" border=\"0\" src=\""
547:                        //    + OPEN_GIF + "\" height=\"" + getColumnWidth()
548:                        //    + "\" width=\"" + getColumnWidth() + "\"/>";
549:                    } else {
550:                        //
551:                        HashMap branchAttrs = new HashMap();
552:                        branchAttrs.put("onclick",
553:                                "toggleSectionWithIcon(this, '"
554:                                        + getConsolePageSession()
555:                                                .getToggleLink() + "')");
556:                        branchAttrs.put("border", "0");
557:                        branchAttrs.put("height", getColumnWidth() + "");
558:                        branchAttrs.put("width", getColumnWidth() + "");
559:                        //
560:                        subBranchIconImage = createStaticImage(
561:                                STATIC_IMAGE__TREE_BRANCH, CLOSE_GIF,
562:                                branchAttrs, null);
563:                        //subBranchIconImage =
564:                        //    "<img onclick=\"toggleSectionWithIcon(this, '"
565:                        //    + getConsolePageSession().getToggleLink()
566:                        //    + "')\" border=\"0\" src=\""
567:                        //    + CLOSE_GIF + "\" height=\"" + getColumnWidth()
568:                        //    + "\" width=\"" + getColumnWidth() + "\"/>";
569:                    }
570:                    startAndEndCell(1, subBranchIconImage);
571:                    //
572:                    HashMap nextIconImageAttrs = new HashMap();
573:                    nextIconImageAttrs.put("border", "0");
574:                    nextIconImageAttrs.put("height", getColumnWidth() + "");
575:                    nextIconImageAttrs.put("width", getColumnWidth() + "");
576:                    String nextIconImage = createStaticImage(
577:                            STATIC_IMAGE__TREE_BRANCH_ICON, inIcon,
578:                            nextIconImageAttrs, null);
579:                    //
580:                    startAndEndCell(
581:                            1,
582:                            "<a onmouseover=\"this.style.cursor = 'pointer';\""
583:                                    + " onmouseout=\"this.style.cursor = 'default';\""
584:                                    + " style=\"text-decoration: none; color: #"
585:                                    + inColor
586:                                    + ";\" title=\""
587:                                    + inLabel
588:                                    + "\" onclick=\""
589:                                    + "studioGoTo('"
590:                                    + localCps
591:                                            .getToggleLinkSubSectionAsHandle(this .baseToggleLinkListLength)
592:                                    + "')" + "\">" + nextIconImage + "</a>");
593:                    //    + sacGoTo.submitActionCall() + "\">"
594:                    //    + "<img border=\"0\" src=\""
595:                    //    + inIcon + "\" height=\"" + getColumnWidth()
596:                    //    + "\" width=\"" + getColumnWidth() + "\"/>" + "</a>");
597:                    //
598:                    String label = inLabel;
599:                    label = MiscHelper.shortenString(label, 15);
600:                    //if (getConsoleSession().getToggleLink().equals(inActiveHandle)) {
601:                    //    label = "<b>" + inLabel + "</b>";
602:                    //}
603:                    String nodeValue = "<a onmouseover=\"this.style.cursor = 'pointer';\""
604:                            + " onmouseout=\"this.style.cursor = 'default';\""
605:                            + " style=\"text-decoration: none; color: #"
606:                            + inColor
607:                            + ";\" title=\""
608:                            + inLabel
609:                            + "\" onclick=\""
610:                            + "studioGoTo('"
611:                            + localCps
612:                                    .getToggleLinkSubSectionAsHandle(this .baseToggleLinkListLength)
613:                            + "')" + "\">" + label + "</a>";
614:                    startCell(18, getFontStyle(8, ARIAL, BLUE));
615:                    simpleAndPrint(nodeValue);
616:                    endCell();
617:                } else {
618:                    startAndEndCell(20 + inBranchDisplay.size(), "");
619:                }
620:                endRow();
621:                endTable();
622:            }
623:
624:            private Boolean isBranchOpen() {
625:
626:                Boolean outValue = null;
627:
628:                //
629:                //String branchCode = ConsolePageParameters.BRANCH_SEPARATOR
630:                //    + getConsolePageSession().getToggleLink()
631:                //    + ConsolePageParameters.BRANCH_SEPARATOR;
632:                //outValue = new Boolean(inCode.indexOf(branchCode) != -1);
633:                //MiscHelper.println("BasPanLesTreConPage isBranchOpen");
634:                //MiscHelper.println("  - inCode = " + inCode);
635:                //MiscHelper.println("  - treeState = " + getTreeState());
636:                //outValue = new Boolean(isTreeComponentPresent(inCode));
637:                //MiscHelper.println("  - outValue = " + outValue);
638:                outValue = new Boolean(
639:                        isTreeComponentPresent(getConsolePageSession()
640:                                .getToggleLink()));
641:
642:                return outValue;
643:            }
644:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.