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.db;
017    
018    /**
019     * ãƒ??タのコード情報を取り扱ã�?electionクラスの、NULL時オブジェクトですã?
020     *
021     * 以前ã?、Selection オブジェクトが null の場合に、NullPointerException で
022     * ã�?��なりエラーで停止してã�?�¾したがã?こã?、NULLセレクションを作æ?することでã€?
023     * 取りあえずã?どã�?�„ã�?ж況なのかã?判るよã�?�«しますã?
024     *
025     * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
026     * @og.rev 5.7.7.1 (2014/06/13) Selectionオブジェクトã?基本実è£?�¨しますã?
027     * @og.group 選択データ制御
028     *
029     * @version  4.0
030     * @author   Kazuhiko Hasegawa
031     * @since    JDK5.0,
032     */
033    // public class Selection_NULL extends Selection_KEYVAL {
034    public class Selection_NULL implements Selection {
035            private final String    initMsg ;
036    
037            /**
038             * ãƒ?ƒ•ォルトコンストラクター
039             * 継承å…??クラスから、呼び出させるよã�?�«、作æ?しておきますã?
040             *
041             * @og.rev 5.7.7.1 (2014/06/13) 新規追åŠ?
042             */
043            public Selection_NULL() { initMsg = null; }
044    
045            /**
046             * 引数に初期メãƒ?‚»ージを指定して作æ?する、コンストラクター
047             *
048             * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
049             *
050             * @param       strCode 初期メãƒ?‚»ージæ–?­—å?
051             */
052            public Selection_NULL( final String strCode ) {
053    //              super( null );
054                    initMsg = strCode ;
055            }
056    
057            /**
058             * 初期値が選択済みの 選択肢(オプション)を返しますã?
059             * こã?オプションは、引数の値をå?期å?とするオプションタグを返しますã?
060             * こã?メソãƒ?ƒ‰では、ラベル(短)が設定されてã�?‚‹場合でもã?これを使用せずにå¿?�šラベル(長)を使用しますã?
061             *
062             * @og.rev 5.7.7.1 (2014/06/13) 新規追åŠ?
063             *
064             * @param   selectValue  選択されてã�?‚‹値
065             * @param   seqFlag  シーケンスアクセス機è? [true:ON/false:OFF]
066             *
067             * @return  オプションタグ
068             * @see     #getOption( String, boolean, boolean )
069             */
070            @Override
071            public String getOption( final String selectValue,final boolean seqFlag ) {
072                    return getOption( selectValue, seqFlag, false );
073            }
074    
075            /**
076             * 初期値が選択済みの 選択肢(オプション)を返しますã?
077             * 無条件で、å?期メãƒ?‚»ージを返しますã?
078             *
079             * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
080             *
081             * @param   selectValue  選択されてã�?‚‹値
082             * @param   seqFlag  シーケンスアクセス機è? [true:ON/false:OFF]
083             * @param   useShortLabel ラベル(短)をã?ースとしたオプション表示を行うかどã�?�‹(常にfalse)ã€?
084             *
085             * @return  オプションタグ
086             * @see     #getOption( String, boolean )
087             */
088            @Override
089            public String getOption( final String selectValue,final boolean seqFlag, final boolean useShortLabel ) {
090                    return initMsg + " value=[" + selectValue + "]";
091            }
092    
093            /**
094             * 初期値が選択済みの 選択肢(オプション)を返しますã?
095             * こã?オプションは、引数の値をå?期å?とするオプションタグを返しますã?
096             * ※ こã?クラスでは実è£?�•れてã�?�¾せんã€?
097             *
098             * @param   name         ラジオの name
099             * @param   selectValue  選択されてã�?‚‹値
100             * @param   useLabel     ラベル表示の有無 [true:æœ?false:無]
101             *
102             * @return  オプションタグ
103             */
104            @Override
105            public String getRadio( final String name,final String selectValue,final boolean useLabel ) {
106                    String errMsg = "こã?クラスでは実è£?�•れてã�?�¾せんã€?;
107                    throw new UnsupportedOperationException( errMsg );
108            }
109    
110            /**
111             * 初期値が選択済みの 選択肢(オプション)を返しますã?
112             * こã?オプションは、引数の値をå?期å?とするオプションタグを返しますã?
113             * ※ こã?クラスでは実è£?�•れてã�?�¾せんã€?
114             *
115             * @param   selectValue  選択されてã�?‚‹値
116             *
117             * @return  オプションタグ
118             */
119            @Override
120            public String getRadioLabel( final String selectValue ) {
121                    String errMsg = "こã?クラスでは実è£?�•れてã�?�¾せんã€?;
122                    throw new UnsupportedOperationException( errMsg );
123            }
124    
125            /**
126             * 選択肢(value)に対するラベルを返しますã?
127             * 選択肢(value)がã?存在しなかったå?合ã?ã€?�¸択肢そã?もã?を返しますã?
128             * getValueLabel( XX ) は、getValueLabel( XX,false ) と同じですã?
129             *
130             * @param   selectValue 選択肢の値
131             *
132             * @return  選択肢のラベル
133             * @see     #getValueLabel( String,boolean )
134             */
135            @Override
136            public String getValueLabel( final String selectValue ) {
137                    return getValueLabel( selectValue,false );
138            }
139    
140            /**
141             * 選択肢(value)に対するラベルを返しますã?
142             * 無条件で、å?期メãƒ?‚»ージを返しますã?
143             *
144             * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
145             *
146             * @param       selectValue     選択肢の値
147             * @param       flag    短縮ラベルã‚?[true:使用する/false:しない](常に false)
148             *
149             * @return  選択肢のラベル
150             * @see     #getValueLabel( String )
151             */
152            @Override
153            public String getValueLabel( final String selectValue,final boolean flag ) {
154                    return initMsg + " value=[" + selectValue + "]";
155            }
156    
157            /**
158             * マルチã?キーセレクトを使用するかどã�?�‹を返しますã?
159             * true?š使用する。false:使用しなã�?ですã?
160             * ただしã?実際に使用するかどã�?�‹は、HTML出力時に決めることがå?来ますã?
161             * ここでは、USE_MULTI_KEY_SELECT ã�?true で、USE_SIZE(=20)以上ã?場合に
162             * true を返しますã?
163             *
164             * ※ ここでは、常に false を返しますã?
165             *
166             * @return  選択リストで、ã?ルチã?キーセレクトを使用するかどã�?�‹(true:使用する)
167             */
168            @Override
169            public boolean useMultiSelect() {
170                    return false;
171            }
172    
173            /**
174             * オブジェクトã?キャãƒ?‚·ュが時間å?れかどã�?�‹を返しますã?
175             * キャãƒ?‚·ュが時間å?ã‚?無効)であれば、true をã?有効であればã€?
176             * false を返しますã?
177             *
178             * ※ ここでは、常に false を返しますã?
179             *
180             * @return  キャãƒ?‚·ュが時間å?れなã‚?true
181             */
182            @Override
183            public boolean isTimeOver() {
184                    return false;
185            }
186    }