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.plugin.column;
017    
018    import org.opengion.hayabusa.common.HybsSystem;
019    import org.opengion.hayabusa.common.HybsSystemException;
020    import org.opengion.hayabusa.db.AbstractEditor;
021    import org.opengion.hayabusa.db.CellEditor;
022    import org.opengion.hayabusa.db.DBColumn;
023    import org.opengion.hayabusa.db.Selection;
024    import org.opengion.hayabusa.db.SelectionFactory;
025    import org.opengion.fukurou.util.StringFormat;
026    import org.opengion.fukurou.util.XHTMLTag;
027    import org.opengion.fukurou.util.Attributes;
028    import org.opengion.fukurou.util.TagBuffer;
029    
030    /**
031     * カラãƒ??ç·¨é›?ƒ‘ラメーターã®?³?±?¬æ–??å®Ÿè¡Œçµæžœã‚ˆã‚Šã€ã?ルãƒ?‚¦ãƒ³ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’作æ?ã—ã¦
032     * ç·¨é›?™ã‚‹å?åˆã«ä½¿ç”¨ã™ã‚‹ã‚¨ãƒ?‚£ã‚¿ãƒ¼ã‚¯ãƒ©ã‚¹ã§ã™ã?
033     *
034     * ç·¨é›?ƒ‘ラメータã«ã¯ã€ã?ルãƒ?‚¦ãƒ³ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’作æ?ã™ã‚‹ãŸã‚ã®ã€SQLæ–?‚’記述ã—ã¾ã™ã?
035     * ã“ã?SQLæ–??ã€select KEY,LABEL from xx ?¥?¥?¥ ã¨ã?†æ§‹æ–‡ã§ã€KEY部åˆ?¨LABEL部åˆ?Œ
036     * é¸æŠžã•れã¾ã™ã?<del>ç¾æ™‚点ã§ã¯ã€ãれ以é™ã?æ¤œç´¢çµæžœã¯ç„¡è¦–ã•れã¾ã™ãŒã€å°?¥çš?ªæ‹¡å¼µã?
037     * ã‚ã‚‹ãŸã‚ã€æ¤œç´¢ã¯ã€KEYã¨LABELã®?’ã¤ã«ã—ã¦ãã ã•ã„ã€?/del>
038     * 第ä¸?‚«ãƒ©ãƒ??キーã€ç¬¬äºŒã‚«ãƒ©ãƒ??ラベルã§ã“ã??’ã¤ã¯å¿??ã§ã™ã?第三カラãƒ??短縮ラベルã€?
039     * 第四カラãƒ??グルーãƒ?optgroup)ã€ç¬¬äº”カラãƒ??色付ã‘ç­‰ã«ä½¿ã?‚¯ãƒ©ã‚¹ã§ã™ã?
040     * 短縮ラベルãŒè¨­å®šã•れã¦ã?‚‹å ´åˆã?ä¸?¦§ã§ã“ã?エãƒ?‚£ã‚¿ãŒé©ç”¨ã•れるã¨çŸ­ç¸®ãƒ©ãƒ™ãƒ«è¡¨ç¤ºã‚?
041     * ã—ãŸä¸Šã§ãƒžã‚¦ã‚¹ã‚ªãƒ¼ãƒã?時ã?ãƒ??ルãƒãƒƒãƒ—ã§é€šå¸¸ã®ãƒ©ãƒ™ãƒ«ã‚’表示ã—ã¾ã™ã?<br/>
042     *
043     * å?‚«ãƒ©ãƒ??値(value値)ã«ã€AAA:BBB:CCC:DDD ã¨ã?†å€¤ã‚’設定ã§ãã¾ã™ã?ã“れã¯ã€?
044     * $1,$2,$3,$4 ã«å‰²ã‚Šå½“ã¦ãªãŠã—ã¦ã€QUERYを実行ã—ã¾ã™ã?ã¾ãŸã?$1 ã¯ã€æœ¬æ¥ã®å€¤ã¨ã—ã¦ã€?
045     * メニューã®åˆæœŸå€¤è¨­å®šç­‰ã«ä½¿ç”¨ã—ã¾ã™ã?上記ã?例ã§ã¯ã€AAA ãŒå?ã§ã€ãれ以é™ã?ã€?
046     * 引数ã«ãªã‚Šã¾ã™ã?
047     * åˆã?$Cã«ã¯è‡ªåˆ??身ã®ã‚«ãƒ©ãƒ?を割り当ã¦ã¾ã™ã?
048     * ã“ã?機è?を使用ã™ã‚Œã°ã€å‹•çš?ƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’行ã”ã¨ã«æ¡ä»¶ã‚’変ãˆã¦ä½œæ?ã™ã‚‹ã“ã¨ã?
049     * å¯èƒ½ã«ãªã‚Šã¾ã™ã?
050     * 例:select KEY,LABEL from xx where KUBUN='$2' and CDK='$3'
051     * ã•らã«ã€å?ã®æ–?­—å?"AAA:BBB:CCC:DDD"ã¯ã€?0 ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚Œã¾ã™ã?割り当ã¦ãŒãªã?
052     * 変数ã¯ã€?"(ゼロæ–?­—å?)ã¨ã—ã¦ã€æ‰±ã‚れã¾ã™ã?
053     *
054     * ç·¨é›?ƒ‘ラメータã«"SEQ"ã¨è¨˜è¿°ã™ã‚‹ã“ã¨ã§æ­£æ–¹å‘ã«ã—ã‹é¸ã¹ãªã?‚·ãƒ¼ã‚¯ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’実ç¾ã§ãã¾ã™ã?
055     * ã“れã«ã‚ˆã‚Šã€ã‚·ãƒ¼ã‚±ãƒ³ã‚¹ã«ã‚¹ãƒ??タスをé?ã«æŒ™ã’ã¦ã?よã†ãªã€ã?ルãƒ?‚¦ãƒ³ãƒ¡ãƒ‹ãƒ¥ãƒ¼
056     * を作æ?ã™ã‚‹ã“ã¨ãŒå?æ¥ã¾ã™ã?(é€?«æˆ»ã‚Œãªã?ƒ¡ãƒ‹ãƒ¥ãƒ¼)
057     *
058     * カラãƒ??表示ã«å¿?¦ãªå±žæ?ã¯, DBColumn オブジェクãƒ?よりå–り出ã—ã¾ã™ã?
059     * ã“ã?クラスã¯ã€DBColumn オブジェクト毎ã«?‘ã¤ä½œæ?ã•れã¾ã™ã?
060     *
061     * @og.rev 3.2.3.0 (2003/06/06) æ–°è¦ä½œæ?
062     * @og.rev 3.4.0.1 (2003/09/03) ?¤?¢æ¤œç´¢ã‚’リアルタイãƒ?«å¤‰æ›´ã€?
063     * @og.rev 4.3.6.0 (2009/04/01) eventColumn対�
064     * @og.rev 5.4.3.6 (2012/01/19) コメント変更
065     * @og.group �?タ編�
066     *
067     * @version  4.0
068     * @author       Kazuhiko Hasegawa
069     * @since    JDK5.0,
070     */
071    public class Editor_DBMENU extends AbstractEditor {
072            //* ã“ã?プログラãƒ??VERSIONæ–?­—å?を設定ã—ã¾ã™ã?       {@value} */
073            private static final String VERSION = "5.5.1.0 (2012/04/03)" ;
074    
075            private final String query ;
076            private final String dbid ;
077            private final String lang ;                             // 4.0.0 (2006/11/15)
078            private final boolean addNoValue ;              // 3.5.5.7 (2004/05/10)
079            private final boolean seqFlag ;                 // 3.6.0.6 (2004/10/22)
080            private final String useSLabel ;        // 5.5.1.0 (2012/04/03)
081    
082            /**
083             * ãƒ?ƒ•ォルトコンストラクターã€?
084             * ã“ã?コンストラクターã§ã€åŸºæœ¬ã‚ªãƒ–ジェクトを作æ?ã—ã¾ã™ã?
085             *
086             * @og.rev 3.4.0.1 (2003/09/03) åˆæœŸå€¤ã§QUERYæ–?‚’キープã™ã‚‹ã?
087             * @og.rev 3.6.0.6 (2004/10/22) シーケンスアクセス機è?(seqFlag)を追åŠ?—ã¾ã?
088             * @og.rev 5.5.1.0 (2012/04/03) Slabel対�
089             *
090             */
091            public Editor_DBMENU() {
092                    // 4.3.4.4 (2009/01/01)
093    //              super();
094                    query   = null;
095                    dbid    = null;
096                    lang    = null;                 // 4.0.0 (2006/11/15)
097                    addNoValue = false;             // 3.5.5.7 (2004/05/10)
098                    seqFlag    = false;             // 3.6.0.6 (2004/10/22)
099                    useSLabel = "auto";             // 5.5.1.0 (2012/04/03)
100            }
101    
102            /**
103             * コンストラクター�
104             *
105             * @og.rev 3.3.1.1 (2003/07/03) name , attributes 属æ?ã‚?final ã«ã™ã‚‹ã€?
106             * @og.rev 3.4.0.1 (2003/09/03) 継承ã®è¦ªå…??変更ã«ä¼´ã?®Ÿè£??移動ã?
107             * @og.rev 3.5.5.7 (2004/05/10) addNoValue 属æ?を追åŠ?—ã¾ã™ã?
108             * @og.rev 3.5.5.9 (2004/06/07) editorParam 属æ?ã?null ã®å ´åˆã?ã€ã‚¨ãƒ©ãƒ¼ã¨ã—ã¾ã™ã?
109             * @og.rev 3.5.6.0 (2004/06/18) XHTMLTag ã® å†?ƒ¨é…å? SELECT_KEY を隠蔽ã—ã¾ã™ã?
110             * @og.rev 3.6.0.6 (2004/10/22) シーケンスアクセス機è?(seqFlag)を追åŠ?—ã¾ã?
111             * @og.rev 5.1.7.0 (2010/06/01) 動的プルãƒ?‚¦ãƒ³å®Ÿè£?¦‹ç›´ã?
112             * @og.rev 5.5.1.0 (2012/04/03) Slabel対�
113             *
114             * @param       clm     DBColumnオブジェク�
115             */
116            private Editor_DBMENU( final DBColumn clm ) {
117            //      super( clm );
118                    name            = clm.getName();
119                    addNoValue      = clm.isAddNoValue() ;          // 3.5.5.7 (2004/05/10)
120                    query           = clm.getEditorParam();
121                    dbid            = clm.getDbid();
122                    lang            = clm.getLang();                        // 4.0.0 (2006/11/15)
123                    seqFlag         = false;                // 3.6.0.6 (2004/10/22)
124    //              eventColumn = clm.getEventColumn(); // 4.3.6.0 (2009/04/01)
125    //              eventURL        = clm.getEventURL();    // 4.3.6.0 (2009/04/01)
126    //              editor          = clm.getEditor();              // 4.3.6.0 (2009/04/01)
127                    useSLabel = clm.getUseSLabel() ;        // 5.5.1.0 (2012/04/03)
128    
129                    // 3.5.5.9 (2004/06/07)
130                    if( query == null || query.length() == 0 ) {
131                            String errMsg = "DBMENU Editor ã§ã¯ã€ç·¨é›?ƒ‘ラメータã¯å¿??ã§ã™ã?"
132                                            + " name=[" + name + "]" + HybsSystem.CR ;
133                            throw new HybsSystemException( errMsg );
134                    }
135    
136                    String  disabled = clm.isWritable() ? null : "disabled" ;
137    
138                    attributes = new Attributes();
139                    attributes.set( "disabled"      ,disabled );
140    
141                    attributes.addAttributes( clm.getEditorAttributes() );
142                    optAttr = attributes.get( "optionAttributes" );
143                    tagBuffer.add( XHTMLTag.selectAttri( attributes ) );
144            }
145    
146            /**
147             * å?‚ªãƒ–ジェクトã‹ã‚‰è?åˆ??インスタンスを返ã—ã¾ã™ã?
148             * 自åˆ??身をキャãƒ?‚·ãƒ¥ã™ã‚‹ã®ã‹ã?æ–°ãŸã«ä½œæ?ã™ã‚‹ã®ã‹ã?ã€å„サブクラスã®å®Ÿè£?«
149             * ã¾ã‹ã•れã¾ã™ã?
150             *
151             * @param       clm     DBColumnオブジェク�
152             *
153             * @return      CellEditorオブジェク�
154             */
155            public CellEditor newInstance( final DBColumn clm ) {
156                    return new Editor_DBMENU( clm );
157            }
158    
159            /**
160             * ãƒ??ã‚¿ã®ç·¨é›?”¨æ–?­—å?ã‚’è¿”ã—ã¾ã™ã?
161             *
162             * ã“ã“ã§ã¯ã€AAA:BBB:CCC:DDD ã¨ã?†å€¤ã‚’ã?$1,$2,$3,$4 ã«å‰²ã‚Šå½“ã¦ãªãŠã—ã¦ã€?
163             * QUERYを実行ã—ã¾ã™ã?ã¾ãŸã?$1 ã¯ã€æœ¬æ¥ã®å€¤ã¨ã—ã¦ã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã®åˆæœŸå€¤è¨­å®šç­‰ã«
164             * 使用ã—ã¾ã™ã?上記ã?例ã§ã¯ã€AAA ãŒå?ã§ã€ãれ以é™ã?ã€å¼•æ•°ã«ãªã‚Šã¾ã™ã?
165             * ã•らã«ã€å?ã®æ–?­—å?"AAA:BBB:CCC:DDD"ã¯ã€?0 ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚Œã¾ã™ã?割り当ã¦ãŒãªã?
166             * 変数ã¯ã€?"(ゼロæ–?­—å?)ã¨ã—ã¦ã€æ‰±ã‚れã¾ã™ã?
167             * åˆã?$Cã«ã¯è‡ªåˆ??身ã®ã‚«ãƒ©ãƒ?を割り当ã¦ã¾ã™ã?
168             *
169             * @og.rev 3.4.0.1 (2003/09/03) リアルタイãƒ?§å€¤ã‚’作æ?ã™ã‚‹æ§˜ã«å¤‰æ›´ã€?
170             * @og.rev 3.5.5.5 (2004/04/23) æ–°è¦ã« Attributes オブジェクトを作æ?ã™ã‚‹æ–¹å¼ã‚’æ­¢ã‚ã¾ã™ã?
171             * @og.rev 4.3.7.2 (2009/06/15) 属æ?ã§idãŒå?力ã•れる場åˆã?ã€idã‚’å?力ã—ãªã?
172             * @og.rev 5.1.3.0 (2010/02/01) ä¸?¦§è¡¨ç¤ºã®ã¿ã§ã€ãƒ„ールãƒãƒƒãƒ—表示を行ã†ã€?
173             * @og.rev 5.1.7.0 (2010/06/01) 動的プルãƒ?‚¦ãƒ³å®Ÿè£?¦‹ç›´ã?
174             * @og.rev 5.5.1.0 (2012/04/03) Slabel対�
175             *
176             * @param       value 入力å?
177             *
178             * @return      ãƒ??ã‚¿ã®ç·¨é›?”¨æ–?­—å?
179             */
180            @Override
181            public String getValue( final String value ) {
182    //              final boolean uslbl = !"true".equals(useSLabel) ? false : true; // 5.5.1.0 (2012/04/03)
183                    final boolean uslbl = "true".equalsIgnoreCase( useSLabel );             // 5.5.1.0 (2012/04/03)
184    
185                    TagBuffer tag = new TagBuffer( "select" );
186                    tag.add( "name"    , name );
187                    if( attributes.get( "id" ) == null || attributes.get( "id" ).length() == 0 ) { // 4.3.7.2 (2009/06/15)
188                            tag.add( "id"      , name ); // 4.3.6.0 (2009/04/01)
189                    }
190                    tag.add( tagBuffer.makeTag() );
191                    tag.add( optAttr );             // 3.5.5.8 (2004/05/20)
192    
193                    // 5.1.3.0 (2010/02/01)
194    //              tag = getOption( tag,value );
195    //              tag = getOption( tag,value,false );
196                    tag = getOption( tag,value,uslbl ); // 5.5.1.0 (2012/04/03)
197    
198                    return tag.makeTag();
199    //              return tag.makeTag() + createEventColumnJS( name, editor, -1, eventURL ); // 4.3.6.0 (2009/04/01)
200            }
201    
202            /**
203             * name属æ?を変ãˆãŸã?ãƒ??タ表示/ç·¨é›?”¨ã®HTMLæ–?­—å?を作æ?ã—ã¾ã™ã?
204             * ãƒ??ブル上ã? name 㫠行番å·ã‚’付加ã—ã¦ã€åå‰_è¡Œç•ªå· ã§ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼ã‚’作æ?ã?
205             * ãƒªã‚¯ã‚¨ã‚¹ãƒˆæƒ…å ±ã‚’ï¼‘ã¤æ¯Žã?フィールドã§å‡¦ç?§ãã¾ã™ã?
206             *
207             * ã“ã“ã§ã¯ã€AAA:BBB:CCC:DDD ã¨ã?†å€¤ã‚’ã?$1,$2,$3,$4 ã«å‰²ã‚Šå½“ã¦ãªãŠã—ã¦ã€?
208             * QUERYを実行ã—ã¾ã™ã?ã¾ãŸã?$1 ã¯ã€æœ¬æ¥ã®å€¤ã¨ã—ã¦ã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã®åˆæœŸå€¤è¨­å®šç­‰ã«
209             * 使用ã—ã¾ã™ã?上記ã?例ã§ã¯ã€AAA ãŒå?ã§ã€ãれ以é™ã?ã€å¼•æ•°ã«ãªã‚Šã¾ã™ã?
210             * ã•らã«ã€å?ã®æ–?­—å?"AAA:BBB:CCC:DDD"ã¯ã€?0 ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚Œã¾ã™ã?割り当ã¦ãŒãªã?
211             * 変数ã¯ã€?"(ゼロæ–?­—å?)ã¨ã—ã¦ã€æ‰±ã‚れã¾ã™ã?
212             * åˆã?$Cã«ã¯è‡ªåˆ??身ã®ã‚«ãƒ©ãƒ?を割り当ã¦ã¾ã™ã?
213             *
214             * @og.rev 2.0.0.3 (2002/09/26) optionAttributes 属æ?ã« "$i" を使ã?¨ãã?行数ã«ç½®ãæ›ã‚‹æ©Ÿè?を追åŠ??
215             * @og.rev 3.4.0.1 (2003/09/03) リアルタイãƒ?§å€¤ã‚’作æ?ã™ã‚‹æ§˜ã«å¤‰æ›´ã€?
216             * @og.rev 3.5.5.0 (2004/03/12) åå‰ã¨è¡Œç•ªå·ã®åŒºåˆ?‚Šè¨˜å·("__")ã‚’ã?HybsSystem.JOINT_STRING  ã«å¤‰æ›´ã€?
217             * @og.rev 3.5.5.5 (2004/04/23) æ–°è¦ã« Attributes オブジェクトを作æ?ã™ã‚‹æ–¹å¼ã‚’æ­¢ã‚ã¾ã™ã?
218             * @og.rev 4.3.7.2 (2009/06/15) 属æ?ã§idãŒå?力ã•れる場åˆã?ã€idã‚’å?力ã—ãªã?
219             * @og.rev 5.1.3.0 (2010/02/01) ä¸?¦§è¡¨ç¤ºã®ã¿ã§ã€ãƒ„ールãƒãƒƒãƒ—表示を行ã†ã€?
220             * @og.rev 5.1.7.0 (2010/06/01) 動的プルãƒ?‚¦ãƒ³å®Ÿè£?¦‹ç›´ã?
221             * @og.rev 5.5.1.0 (2012/04/03) Slabel対�
222             *
223             * @param       row   行番å·
224             * @param       value 入力å?
225             *
226             * @return      ãƒ??タ表示/ç·¨é›?”¨ã®æ–?­—å?
227             */
228            @Override
229            public String getValue( final int row,final String value ) {
230    //              final boolean uslbl = ("auto".equals(useSLabel) || "true".equals(useSLabel) ) ? true : false; // 5.5.1.0 (2012/04/03)
231                    final boolean uslbl = "auto".equalsIgnoreCase( useSLabel ) || "true".equalsIgnoreCase( useSLabel );             // 5.5.1.0 (2012/04/03)
232    
233                    TagBuffer tag = new TagBuffer( "select" );
234                    String newName = name + HybsSystem.JOINT_STRING + row; // 4.3.6.0 (2009/04/01)
235                    //tag.add( "name"    , name + HybsSystem.JOINT_STRING + row );
236                    tag.add( "name", newName ); // 4.3.6.0 (2009/04/01)
237                    if( attributes.get( "id" ) == null || attributes.get( "id" ).length() == 0 ) { // 4.3.7.2 (2009/06/15)
238                            tag.add( "id"    , newName ); // 4.3.6.0 (2009/04/01)
239                    }
240                    tag.add( tagBuffer.makeTag() );
241                    tag.add( optAttr );             // 3.5.5.8 (2004/05/20)
242    
243                    // 5.1.3.0 (2010/02/01)
244    //              tag = getOption( tag,value );
245    //              tag = getOption( tag,value,true );
246                    tag = getOption( tag,value,uslbl );
247    
248                    return tag.makeTag();
249    //              return tag.makeTag() + createEventColumnJS( name, editor, row, eventURL ); // 4.3.6.0 (2009/04/01)
250            }
251    
252            /**
253             * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’TagBuffer ã«å映ã—ã¾ã™ã?
254             * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグ作æ?ã—ã?TagBuffer
255             * ã«å€¤ã‚’設定ã—ã¦è¿”ã—ã¾ã™ã?
256             *
257             * ã“ã“ã§ã¯ã€AAA:BBB:CCC:DDD ã¨ã?†å€¤ã‚’ã?$1,$2,$3,$4 ã«å‰²ã‚Šå½“ã¦ãªãŠã—ã¦ã€?
258             * QUERYを実行ã—ã¾ã™ã?ã¾ãŸã?$1 ã¯ã€æœ¬æ¥ã®å€¤ã¨ã—ã¦ã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã®åˆæœŸå€¤è¨­å®šç­‰ã«
259             * 使用ã—ã¾ã™ã?上記ã?例ã§ã¯ã€AAA ãŒå?ã§ã€ãれ以é™ã?ã€å¼•æ•°ã«ãªã‚Šã¾ã™ã?
260             * ã•らã«ã€å?ã®æ–?­—å?"AAA:BBB:CCC:DDD"ã¯ã€?0 ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚Œã¾ã™ã?割り当ã¦ãŒãªã?
261             * 変数ã¯ã€?"(ゼロæ–?­—å?)ã¨ã—ã¦ã€æ‰±ã‚れã¾ã™ã?
262             * åˆã?$Cã«ã¯è‡ªåˆ??身ã®ã‚«ãƒ©ãƒ?を割り当ã¦ã¾ã™ã?
263             *
264             * @og.rev 3.5.5.7 (2004/05/10) getOption( String value )ã®å»?­¢ã‚’å—ã‘ã¦ã€æ–°è¦ä½œæ?
265             * @og.rev 3.6.0.6 (2004/10/22) シーケンスアクセス機è?(seqFlag)を追åŠ?—ã¾ã?
266             * @og.rev 4.0.0.0 (2006/11/15) SelectionFactory ã« lang 属æ?を追åŠ?—ã¾ã™ã?
267             * @og.rev 4.3.4.0 (2008/12/01) $Cã®ã‚«ãƒ©ãƒ?ç½®æ›ãˆã‚’追åŠ?
268             * @og.rev 5.1.3.0 (2010/02/01) ä¸?¦§è¡¨ç¤ºã®ã¿ã§ã€ãƒ„ールãƒãƒƒãƒ—表示を行ã†ã€?
269             *
270             * @param       buf    ã‚¿ã‚°æ–?­—å?ã®ãƒãƒƒãƒ•ァー
271             * @param       value  é¸æŠžã•れã¦ã?‚‹å€¤
272             * @param   useShortLabel ラベル(短)ã‚’ã?ースã¨ã—ãŸã‚ªãƒ—ション表示を行ã†ã‹ã©ã?‹ã€?
273             *
274             * @return      オプションタグ
275             */
276            private TagBuffer getOption( final TagBuffer buf,final String value,final boolean useShortLabel ) {
277    
278                    // StringFormat format = new StringFormat( query,value);
279                    StringFormat format = new StringFormat( query, value, name ); // 4.3.4.0 (2008/12/01)
280                    String newQuery = format.format();
281                    String newValue = format.getValue();
282    
283                    Selection selection = SelectionFactory.newDBSelection( newQuery, dbid, lang );
284                    boolean useMultiSelect = selection.useMultiSelect();
285                    if( useMultiSelect ) {
286                            buf.add( "onkeydown", "setKeySelect(this);" );
287                    }
288    
289                    if( addNoValue ) {
290                            // 5.1.3.0 (2010/02/01)
291    //                      buf.setBody( Selection.NO_VALUE_OPTION + selection.getOption( newValue, seqFlag ) );
292                            buf.setBody( Selection.NO_VALUE_OPTION + selection.getOption( newValue, seqFlag, useShortLabel ) );
293                    }
294                    else {
295                            // 5.1.3.0 (2010/02/01)
296    //                      buf.setBody( selection.getOption( newValue, seqFlag ) );
297                            buf.setBody( selection.getOption( newValue, seqFlag, useShortLabel ) );
298                    }
299    
300                    return buf;
301            }
302    }