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             * @og.rev 5.8.1.0 (2014/11/07) HTML5対応ã?javaScriptで、BODYがなã�?�¨入れ子になってしまã�??
068             * @return      後続å?ç�??æŒ?¤º
069             */
070            @Override
071            public int doEndTag() {
072                    debugPrint();           // 4.0.0 (2005/02/28)
073    
074                    tag.setBody( "<!-- -->" );                // 5.8.1.0 (2014/11/07) HTML5対応ã?
075                    jspPrint( tag.makeTag() );
076    
077                    return(EVAL_PAGE);              // ペã?ジの残りを評価するã€?
078            }
079    
080            /**
081             * タグリブオブジェクトをリリースしますã?
082             * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
083             *
084             */
085            @Override
086            protected void release2() {
087                    super.release2();
088                    tag = new TagBuffer( "iTable" );
089            }
090    
091            /**
092             * 【TAG】左右?’å?割で、固定したいカラãƒ?•°を指定しまã�?å¿??)ã€?
093             *
094             * @og.tag
095             * ?‘段çµ?�§も2段çµ?�§もã?固定したいカラãƒ?•°を指定しますã?
096             *
097             * @param   fixedCols 固定したいカラãƒ?•°
098             */
099            public void setFixedCols( final String fixedCols ) {
100                    tag.add( "fixedCols",StringUtil.nval( getRequestParameter( fixedCols ),null ) );
101            }
102    
103            /**
104             * タグの名称をã?返しますã?
105             * 自åˆ??身のクラス名よりã?自動的に取り出せなã�?�Ÿめã?こã?メソãƒ?ƒ‰をオーバã?ライドしますã?
106             *
107             * @return  タグの名称
108             */
109            @Override
110            protected String getTagName() {
111                    return "iTable" ;
112            }
113    
114            /**
115             * こã?オブジェクトã?æ–?­—å?表現を返しますã?
116             * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
117             *
118             * @return こã?クラスのæ–?­—å?表現
119             */
120            @Override
121            public String toString() {
122                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
123                                    .println( "VERSION"             ,VERSION        )
124                                    .println( "tag"                 ,tag.makeTag()  )
125                                    .println( "Other..."    ,getAttributes().getAttribute() )
126                                    .fixForm().toString() ;
127            }
128    }