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.fukurou.util.StringUtil;
020    import org.opengion.fukurou.util.TagBuffer;
021    
022    /**
023     * JavaScriptを利用してクライアントå?でãƒ??ブルの左右åˆ?‰²しますã?
024     *
025     * iTable タグは、ガントå?体ã?左右?’å?割表示したã�?‚«ラãƒ?•°をã?fixedCols 属æ?にæŒ?®šしますã?
026     * 通常の view タグの後に記述しますã?
027     *
028     * @og.formSample
029     * ●形式ï¼?lt;og:iTable  ... />
030     * ●body?šなã�?
031     * ●前提:headタグで、adjustEvent="Table" を指定してくださいã€?
032     *
033     * ●Tag定義??
034     *   <og:iTable
035     *       fixedCols          【TAG】左右?’å?割で、固定したいカラãƒ?•°(å¿??)
036     *       debug              【TAG】デバッグæƒ??をå?力するかどã�?�‹[true/false]を指定しまã�?初期値:false)
037     *   />
038     *
039     * ●使用ä¾?
040     *  <og:view
041     *      viewFormType = "HTMLTable"
042     *      command      = "{@command}"
043     *  />
044    
045     *   <og:iTable
046     *       fixedCols  = "5"
047     *   />
048     *
049     * @og.rev 5.6.3.2 (2013/04/12) 新規作æ?
050     * @og.group 画面部å“?
051     *
052     * @version  5.0
053     * @author       Kazuhiko Hasegawa
054     * @since    JDK6.0,
055     */
056    public class ViewITableTag extends CommonTagSupport {
057            //* こã?プログラãƒ??VERSIONæ–?­—å?を設定しますã?       {@value} */
058            private static final String VERSION = "5.6.3.2 (2013/04/12)" ;
059    
060            private static final long serialVersionUID = 563220130412L ;
061    
062            private TagBuffer tag = new TagBuffer( "iTable" ) ;
063    
064            /**
065             * Taglibの終äº?‚¿グが見つかったときに処ç�?�™ã‚?doEndTag() ã‚?オーバã?ライドしますã?
066             *
067             * @return      後続å?ç�??æŒ?¤º
068             */
069            @Override
070            public int doEndTag() {
071                    debugPrint();           // 4.0.0 (2005/02/28)
072    
073                    jspPrint( tag.makeTag() );
074    
075                    return(EVAL_PAGE);              // ペã?ジの残りを評価するã€?
076            }
077    
078            /**
079             * タグリブオブジェクトをリリースしますã?
080             * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
081             *
082             */
083            @Override
084            protected void release2() {
085                    super.release2();
086                    tag = new TagBuffer( "iTable" );
087            }
088    
089            /**
090             * 【TAG】左右?’å?割で、固定したいカラãƒ?•°を指定しまã�?å¿??)ã€?
091             *
092             * @og.tag
093             * ?‘段çµ?�§も2段çµ?�§もã?固定したいカラãƒ?•°を指定しますã?
094             *
095             * @param   fixedCols 固定したいカラãƒ?•°
096             */
097            public void setFixedCols( final String fixedCols ) {
098                    tag.add( "fixedCols",StringUtil.nval( getRequestParameter( fixedCols ),null ) );
099            }
100    
101            /**
102             * タグの名称をã?返しますã?
103             * 自åˆ??身のクラス名よりã?自動的に取り出せなã�?�Ÿめã?こã?メソãƒ?ƒ‰をオーバã?ライドしますã?
104             *
105             * @return  タグの名称
106             */
107            @Override
108            protected String getTagName() {
109                    return "iTable" ;
110            }
111    
112            /**
113             * こã?オブジェクトã?æ–?­—å?表現を返しますã?
114             * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
115             *
116             * @return こã?クラスのæ–?­—å?表現
117             */
118            @Override
119            public String toString() {
120                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
121                                    .println( "VERSION"             ,VERSION        )
122                                    .println( "tag"                 ,tag.makeTag()  )
123                                    .println( "Other..."    ,getAttributes().getAttribute() )
124                                    .fixForm().toString() ;
125            }
126    }