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