KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > admingui > taglib > DataSheetTag


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.tools.admingui.taglib;
25
26 import java.io.*;
27 import java.lang.reflect.*;
28 import java.util.*;
29 import java.text.NumberFormat JavaDoc;
30
31 import javax.servlet.http.*;
32 import javax.servlet.jsp.*;
33 import javax.servlet.jsp.tagext.*;
34
35 import org.w3c.dom.*;
36 import org.xml.sax.*;
37 import org.xml.sax.helpers.*;
38
39 import com.iplanet.jato.*;
40 import com.iplanet.jato.model.*;
41 import com.iplanet.jato.taglib.*;
42 import com.iplanet.jato.taglib.html.FormTag;
43 import com.iplanet.jato.util.*;
44 import com.iplanet.jato.view.*;
45 import com.iplanet.jato.view.event.*;
46 import com.iplanet.jato.view.html.*;
47
48 import com.sun.web.ui.common.*;
49 import com.sun.web.ui.model.CCPropertySheetModelInterface;
50 import com.sun.web.ui.taglib.propertysheet.CCPropertySheetTag;
51 import com.sun.web.ui.view.html.*;
52 import com.sun.web.ui.view.propertysheet.*;
53 import com.sun.web.ui.taglib.common.*;
54 import com.sun.web.ui.taglib.html.*;
55 import com.sun.web.ui.taglib.help.*;
56 import com.sun.web.ui.taglib.spacer.*;
57
58 import com.sun.enterprise.tools.admingui.util.Util;
59
60 public class DataSheetTag extends CCPropertySheetTag {
61
62     // ASPropertySheet addition
63
private int iCurrentSection = 0;
64     private ArrayList dataObjects = null;
65     private static final String JavaDoc DATA_ELEMENT = "dataValue";
66     private static final String JavaDoc TEMPLATE_ELEMENT = "sectionTemplate";
67     
68     // ASPropertySheet addition
69
private class MyNodeList extends ArrayList implements NodeList {
70         public Node item(int i) {
71             return (Node)super.get(i);
72         }
73         public int getLength() {
74             return super.size();
75         }
76     }
77
78     /**
79      * Default constructor
80      */

81     public DataSheetTag() {
82     super();
83     }
84
85     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86
// Tag handler methods
87
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88

89     /**
90      * Reset cached state to allow for a new rendering of this tag instance.
91      * Note that this method only resets class data members; it does not reset
92      * tag attribute values.
93      */

94     public void reset() {
95     super.reset();
96         
97         // ASPropertySheet addition
98
dataObjects = null;
99     }
100
101     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102
// Micro component methods
103
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104

105     /**
106      * Generate the HTML for the Property Sheet and return the HTML as a
107      * String.
108      *
109      * The code in this method is separated out from the getHTMLString method
110      * in order to prevent reset() from being called by subclasses. Subclasses
111      * should call
112      * <code>super.getHTMLStringInternal(Tag, PageContext, View)</code> from
113      * their getHTMLStringInternal method.
114      *
115      * @param parent The Tag instance enclosing this tag.
116      * @param pageContext The page context used for this tag.
117      * @param view The container view used for this tag.
118      * @return The HTML string for the property sheet.
119      */

120     protected String JavaDoc getHTMLStringInternal(Tag parent, PageContext pageContext,
121         View view) throws JspException {
122     if (parent == null) {
123         throw new IllegalArgumentException JavaDoc("parent cannot be null.");
124     } else if (pageContext == null) {
125         throw new IllegalArgumentException JavaDoc("pageContext cannot be null.");
126     } else if (view == null) {
127         throw new IllegalArgumentException JavaDoc("view cannot be null.");
128     }
129
130     checkChildType(view, CCPropertySheet.class);
131     CCPropertySheet field = (CCPropertySheet) view;
132     containerView = (field.getContainerView() != null)
133         ? field.getContainerView()
134         : (ContainerView) field.getParent();
135
136         // assign a class variable.
137
CCPropertySheetModelInterface model = field.getModel();
138     if (model == null) {
139         throw new IllegalArgumentException JavaDoc(
140         "PropertySheet model cannot be null");
141     }
142     if (model.getDocument() == null) {
143         throw new RuntimeException JavaDoc(
144         "The property sheet model getDocument() returned null.\n" +
145         "Be sure a valid XML file was supplied " +
146         "to the property sheet model.");
147     }
148
149     // Initialize tag parameters.
150
setParent(parent);
151     setPageContext(pageContext);
152
153     // set the attributes from the child view.
154
if (field.getShowJumpLinks() != null) {
155         setShowJumpLinks(field.getShowJumpLinks().toString());
156         }
157     NonSyncStringBuffer buffer = new NonSyncStringBuffer(
158         DEFAULT_BUFFER_SIZE);
159
160     // Invoke the begin display event for the child component.
161
try {
162         field.beginDisplay(new JspDisplayEvent(this, pageContext));
163     } catch (ModelControlException e) {
164         throw new JspException(e.getRootCause());
165     }
166         numberOfSections = 0;
167         // create the HTML for the property sheet.
168
appendSections(buffer, getSections(model), model);
169         // ASPropertySheet addition
170
appendData(buffer, getTemplates(model), model);
171         
172         // add JavaScript for client side required field checking.
173
appendJavaScript(buffer);
174         
175     return buffer.toString();
176     }
177
178     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179
// Higher Level Tag Processing methods.
180
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181

182     // ASPropertySheet addition
183
private Node findMatchingTemplate(NodeList templates, Object JavaDoc data) {
184         for (int i=0; i<templates.getLength(); i++) {
185             Node template = templates.item(i);
186             String JavaDoc cls = this.getAttributeValue(template, "class", null);
187             if (cls != null) {
188                 try {
189                     Class JavaDoc clazz = Class.forName(cls);
190                     if (clazz.isInstance(data)) {
191                         //System.out.println("isInstance of "+cls);
192
return template;
193                     }
194                 } catch (Exception JavaDoc ex) {
195                     if (Util.isLoggableINFO())
196                         Util.logINFO("Error in finding class: " + cls +
197                             "\n" + ex.getMessage());
198                 }
199             } else {
200                 if (Util.isLoggableINFO())
201                     Util.logINFO("XML error: No class specified for section template.");
202             }
203         }
204         return null;
205     }
206     
207     // ASPropertySheet addition
208
private NodeList getSectionsForProcessing(NodeList templates,
209             CCPropertySheetModelInterface model) {
210                 
211         Object JavaDoc [] objs = (Object JavaDoc [])model.getValue("DataObjects");
212         if (objs == null)
213             return null;
214         
215         dataObjects = new ArrayList();
216         MyNodeList sections = new MyNodeList();
217         
218         for (int i=0; i<objs.length; i++) {
219             Node template = findMatchingTemplate(templates, objs[i]);
220             if (template != null) {
221                 sections.add(template);
222                 dataObjects.add(objs[i]);
223             } else if (Util.isLoggableINFO()) {
224                 Util.logINFO("Could not find matching template.");
225                 Util.logINFO("OBJECT CLASS: "+objs[i].getClass().getName());
226                 try {
227                     Util.logINFO(" name: "+evaluate(objs[i], "$getName", null, null));
228                     Util.logINFO(" desc: "+evaluate(objs[i], "$getDescription", null, null));
229                 } catch (Exception JavaDoc ex) {
230                     Util.logINFO("error in evaluate: "+ex.getMessage());
231                 }
232             }
233         }
234         return sections;
235     }
236     
237     // ASPropertySheet addition
238
private Object JavaDoc getCurrentData() {
239         return dataObjects.get(iCurrentSection);
240     }
241
242     // ASPropertySheet addition
243
private void appendData(NonSyncStringBuffer buffer, NodeList templates,
244     CCPropertySheetModelInterface model) throws JspException {
245         
246         NodeList sections = getSectionsForProcessing(templates, model);
247         if (sections == null || sections.getLength() == 0)
248             return;
249         appendSections(buffer, sections, model);
250     }
251     
252     protected void appendSections(NonSyncStringBuffer buffer, NodeList sections,
253     CCPropertySheetModelInterface model) throws JspException {
254
255     boolean added = (numberOfSections != 0) && (hasJumpLinks() == false);
256     numberOfSections = sections.getLength(); // setting a class variable.
257
if (numberOfSections == 0)
258             return;
259         appendJumpLinks(buffer, sections, model);
260
261     for (int i = 0; i < numberOfSections; i++) {
262         Node section = sections.item(i);
263         if (isVisible(section, model) == false) {
264         continue;
265             }
266         if (added) {
267         // don't add a speparator before the first section has been added
268
appendSeparator(buffer);
269         }
270             iCurrentSection = i; // DataSheet addition
271
appendSection(buffer, section, model);
272
273         if (hasJumpLinks()) {
274         appendBackToTop(buffer);
275             } else {
276         buffer.append(getSpacerHTMLString("10", "1"));
277             }
278         added = true;
279     }
280     }
281
282     /* BEGIN JSTYLED */
283     // jstyle can't handle the escaped quotes (i.e. \") in HTML strings.
284

285     protected void appendProperty(NonSyncStringBuffer buffer,
286     Node property, CCPropertySheetModelInterface model, int level)
287     throws JspException {
288
289     buffer.append("<tr>\n"); // start off the property row.
290

291     String JavaDoc labelId = null;
292         boolean hasNoValueElement = hasNoValueElement(property);
293         // When the property does not contain a value (CC) element, then
294
// need to treat the label a little differently.
295
boolean colspan = isSpan(property) || hasNoValueElement;
296     // column span can happen only if there is no label, thus
297
// if colspan==true, implies label = null.
298
if (colspan == false) {
299         // Process the label element first
300
// and return a label ID for the Value part, if necessary.
301

302         labelId = appendLabel(buffer, property, model, level);
303     }
304
305     // start the value column.
306
if (colspan) {
307         buffer.append("<td valign=\"top\" colspan=\"2\">" +
308               "<div class=\"");
309     } else {
310         buffer.append("<td valign=\"top\"><div class=\"");
311     }
312     buffer.append(getDivClass(colspan, level)).append("\">");
313
314     // loop through the rest of the child elements of the property.
315
NodeList subNodes = property.getChildNodes();
316     for (int i = 0; i < subNodes.getLength(); i++) {
317         Node subNode = subNodes.item(i);
318         String JavaDoc nodeName = subNode.getNodeName();
319         if (nodeName.equalsIgnoreCase(CCDescriptor.CC_ELEMENT)) {
320         if (i != 0) {
321             // if two cc elements are next to each other, need to
322
// add a newline in the html to get the needed spacing
323
buffer.append("\n");
324         }
325         // If the value (cc element) is a CCActionTableTag, special
326
// formating needs to be applied. The Table cannot be placed
327
// in the current open <td> because it will lose it ability
328
// to stretch across the page, which it should according to
329
// the HCI-Admin guildelines.
330
boolean isTableTag = isTableTag(subNode, colspan, level);
331         // If the table is not at the first level or the colspan
332
// is not true, then don't do this special formating, which
333
// implies the table won't stretch.
334
if (isTableTag) preTableFormat(buffer);
335         
336         labelId = appendValue(buffer, subNode, labelId,
337                       (level > 1 || colspan == false));
338         
339         // This whole isTableTag code is kind of a hack. However, it's
340
// probably not too common to place a table in a property
341
// sheet. If there is a table the span should be true and
342
// the level should equal one.
343
if (isTableTag) postTableFormat(buffer, colspan, level);
344         
345         } else if (nodeName.equalsIgnoreCase(
346                 CCPropertySheetModelInterface.HELPTEXT_ELEMENT)) {
347         appendFieldHelp(buffer, getNameHTML(subNode));
348         } else if (nodeName.equalsIgnoreCase(
349                 CCPropertySheetModelInterface.VALUESET_ELEMENT)) {
350         appendValueSet(buffer, subNode, model, level + 1);
351         } else if (nodeName.equalsIgnoreCase(
352                             CCPropertySheetModelInterface.LABEL_ELEMENT)) {
353                 if (hasNoValueElement) {
354                     String JavaDoc labelHTML = getNameHTML(subNode);
355                     String JavaDoc style = (level > 1)
356                         ? CCStyle.LABEL_LEVEL_THREE_TEXT
357                         : CCStyle.LABEL_LEVEL_TWO_TEXT;
358                     buffer.append(getLabelHTMLString(style, null, null,
359                         isError(property, model), isRequired(property),
360                         labelHTML));
361                 }
362             // DataSheet addition
363
} else if (nodeName.equalsIgnoreCase(DATA_ELEMENT)) {
364                 labelId = appendDataValue(buffer, subNode, labelId, model);
365             } else {
366         // Handle any #PCDATA
367
String JavaDoc html = subNode.getNodeValue();
368         if (html != null)
369             buffer.append(html.trim());
370         }
371     }
372     buffer.append("</div></td></tr>\n"); // end the table column & row.
373
}
374     
375     private final String JavaDoc Milliseconds = Util.getMessage("label.Milliseconds");
376     private final String JavaDoc Seconds = Util.getMessage("label.Seconds");
377     private final String JavaDoc Minutes = Util.getMessage("label.Minutes");
378     private final String JavaDoc Hours = Util.getMessage("label.Hours");
379     private final String JavaDoc Days = Util.getMessage("label.Days");
380     private final String JavaDoc Weeks = Util.getMessage("label.Weeks");
381     
382     private class TimeData {
383         private long seconds = 0;
384         private long minutes = 0;
385         private long hours = 0;
386         private long days = 0;
387         private long weeks = 0;
388         
389         private static final long oneWeek = 7*24*60*60; // seconds
390
private static final long oneDay = 24*60*60; // seconds
391
private static final long oneHour = 60*60; // seconds
392
private static final long oneMinute = 60; // seconds
393

394         public TimeData(long secs) {
395             seconds = secs;
396             if (seconds >= oneWeek) {
397                 weeks = (seconds/oneWeek);
398                 seconds = seconds - weeks*oneWeek;
399             }
400             if (seconds >= oneDay) {
401                 days = (seconds/oneDay);
402                 seconds = seconds - days*oneDay;
403             }
404             if (seconds >= oneHour) {
405                 hours = (seconds/oneHour);
406                 seconds = seconds - hours*oneHour;
407             }
408             if (seconds >= oneMinute) {
409                 minutes = (seconds/oneMinute);
410                 seconds = seconds - minutes*oneMinute;
411             }
412         }
413         
414         public String JavaDoc toString() {
415             String JavaDoc str = "&nbsp;";
416             if (weeks > 0)
417                 str += weeks + "&nbsp;" + Weeks + ",&nbsp;";
418             if (days > 0 || str.length() > 6)
419                 str += days + "&nbsp;" + Days + ",&nbsp;";
420             if (hours > 0 || str.length() > 6)
421                 str += hours + "&nbsp;" + Hours + ",&nbsp;";
422             if (minutes > 0 || str.length() > 6)
423                 str += minutes + "&nbsp;" + Minutes + ",&nbsp;";
424             if (seconds > 0 || str.length() > 6)
425                 str += seconds + "&nbsp;" + Seconds + "&nbsp;";
426             return str;
427         }
428     }
429
430     private String JavaDoc convert(long value, String JavaDoc unit) {
431         if (unit == null || value == 0)
432             return "";
433         TimeData t = null;
434         // This is not I18N.
435
// If the unit string is not recognized, no conversion is done.
436
if (unit.equalsIgnoreCase(Milliseconds)) {
437             t = new TimeData((value+500)/1000);
438         } else if (unit.equalsIgnoreCase(Seconds)) {
439             t = new TimeData(value);
440         } else if (unit.equalsIgnoreCase(Minutes)) {
441             t = new TimeData(value*60);
442         } else {
443             return "";
444         }
445         return " (" + t.toString() + ")";
446     }
447
448     // DataSheet addition
449
private long getLongValue(Object JavaDoc value) {
450         if (value instanceof Long JavaDoc)
451             return ((Long JavaDoc)value).longValue();
452         else if (value instanceof Integer JavaDoc)
453             return ((Integer JavaDoc)value).longValue();
454         else
455             return new Long JavaDoc((String JavaDoc)value.toString()).longValue();
456     }
457
458     // DataSheet addition
459
private String JavaDoc evaluate(Object JavaDoc data, String JavaDoc methodName,
460             String JavaDoc formatType, String JavaDoc unit) throws Exception JavaDoc {
461         if (methodName.indexOf('$') == 0) {
462             methodName = methodName.substring(1);
463         } else {
464             throw new RuntimeException JavaDoc("Method Names must begin with a '$': " +
465                 methodName);
466         }
467     Method method = null;
468     try {
469         method = data.getClass().getMethod(methodName, (Class JavaDoc[])null);
470     } catch (NoSuchMethodException JavaDoc ex) {
471         throw new RuntimeException JavaDoc("Method '" + methodName +
472                 "' not found!", ex);
473     }
474         Object JavaDoc value = method.invoke(data, (Object JavaDoc[])null);
475         if (formatType == null || formatType.equalsIgnoreCase("String")) {
476             return value.toString();
477         } else if (formatType.equalsIgnoreCase("Date")) {
478             Date date = new Date(getLongValue(value));
479             return date.toString();
480         } else if (formatType.equalsIgnoreCase("Number")) {
481             long longValue = getLongValue(value);
482             String JavaDoc html = NumberFormat.getInstance().format(longValue);
483             if (unit == null)
484                 return html;
485             return html + "&nbsp;" + Util.getMessage(unit) + convert(longValue, unit);
486         }
487     throw new RuntimeException JavaDoc("Unknown format type for Method: " +
488             methodName);
489     }
490         
491     // DataSheet addition
492
private String JavaDoc appendDataValue(NonSyncStringBuffer buff, Node dataNode,
493             String JavaDoc labelId, CCPropertySheetModelInterface model) {
494         
495     String JavaDoc methodName = getAttributeValue(dataNode, "method", null);
496     String JavaDoc formatType = getAttributeValue(dataNode, "formatType", "String");
497         String JavaDoc unit = getAttributeValue(dataNode, "unit", null);
498         try {
499             if (unit != null && unit.startsWith("$")) {
500                 unit = evaluate(getCurrentData(), unit, "String", null);
501             }
502         } catch (Exception JavaDoc ex) {
503             // ignore
504
}
505         
506         String JavaDoc value = "No Method defined!";
507         try {
508             if (methodName != null)
509                 value = evaluate(getCurrentData(), methodName, formatType, unit);
510         } catch (Exception JavaDoc ex) {
511             value = ex.getMessage();
512         }
513         
514     if (labelId != null) {
515         // just static text, so need to put text inside span tag with an ID.
516
buff.append("<span id=\"")
517         .append(labelId)
518         .append("\" class=\"" + CCStyle.CONTENT_DEFAULT_TEXT + "\">")
519         .append(value)
520         .append("</span>");
521     } else {
522         buff.append(value);
523     }
524         return null;
525     }
526     
527     /* END JSTYLED */
528
529
530     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
531
// Utility helper methods
532
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
533

534     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
535
// XML Helper Methods.
536
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
537

538     // ASPropertySheet addition
539
private NodeList getTemplates(CCPropertySheetModelInterface model) {
540     return model.getDocument().getElementsByTagName(TEMPLATE_ELEMENT);
541     }
542
543     protected String JavaDoc getDefaultValue(Node node) throws JspException {
544     String JavaDoc html = getAttributeValue(node,
545         CCPropertySheetModelInterface.DEFAULT_ATTRIBUTE, null);
546     if (html != null) {
547             // ASPropertySheet addition
548
if (html.indexOf('$') == 0) {
549                 try {
550                     return getMessage(evaluate(getCurrentData(), html, "String", null));
551                 } catch (Exception JavaDoc ex) {
552                     return ex.getMessage();
553                 }
554             }
555         return getMessage(html);
556         } else {
557         return "";
558         }
559     }
560
561     protected boolean hasNoValueElement(Node propertyNode) {
562         // return true is there are no CC nodes specified for the property
563
NodeList subNodes = propertyNode.getChildNodes();
564     for (int i = 0; i < subNodes.getLength(); i++) {
565         Node valueNode = subNodes.item(i);
566         String JavaDoc nodeName = valueNode.getNodeName();
567         if (nodeName != null
568             && (nodeName.equalsIgnoreCase(CCDescriptor.CC_ELEMENT)
569                         // ASPropertySheet addition
570
|| nodeName.equalsIgnoreCase(DATA_ELEMENT))) {
571         return false;
572         }
573     }
574     return true;
575     }
576
577     protected void appendJumpLinks(NonSyncStringBuffer buff, NodeList sections)
578     throws JspException {
579     int count = numberOfSections; // sections.getLength();
580
if (count == 0)
581         return;
582
583     String JavaDoc names [] = new String JavaDoc [count];
584     String JavaDoc anchors [] = new String JavaDoc [count];
585     for (int i = 0; i < count; i++) {
586         Node sectionNode = sections.item(i);
587         // section names are required.
588
iCurrentSection = i;
589         names[i] = getNameHTML(sectionNode);
590         anchors[i] = getAnchor(sectionNode);
591             // ASPropertySheet addition
592
if (anchors[i].equals(""))
593                 anchors[i] = names[i];
594     }
595     // start jump table part
596
buff.append("<div class=\"" +
597         CCStyle.CONTENT_JUMP_SECTION_DIV +
598         "\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" +
599         "<tr>\n");
600
601     // This implements the layout for the jump links as specified by
602
// HCI Admin. Should have 2, 3, or 4 links per row depending on the
603
// number of total links. Should never have any more that 4 links
604
// per row. At least that's what the current guideline says.
605
if (count < 5)
606         appendJumpLinks(buff, names, anchors, count, 2);
607     else if (count < 10)
608         appendJumpLinks(buff, names, anchors, count, 3);
609     else
610         appendJumpLinks(buff, names, anchors, count, 4);
611
612     // end jump table part
613
buff.append("</tr></table></div>\n");
614
615     // Some test code for the jump link layout algorithm.
616
// for (count = 2 ; count < 16; count++) {
617
// switch (count) {
618
// case 2:
619
// case 3:
620
// case 4:
621
// test(count, 2);
622
// break;
623
// case 5:
624
// case 6:
625
// case 7:
626
// case 8:
627
// case 9:
628
// test(count, 3);
629
// break;
630
// default:
631
// test(count, 4);
632
// break;
633
// }
634
// }
635
}
636     /* END JSTYLED */
637     
638     protected boolean hasJumpLinks() {
639     if (numberOfSections > 2) {
640         // if getShowJumpLinks() returns null,
641
// then .booleanValue() will return false.
642
return new Boolean JavaDoc(getShowJumpLinks()).booleanValue();
643     }
644     return false;
645     }
646 }
647
Popular Tags