001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.hayabusa.taglib;
017
018 import org.opengion.hayabusa.common.HybsSystemException;
019 import org.opengion.hayabusa.html.TableFormatter;
020
021 /**
022 * ガントチャーãƒ?タスク配置åž?用の繰り返しタグのフォーマットに使用しますã?
023 *
024 * itd タグは、ガントã?ãƒ?ƒ€ー部の TDタグの繰返しに使用されますã?
025 * こã?繰返しは、ganttParam タグの minDuration でæŒ?®šされた間隔で行われますã?
026 * (例えばã€?.5 を指定すれã?、半日単位で処ç�?�•れますã?)
027 * itd タグの colspan 属æ?を指定したå?合ã?、itd 自身がã?td タグに colspan ã‚?
028 * 追åŠ?�™ると共に、繰返し自身をã?そã?æŒ?®š数ã�?�‘に抑制しますã?
029 * 具体的には、colspan="2" とするとã€?¼’回にä¸?›žしか、itd タグが呼び出されなã�?
030 * なりますã?
031 *
032 * @og.formSample
033 * ●形式ï¼?lt;og:itd> ... Body ... </og:itd>
034 * ●body?šあã‚?EVAL_BODY_BUFFERED:BODYを評価しã?{@XXXX} を解析しまã�?
035 *
036 * ●Tag定義??
037 * <og:itd
038 * debug 【TAG】デバッグæƒ??をå?力するかどã�?�‹[true/false]を指定しまã�?初期値:false)
039 * > ... Body ...
040 * </og:itd>
041 *
042 * ●使用ä¾?
043 * <og:thead rowspan="1">
044 * <tr>
045 * <og:itd>M/d</og:itd>
046 * </tr>
047 * </og:thead>
048 * <og:tbody rowspan="1" >
049 * <tr>
050 * <og:itd>
051 * <span class="cGntBar[!FGTASK]"
052 * title="[NMMCN]&amp;#13;&amp;#10;[NMKT]"
053 * val1 ="[GVZOOM]"
054 * val2 ="[CDJGS]"
055 * val3 ="[WC]"
056 * val4 ="[NOMCN]"
057 * val5 ="[CDKT]"
058 * val6 ="[FGTASK]"
059 * val7 ="[DYSTART]"
060 * val8 ="[DYDELAY]"
061 * val9 ="[DURATION]" >&nbsp;</span>
062 * </og:itd>
063 * </tr>
064 * </og:tbody>
065 *
066 * @og.rev 3.5.4.8 (2004/02/23) 新規作æ?
067 * @og.group 画面部å“?
068 *
069 * @version 4.0
070 * @author Kazuhiko Hasegawa
071 * @since JDK5.0,
072 */
073 public class ItdTag extends CommonTagSupport {
074 //* こã?プログラãƒ??VERSIONæ–?—å?を設定しますã? {@value} */
075 private static final String VERSION = "4.0.0.0 (2005/08/31)" ;
076
077 private static final long serialVersionUID = 400020050831L ;
078
079 private String itdBody = null;
080
081 /**
082 * Taglibの開始タグが見つかったときに処ç�?�™ã‚?doStartTag() ã‚?オーバã?ライドしますã?
083 *
084 * @return 後続å?ç�??æŒ?¤º( EVAL_BODY_BUFFERED )
085 */
086 @Override
087 public int doStartTag() {
088 return( EVAL_BODY_BUFFERED ); // Body を評価するã€? extends BodyTagSupport æ™?
089 }
090
091 /**
092 * Taglibのタグ本体を処ç�?�™ã‚?doAfterBody() ã‚?オーバã?ライドしますã?
093 *
094 * @return 後続å?ç�??æŒ?¤º(SKIP_BODY)
095 */
096 @Override
097 public int doAfterBody() {
098 itdBody = getBodyString();
099
100 return(SKIP_BODY); // Body を評価しなã�?
101 }
102
103 /**
104 * Taglibの終äº?‚¿グが見つかったときに処ç�?�™ã‚?doEndTag() ã‚?オーバã?ライドしますã?
105 *
106 * @return 後続å?ç�??æŒ?¤º
107 */
108 @Override
109 public int doEndTag() {
110 debugPrint(); // 4.0.0 (2005/02/28)
111 TFormatTag tFormat = (TFormatTag)findAncestorWithClass( this, TFormatTag.class );
112 if( tFormat != null ) {
113 tFormat.setItdBody( itdBody );
114 jspPrint( TableFormatter.HYBS_ITD_MARKER );
115 }
116 else {
117 // String errMsg = "<b>こã?タグは、TheadTag かã?TBodyTagのå†??(要ç´?に記述してくださいã€?/b>";
118 String errMsg = "<b><b>" + getTagName() + "タグは、TheadTag かã?TBodyTagのå†??(要ç´?に記述してくださいã€?/b>";
119 throw new HybsSystemException( errMsg );
120 }
121
122 return(EVAL_PAGE); // ペã?ジの残りを評価するã€?
123 }
124
125 /**
126 * タグリブオブジェクトをリリースしますã?
127 * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
128 *
129 */
130 @Override
131 protected void release2() {
132 super.release2();
133 itdBody = null;
134 }
135
136 /**
137 * こã?オブジェクトã?æ–?—å?表現を返しますã?
138 * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
139 *
140 * @return こã?クラスのæ–?—å?表現
141 */
142 @Override
143 public String toString() {
144 return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
145 .println( "VERSION" ,VERSION )
146 .println( "itdBody" ,itdBody )
147 .println( "Other..." ,getAttributes().getAttribute() )
148 .fixForm().toString() ;
149 }
150 }