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.html; 017 018 import java.util.ArrayList; 019 import java.util.Arrays; 020 import java.util.Iterator; 021 import java.util.List; 022 import java.util.Map; 023 import java.io.Writer; 024 import java.io.IOException; 025 026 import org.opengion.fukurou.util.StringUtil; 027 import org.opengion.fukurou.util.Attributes; 028 029 import org.opengion.hayabusa.common.HybsSystem; 030 import org.opengion.hayabusa.common.HybsSystemException; 031 import org.opengion.hayabusa.db.DBColumn; 032 import org.opengion.hayabusa.db.DBTableModel; 033 import org.opengion.hayabusa.resource.ResourceManager; 034 035 /** 036 * ViewForm インターフェース の実?bstractクラスです? 037 * これ?共通?スーパ?クラスとして ?表示フォー?例:HTML表示?に使?す? 038 * 039 * こ?クラス は、setter/getterメソ?の?ォルト実?提供して?す? 040 * ?表示フォー?対応したサブクラス上で, create() をオーバ?ライドして下さ?? 041 * 042 * @og.group 画面表示 043 * 044 * @version 4.0 045 * @author Kazuhiko Hasegawa 046 * @since JDK5.0, 047 */ 048 public abstract class AbstractViewForm implements ViewForm { 049 // 5.2.1.0 (2010/10/01) 050 private final int COLUMNS_MAXSIZE = HybsSystem.sysInt( "HTML_COLUMNS_MAXSIZE" ) ; // 表示フィールド?大きさ 051 052 // 3.8.0.3 (2005/07/15) 新しいヘッ??固定用のDIV要??る? 053 private static final String LAYER_ST0 = "" ; 054 // 4.2.0.0 (2008/03/18) ビューサイズ??ため削除 055 // private static final String LAYER_ST2 = 056 // "<div id=\"divPos\">" 057 // + "<div id=\"outer\" >" 058 // + "<div id=\"layer\" onscroll=\"SetScrollHeader(this);\">" 059 // + "<div id=\"divHide\">" ; 060 private static final String LAYER_END0 = "" ; 061 private static final String LAYER_END2 = "<a href=\"#top\" name=\"h_end\" id=\"h_end\" ></a></div></div></div></div>" ; 062 063 // 5.1.8.0 (2010/07/01) groupClass のタイプを定義します? 064 private static enum CLM_GRP { KIGO , CHAR }; 065 066 private String name = ""; // メニューの名前 067 private DBTableModel table = null; 068 private DBColumn[] dbColumn = null; 069 private boolean[] clmWritable = null; 070 private boolean[] writeCtrl = null; // 3.8.0.9 (2005/10/17) 071 private boolean[] clmDisplay = null; 072 private boolean[] clmGroup = null; // 3.8.5.0 (2006/03/20) 073 private String groupClass = ""; // 5.1.8.0 (2010/07/01) 074 private CLM_GRP groupType = null; // 5.1.8.0 (2010/07/01) 075 private boolean[] sortKeys = null; // 3.6.0.0 (2004/09/17) 076 private boolean[] useEventCols = null; // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 077 private boolean useSorterKeys = false; // 3.6.0.0 (2004/09/17) ?変数 078 private String sorterQuery = ""; // 3.6.0.0 (2004/09/17) ?変数 079 private String viewFormID = null; 080 private int startNo = 0 ; 081 private int pageSize = HybsSystem.sysInt( "HTML_PAGESIZE" ) ; 082 private boolean rowWritableFlag = false; // ?カラ??writable か? 083 private ViewMarker viewLink = null; 084 private ViewMarker viewMarker = null; 085 private ViewMarker editMarker = null; // 3.8.6.1 (2006/10/20) 086 private String selectedType = "checkbox"; 087 private String numberType = "sequence" ; // 3.5.1.0 (2003/10/03) 新規作? 088 private int numberTypeClm = -1; // 3.5.1.0 (2003/10/03) 新規作? 089 private String[] numberTypeData = null; // 3.5.1.0 (2003/10/03) 新規作? 090 private String optTypeAttri = null; 091 private boolean noMessage = false; 092 private int backLinkCount = 0 ; 093 private int headerSkipCount = 0; // 0:通常ヘッ??n:n回ごとに現れる 094 private boolean skip = ViewForm.DEFAULT_SKIP; // 3.5.3.1 (2003/10/31) 095 private int useCheckControl = 0 ; // 3.7.0.1 (2005/01/31) 096 private boolean useTableSorter = HybsSystem.sysBool( "VIEW_USE_TABLE_SORTER" ) ; // 3.5.4.7 (2004/02/06) 097 private boolean numberDisplay = true ; // 3.5.5.0 (2004/03/12) 098 private int scrollRowNo = -1; // 3.7.0.3 (2005/03/01) 099 100 // 3.5.4.6 (2004/01/30) ヘッ????を定義しておきます? 101 private static final String NO_HEADER = "No" ; 102 103 // 3.5.4.8 (2004/02/23) ViewParamTag のパラメータを受け取ります? 104 private Map<String,String> viewParam = null; // 4.3.3.6 (2008/11/15) Generics警告対? 105 106 //5.5.8.3 (2012/11/17) Stringでなく?Objectタイプをもてるよ?する?積上げガント対応? 107 // private Map<String,Object> viewObject = null; 108 private ArrayList<String[]> viewArrayList = null; // 5.5.9.0 (2012/12/03) ObjectではなくArrayList 109 110 private int columnCount = 0 ; // 3.5.5.7 (2004/05/10) 111 private int rowCount = 0 ; // 4.0.0 (2006/01/06) 112 113 // 3.5.6.2 (2004/07/05) ゼブラ模様??を、ViewForm としてサポ?? 114 // 0(ゼブラな??1(ワーニング)?2以?エラー)?(ゼブラ)?以?行数まと? 115 private int bgColorCycle = 1 ; 116 // 行ごとに色を変更する時?、デフォルトクラス属? 117 private static final String BG_COLOR_ROW0 = " class=\"row_0\""; 118 // 行ごとに色を変更する時?、?り替え後クラス属? 119 private static final String BG_COLOR_ROW1 = " class=\"row_1\""; 120 121 // 行ごとに色を変更する時?、?り替え後クラス属? 122 private static final String BG_COLOR_ROWSEL = " class=\"row_sel\""; // 3.7.0.3 (2005/03/01) 123 124 // 警告時の行ごとに色を変更する時?、デフォルトクラス属? 125 private static final String BG_WARNING_COLOR_ROW0 = " class=\"row_0 row_warning\""; 126 // 警告時の行ごとに色を変更する時?、?り替え後クラス属? 127 private static final String BG_WARNING_COLOR_ROW1 = " class=\"row_1 row_warning\""; 128 129 // エラー時?行ごとに色を変更する時?、デフォルトクラス属? 130 private static final String BG_ERROR_COLOR_ROW0 = " class=\"row_0 row_error\""; 131 // エラー時?行ごとに色を変更する時?、?り替え後クラス属? 132 private static final String BG_ERROR_COLOR_ROW1 = " class=\"row_1 row_error\""; 133 134 private String color_row0 = BG_COLOR_ROW0 ; 135 private String color_row1 = BG_COLOR_ROW1 ; 136 137 // 5.1.8.0 (2010/07/01) 行に対して、動?クラス属?を付与するカラ?を指定します? 138 private int bgColorClsClmNo = -1; 139 140 // 3.5.6.4 (2004/07/16) 141 private boolean useScrollBar = HybsSystem.sysBool( "VIEW_USE_SCROLLBAR" ) ; 142 143 // 3.6.0.0 (2004/09/17) 144 private boolean firstChecked = false ; 145 146 // 3.7.1.1 (2005/05/31) SEL_ROW機?使用時に、BG_COLOR_ROWSEL の使用 ?無を指定します? 147 private boolean useSelRowColor = false ; 148 149 // 4.0.0 (2007/04/16) tableタグを?力するときに付与します? 150 private String clazz = "viewTable"; 151 152 // 4.0.0.0 (2007/11/27) ResourceManagerを設定します?(クロス?で使用) 153 private ResourceManager resourceManager = null; 154 155 // 4.2.0.0 (2008/03/03) ビューの?高さを指定できるようにします? 156 private String height = null; 157 private String width = null; 158 159 // 4.3.1.0 (2008/09/08) 160 private boolean skipNoEdit = false; 161 162 // 4.3.3.0 (2008/10/01) 画面遷移なしモード時に?に出力する行番号及?改廃Cのキーを定義します? 163 private static final String hiddenRowKey = "rid"; 164 private static final String hiddenCdkhKey = "kh"; 165 166 private boolean noTransition= false; 167 168 // 5.1.7.0 (2010/06/01) ViewFormのキャ?ュ復?画面ID単位に行う 169 private String gamenId = null; 170 171 // 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?を利用するカラ??します? 172 private boolean[] clmBulkSet = null; 173 174 // 5.5.4.2 (2012/07/13) mustとmustAnyを保持する 175 private String[] nullCheck = null; 176 private String[] mustAnyCheck= null; // 3.8.0.9 (2005/10/17) 177 178 /** 179 * 初期化します? 180 * ここでは、?部で使用されて?キャ?ュをクリアし? 181 * 新しいモ?(DBTableModel)と??lang) を?に???タを?構築します? 182 * なお???ブルモ?に対してViewFormで変更を加える場合?、変更処?行った後に 183 * こ?メソ?を実行するよ?して下さ?? 184 * 185 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 186 * @og.rev 3.5.6.1 (2004/06/25) lang ?コー?属?を削除します? 187 * @og.rev 3.5.6.3 (2004/07/12) 呼ばれたら??初期化するよ?修正(?戻? 188 * @og.rev 3.6.0.0 (2004/09/17) sortKeys 追? 189 * @og.rev 3.8.0.9 (2005/10/17) writeCtrl 追? 190 * @og.rev 3.8.5.0 (2006/03/20) clmGroup 追? 191 * @og.rev 4.0.0.0 (2006/01/06) rowCount 追? 192 * @og.rev 4.0.1.0 (2007/12/13) コメント?追? 193 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 194 * @og.rev 5.2.0.0 (2010/09/01) 2回?続登録時に選択行にスクロールしな?グを修正? 195 * @og.rev 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?を利用するカラ?clmBulkSet) 追? 196 * @og.rev 5.5.4.2 (2012/07/13) mustとmustany保持 197 * 198 * @param table DBTableModelオブジェク? 199 */ 200 public void init( final DBTableModel table ) { 201 this.table = table; 202 if( table != null ) { 203 rowCount = table.getRowCount(); // 4.0.0 (2006/01/06) 204 columnCount = table.getColumnCount(); 205 clmWritable = new boolean[ columnCount ]; 206 writeCtrl = new boolean[ columnCount ]; // 3.8.0.9 (2005/10/17) 207 clmDisplay = new boolean[ columnCount ]; 208 clmGroup = new boolean[ columnCount ]; // 3.8.5.0 (2006/03/20) 209 sortKeys = new boolean[ columnCount ]; // 3.6.0.0 (2004/09/17) 210 dbColumn = new DBColumn[ columnCount ]; 211 useEventCols= new boolean[ columnCount ]; // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 212 clmBulkSet = new boolean[ columnCount ]; // 5.2.1.0 (2010/10/01) 213 Arrays.fill( clmWritable,DEFAULT_CLM_WRITABLE ); // カラ??書込み許可 214 Arrays.fill( writeCtrl,false ); // 書き込み制御の許可 215 Arrays.fill( clmDisplay ,true ); // カラ??表示許可 216 Arrays.fill( clmGroup ,false ); // 3.8.5.0 (2006/03/20) カラ??グループ化 217 Arrays.fill( sortKeys ,false ); // すべてリンクしな?設定する? 218 Arrays.fill( useEventCols, false ); // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 219 Arrays.fill( clmBulkSet, false ); // 5.2.1.0 (2010/10/01) 220 for( int i=0; i<columnCount; i++ ) { 221 dbColumn[i] = table.getDBColumn( i ); 222 } 223 224 // ?カラ?(??のカラ??列0番目)?writable か? 225 rowWritableFlag = "WRITABLE".equalsIgnoreCase( getColumnName(0) ); 226 227 // 5.2.0.0 (2010/09/01) 2回?続登録時に選択行にスクロールしな?グを修正? 228 scrollRowNo = -1; 229 firstChecked = false; 230 231 // 5.5.4.2 (2102/07/13) 232 nullCheck = table.getMustArray(); 233 mustAnyCheck = table.getMustAnyArray(); 234 } 235 } 236 237 /** 238 * ?の DBTableModel を返します? 239 * 240 * @return DBTableModelオブジェク? 241 */ 242 public DBTableModel getDBTableModel() { 243 return table; 244 } 245 246 /** 247 * ViewForm の識別IDをセ?します? 248 * これは、ViewFormFactory でプ?ルする場合?識別キーになります? 249 * プ?ルに戻すときに自??身に こ?識別IDを使用します? 250 * 251 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 252 * @og.rev 3.5.6.2 (2004/07/05) メソ?名がまぎらわし?、変更します? 253 * 254 * @param viewFormID 識別ID 255 */ 256 public void setId( final String viewFormID ) { 257 this.viewFormID = viewFormID; 258 } 259 260 /** 261 * ViewForm の識別IDを返します? 262 * これは、ViewFormFactory でプ?ルする場合?識別キーになります? 263 * プ?ルに戻すときに自??身に こ?識別IDを使用します? 264 * 265 * @og.rev 3.5.6.2 (2004/07/05) メソ?名がまぎらわし?、変更します? 266 * 267 * @return 識別ID 268 */ 269 public String getId() { 270 return viewFormID; 271 } 272 273 /** 274 * DBTableModel から HTML??を作?して返します? 275 * 276 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 277 * 278 * @return DBTableModelから作?され?HTML?? 279 */ 280 public String create() { 281 return create( 0, rowCount ); 282 } 283 284 /** 285 * DBTableModel から View??を作?して、Writer にセ?します? 286 * 処??容は、create( int , int ) と同じですが、中間???(StringBuilder) 287 * を作?せずに、直接、Writer に書き?します? 288 * よって、データ作?途中でエラーが発生しても?すでに?つか???タは 289 * クライアントに返されて?す? 290 * 291 * @og.rev 5.0.0.1 (2009/08/15) 直接出力用の Writer 引数追? 292 * 293 * @param startNo 表示開始位置 294 * @param pageSize 表示件数 295 * @param wrt 直接登録用の Writer 296 */ 297 public void create( final int startNo, final int pageSize, final Writer wrt ) throws IOException { 298 String errMsg = "こ?メソ?は、直接登録用の Writer のビューでのみ使用できます?"; 299 throw new UnsupportedOperationException( errMsg ); 300 } 301 302 /** 303 * ?をクリア(初期?します? 304 * 305 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 306 * @og.rev 3.5.1.0 (2003/10/03) displayNumber ?。numberType 新規追?? 307 * @og.rev 3.5.2.0 (2003/10/20) headerSkipCount属?を追? 308 * @og.rev 3.5.3.1 (2003/10/31) skip属?を追? 309 * @og.rev 3.5.4.3 (2004/01/05) useCheckControl属?を追? 310 * @og.rev 3.5.4.3 (2004/01/05) viewFormID属?を削除(初期化しな? 311 * @og.rev 3.5.4.7 (2004/02/06) useTableSorter属?を追? 312 * @og.rev 3.5.4.7 (2004/02/06) columnMaxSize は使用されて???で削除します? 313 * @og.rev 3.5.4.8 (2004/02/23) ViewParamTag のパラメータを追?ます? 314 * @og.rev 3.5.5.0 (2004/03/12) numberType 属?の "delete" 値追?伴な??numberDisplay 変数の追?? 315 * @og.rev 3.5.6.2 (2004/07/05) bgColorCycle 変数の追?? 316 * @og.rev 3.5.6.4 (2004/07/16) useScrollBar 変数の追?? 317 * @og.rev 3.6.0.0 (2004/09/17) sortKeys , firstChecked , useSorterKeys , sorterQuery 変数の追?? 318 * @og.rev 3.7.0.1 (2005/01/31) 全件チェ?コントロール変更( boolean ?int ) 319 * @og.rev 3.7.1.1 (2005/05/31) useSelRowColor 変数の追?? 320 * @og.rev 3.8.0.3 (2005/07/15) scrollBarType 変数の追? 321 * @og.rev 3.8.0.9 (2005/10/17) writeCtrl 変数の追? 322 * @og.rev 3.8.5.0 (2006/03/20) clmGroup 変数の追? 323 * @og.rev 3.8.6.1 (2006/10/20) editMarker 変数の追? 324 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 325 * @og.rev 5.1.8.0 (2010/07/01) groupClass , groupType 変数の追? 326 * @og.rev 5.1.8.0 (2010/07/01) bgColorClsClmNo 属?を追?ます? 327 * @og.rev 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?を利用するカラ?clmBulkSet) 追? 328 * @og.rev 5.5.4.2 (2012/07/13) mustとmustany追? 329 * @og.rev 5.5.9.0 (2012/12/03) viewArrayList追?viewObjectは削除) 330 */ 331 public void clear() { 332 name = ""; // メニューの名前 333 table = null; 334 dbColumn = null; 335 clmWritable = null; 336 writeCtrl = null; // 3.8.0.9 (2005/10/17) 337 clmDisplay = null; 338 clmGroup = null; // 3.8.5.0 (2006/03/20) 339 groupClass = ""; // 5.1.8.0 (2010/07/01) 340 groupType = null; // 5.1.8.0 (2010/07/01) 341 sortKeys = null; // 3.6.0.0 (2004/09/17) 342 useSorterKeys = false; // 3.6.0.0 (2004/09/17) 343 sorterQuery = ""; // 3.6.0.0 (2004/09/17) 344 startNo = 0 ; 345 pageSize = HybsSystem.sysInt( "HTML_PAGESIZE" ) ; 346 rowWritableFlag = false; // ?カラ??writable か? 347 viewLink = null; 348 viewMarker = null; 349 editMarker = null; // 3.8.6.1 (2006/10/20) 350 backLinkCount = 0; 351 selectedType = "checkbox"; 352 numberType = "sequence"; 353 numberTypeClm = -1; 354 numberTypeData = null; 355 headerSkipCount = 0; // 0:通常ヘッ??n:n回ごとに現れる 356 skip = ViewForm.DEFAULT_SKIP; // 3.5.3.1 (2003/10/31) 357 useCheckControl = 0 ; // 3.7.0.1 (2005/01/31) 358 viewParam = null; // 3.5.4.8 (2004/02/23) 359 // viewObject = null; // 5.5.8.1 (2012/11/17) 360 viewArrayList = null; // 5.5.8.3 (2012/12/03) 361 numberDisplay = true ; // 3.5.5.0 (2004/03/12) 362 columnCount = 0; // 3.5.5.7 (2004/05/10) 363 bgColorCycle = 1; // 3.5.6.2 (2004/07/05) 364 bgColorClsClmNo = -1; // 5.1.8.0 (2010/07/01) 365 color_row0 = BG_COLOR_ROW0 ; // 3.5.6.2 (2004/07/05) 366 color_row1 = BG_COLOR_ROW1 ; // 3.5.6.2 (2004/07/05) 367 useScrollBar = HybsSystem.sysBool( "VIEW_USE_SCROLLBAR" ) ; // 3.5.6.4 (2004/07/16) 368 firstChecked = false; 369 useSelRowColor = false; // 3.7.1.1 (2005/05/31) 370 height = null; // 4.2.0.0 (2008/03/18) 371 width = null; // 4.2.0.0 (2008/03/18) 372 skipNoEdit = false; // 4.3.2.0 (2008/09/10) 373 useEventCols = null; // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 374 clmBulkSet = null; // 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?を利用するカラ?clmBulkSet) 追? 375 nullCheck = null; // 5.5.4.2 (2012/07/13) 376 mustAnyCheck = null; // 5.5.4.2 (2012/07/13) 377 } 378 379 /** 380 * ??ブルのヘッ??の前に、その??タの表示?を示す文字?を作?します? 381 * [開始No - 終?o]/[件数] です? 382 * 383 * @og.rev 2.0.0.2 (2002/09/24) [1 - 4]/[4] 等?メ?ージ出力後? <br> 出力を中止? 384 * @og.rev 4.3.6.0 (2008/04/01) [1 - 4]/[4]のメ?ージをJavaScriptで入れ替えるように変更 385 * @og.rev 4.3.8.0 (2009/08/01) 同メ?ージ?対応及びheadでコントロール可能にする 386 * 387 * @param stNo 表示開始位置 388 * @param pgSize 表示件数 389 * 390 * @return ??ブルのヘッ??タグ?? 391 */ 392 protected String getCountForm( final int stNo, final int pgSize ) { 393 if( noMessage ) { return ""; } 394 395 StringBuilder out = new StringBuilder(); 396 397 int lstNo = ( stNo+pgSize > rowCount ) ? rowCount : stNo+pgSize ; 398 // 4.3.6.0 (2009/04/01) 件数表示の方法変更 399 // out.append( "[" ).append( stNo+1 ).append( " - " ).append( lstNo ).append( "]" ); 400 // out.append( "/[" ).append( rowCount ).append( "]" ); 401 // out.append( "<div id=\"originalRowCountMessage\">" ); // 4.3.8.0 (2009/08/01) idからclassに変更 402 out.append( "<div class=\"orgRowCntMsg\">" ); 403 out.append( "[" ).append( stNo+1 ).append( " - " ).append( lstNo ).append( "]" ); 404 out.append( "/[" ).append( rowCount ).append( "]" ); 405 out.append( "</div>" ); 406 // 4.3.8.0 (2009/08/01) scriptはhead読み込み方式に変更 407 // out.append( "<script language=\"javascript\">" ); 408 // out.append( "$(function(){$('#rowCountMessage').replaceWith($('#originalRowCountMessage'));})"); 409 // out.append( "</script>" ); 410 411 return out.toString() ; 412 } 413 414 /** 415 * カラ??ラベル名を返します? 416 * カラ???名に対して,見える形の??を返します? 417 * ?には,リソースバンドルと?せて,?ロケール毎にラベル? 418 * ?えます? 419 * 420 * @param column カラ?号 421 * 422 * @return カラ??ラベル? 423 */ 424 protected String getColumnLabel( final int column ) { 425 return dbColumn[column].getLabel(); 426 } 427 428 /** 429 * カラ?を返します? 430 * ??タベ?スで検索したとき?カラ???名を返します? 431 * 432 * @param column カラ?号 433 * 434 * @return カラ? 435 */ 436 protected String getColumnName( final int column ) { 437 return dbColumn[column].getName(); 438 } 439 440 /** 441 * row行,colum?の??タの値を返します? 442 * 443 * @param row 行番号 444 * @param column カラ?号 445 * 446 * @return row行,colum?の??タの値 447 */ 448 protected String getValue( final int row,final int column ) { 449 return table.getValue( row,column ) ; 450 } 451 452 /** 453 * row行,colum?の??タの値を返します? 454 * これは、データの値そ?も?ではなく?そ?値のラベル?を返します? 455 * 456 * @og.rev 3.8.0.9 (2005/10/17) 互換性確保?メソ? 457 * 458 * @param row 行番号 459 * @param column カラ?号 460 * 461 * @return row行,colum?の??タの値 462 */ 463 protected String getRendererValue( final int row,final int column) { 464 return getRendererValue( row,column,getValue( row,column ) ); 465 } 466 467 /** 468 * row行,colum?の??タの値を返します? 469 * これは、データの値そ?も?ではなく?そ?値のラベル?を返します? 470 * 471 * @og.rev 3.8.0.9 (2005/10/17) writableControl 追?よる引数変更 472 * @og.rev 3.8.5.0 (2006/03/20) clmGroup 追?よるグループ化処? 473 * @og.rev 4.0.0.0 (2005/11/30) 行番号に対応した?を返すように変更します? 474 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 475 * @og.rev 5.1.8.0 (2010/07/01) カラ?ループ? groupClass 対? 476 * 477 * @param row 行番号 478 * @param column カラ?号 479 * @param inVal ??タの値 480 * 481 * @return row行,colum?の??タの値 482 */ 483 protected String getRendererValue( final int row,final int column , final String inVal ) { 484 // 3.8.5.0 (2006/03/20) clmGroup 追?よるグループ化処? 485 // if( clmGroup[column] && row > 0 && row != startNo && 486 // inVal != null && inVal.equals( getValue( row-1,column ) ) ) { 487 // return ""; 488 // } 489 490 String val = dbColumn[column].getRendererValue( row,inVal ); 491 492 // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 493 if( useEventCols[column] && isWritable( row ) ) { 494 val = dbColumn[column].getEventColumnTag( val, getValue( row,column ), row, false ); 495 } 496 if( viewLink != null ) { 497 val = viewLink.getMarkerString( row,column,val ); 498 } 499 if( viewMarker != null ) { 500 val = viewMarker.getMarkerString( row,column,val ); 501 } 502 503 // 5.1.8.0 (2010/07/01) groupClass 対応:空??場合を??し??に処?行う? 504 // 出力する?が?空??なら?前行と同じでも?空?にしておきます? 505 if( groupType != null && 506 clmGroup[column] && row > 0 && row != startNo && 507 inVal != null && inVal.equals( getValue( row-1,column ) ) && 508 val != null && val.length() > 0 ) { 509 if( groupType == CLM_GRP.KIGO ) { 510 val = groupClass; 511 } 512 else { // groupType == CLM_GRP.CHAR 513 val = "<span class=\"" + groupClass + "\">" + val + "</span>"; 514 } 515 } 516 517 return val; 518 } 519 520 /** 521 * row行,colum?の??タの値をHTML??に変換して返します? 522 * リソースバンドルが登録されて?場合?,リソースに応じ? 523 * HTML??を作?します? 524 * 525 * @og.rev 3.8.0.9 (2005/10/17) writableControl 追?よる引数変更 526 * @og.rev 3.8.6.1 (2006/10/20) editMarker 追? 527 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 528 * 529 * @param row 行番号 530 * @param column カラ?号 531 * @param inVal ??タの値 532 * 533 * @return row行,colum?の??タの値 534 */ 535 protected String getEditorValue( final int row, final int column, final String inVal ) { 536 String val = dbColumn[column].getEditorValue( row,inVal ); 537 // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 538 if( useEventCols[column] ) { 539 val = dbColumn[column].getEventColumnTag( val, getValue( row,column ), row, true ); 540 } 541 if( editMarker != null ) { 542 val = editMarker.getMarkerString( row,column,val ); 543 } 544 545 return val; 546 } 547 548 /** 549 * row行,colum?の??タの値をHTML??に変換して返します? 550 * リソースバンドルが登録されて?場合?,リソースに応じ? 551 * HTML??を作?します? 552 * リソースバンドルが登録されて???合?,getValue( int row,int column )? 553 * 返します? 554 * 新規機?として、writableControl によるエ?ター・レン?ー?が出来ます? 555 * そ?場合?表示/編?もに、?頭のアン??バ?は削除されます? 556 * 557 * @og.rev 3.8.0.9 (2005/10/17) writableControl によるエ?ター・レン?ー?? 558 * 559 * @param row 行番号 560 * @param column カラ?号 561 * 562 * @return row行,colum?の??タの値 563 */ 564 protected String getValueLabel( final int row, final int column ) { 565 String val = getValue( row,column ) ; 566 boolean isEdit = isColumnWritable( column ) && isWritable( row ) ; 567 if( writeCtrl[ column ] && val != null && val.length() > 0 && val.charAt(0) == '_' ) { 568 isEdit = false; 569 val = val.substring(1); // 先?の '_' を削除 570 } 571 572 if( isEdit ) { 573 return getEditorValue( row,column,val ); // 引数 val 追? 574 } 575 else { 576 return getRendererValue( row,column,val ); // 引数 val 追? 577 } 578 } 579 580 /** 581 * カラ??クラスを文字?にした名称を返します? 582 * これは?HTML上??タグに?データベ?ス定義に応じたクラス? 583 * セ??CSS(Cascading Style Sheet)の class="xxxxx" とする事により 584 * ?スタイルを表現するのに使用します? 585 * 586 * ここでは, カラ?ソースの DBTYPE 属?で????(X,S9,KXなど)を返します? 587 * 588 * @og.rev 4.0.0.0 (2005/01/31) 新規作?(getColumnClassName ?getColumnDbType) 589 * @og.rev 5.2.2.0 (2010/11/01) className ?VARCHAR2,NUMBER以外?場合?、合わせて出力します? 590 * 591 * @param column カラ?号 592 * 593 * @return カラ?? DBTYPE 属? 594 */ 595 public String getColumnDbType( final int column ) { 596 // 5.2.2.0 (2010/11/01) className ?BIT の場合?み、合わせて出? 597 String clsName = dbColumn[column].getClassName(); 598 if( clsName != null && ! "VARCHAR2".equals( clsName ) && !"NUMBER".equals( clsName ) ) { 599 return clsName + " " + dbColumn[column].getDbType(); 600 } 601 602 return dbColumn[column].getDbType(); 603 } 604 605 /** 606 * カラ?書き込み可能かど?を返します? 607 * 608 * @param column カラ?号 609 * 610 * @return 書込み可能(true)?不可能(false) 611 */ 612 protected boolean isColumnWritable( final int column ) { 613 return clmWritable[ column ]; 614 } 615 616 /** 617 * カラ?書き込み可能かど?をセ?します? 618 * 619 * @param column カラ?号 620 * @param rw 書込み可能(true)?不可能(false) 621 */ 622 public void setColumnWritable( final int column,final boolean rw ) { 623 clmWritable[ column ] = rw; 624 } 625 626 /** 627 * 書き込み可能カラ?を?カンマ区?で与えます? 628 * 例?OYA,KO,HJO,SU,DYSET,DYUPD" 629 * setColumnWritable( int column,boolean rw ) の簡易版です? 630 * null を与えた?合?,なにもしません? 631 * また?全カラ?つ?、有効にする場合?、columnName="*" を設定します? 632 * 633 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 634 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 635 * 636 * @param columnName カラ? 637 */ 638 public void setColumnWritable( final String columnName ) { 639 if( columnName != null ) { 640 setBooleanArray( columnName,true,clmWritable ); 641 642 // Arrays.fill( clmWritable,false ); // カラ??書込み不許可 643 // String[] clmNames = StringUtil.csv2Array( columnName ); 644 // for( int i=0; i<clmNames.length; i++ ) { 645 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 646 // int no = table.getColumnNo( clmNames[i] ); 647 // if( no >= 0 ) { clmWritable[ no ] = true; } 648 // } 649 // } 650 // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 651 setUseEventCols(); 652 } 653 } 654 655 /** 656 * 書き込み不可カラ?を?カンマ区?で与えます? 657 * 例?OYA,KO,HJO,SU,DYSET,DYUPD" 658 * null を与えた?合?,なにもしません? 659 * また?全カラ?つ?、有効にする場合?、columnName="*" を設定します? 660 * 661 * @og.rev 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 662 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 663 * 664 * @param columnName カラ? 665 */ 666 public void setNoWritable( final String columnName ) { 667 if( columnName != null ) { 668 setBooleanArray( columnName,false,clmWritable ); 669 670 // Arrays.fill( clmWritable,true ); // カラ??書込み許可 671 // String[] clmNames = StringUtil.csv2Array( columnName ); 672 // for( int i=0; i<clmNames.length; i++ ) { 673 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 674 // int no = table.getColumnNo( clmNames[i] ); 675 // if( no >= 0 ) { clmWritable[ no ] = false; } 676 // } 677 // } 678 // 5.1.7.0 (2010/06/01) 動的プル?ン実?直? 679 setUseEventCols(); 680 } 681 } 682 683 /** 684 * ??目がイベントカラ?するかど?をセ?します? 685 * 686 * @og.rev 5.1.7.0 (2010/06/01) 新規作?(動的プル?ン実?直? 687 */ 688 private void setUseEventCols() { 689 for( int column=0; column<dbColumn.length; column++ ) { 690 String evCols = dbColumn[column].getEventColumn(); 691 if( evCols != null && evCols.length() > 0 ) { 692 String[] evColsArr = StringUtil.csv2Array( evCols ); 693 for( int i=0; i<evColsArr.length; i++ ) { 694 String evCol = evColsArr[i]; 695 if( evCol.charAt(0) == '_' ) { evCol = evCol.substring( 1 ); } 696 if( isColumnWritable( table.getColumnNo( evCol ) ) ) { 697 useEventCols[column] = true; 698 break; 699 } 700 } 701 } 702 } 703 } 704 705 /** 706 * 行指定?書込み許可を返します? 707 * 708 * @og.rev 3.5.4.2 (2003/12/15) writable カラ? "2" のときも、書き込み許可とする 709 * @og.rev 3.5.5.7 (2004/05/10) 判定ロジ?を若干見直します? 710 * 711 * @param row 行番号 712 * 713 * @return 書込み可能(true)?不可能(false) 714 */ 715 protected boolean isWritable( final int row ) { 716 boolean rtn = table.isRowWritable( row ); 717 if( rtn && rowWritableFlag ) { 718 String val = table.getValue( row,0 ); 719 rtn = ( "TRUE".equalsIgnoreCase( val ) || 720 "1".equalsIgnoreCase( val ) || 721 "2".equalsIgnoreCase( val ) ); 722 723 if( ! rtn && 724 ! "FALSE".equalsIgnoreCase( val ) && 725 ! "0".equalsIgnoreCase( val ) && 726 ! "".equalsIgnoreCase( val ) ) { 727 String errMsg = "writable は、TRUE,FALSE,0,1,2,null 以外指定できません? + 728 " row=[" + (row+1) + "] val=[" + val + "]"; 729 throw new HybsSystemException( errMsg ); 730 } 731 } 732 return rtn; 733 } 734 735 /** 736 * 書き込み可能な?rowWritable == true)のチェ?ボックスに対して 737 * 初期値?選択済みにするか?非選択済みにするかを?します? 738 * 739 * @og.rev 3.5.4.2 (2003/12/15) writable カラ? "2" のとき?チェ?を付ける? 740 * 741 * @param row 行??? 742 * 743 * @return チェ?ON(true)?チェ?OFF(false) 744 */ 745 protected boolean isChecked( final int row ) { 746 boolean rtn = table.isRowChecked( row ); 747 if( rowWritableFlag ) { 748 String val = table.getValue( row,0 ); 749 rtn = rtn || ( "2".equalsIgnoreCase( val ) ); 750 } 751 return rtn; 752 } 753 754 /** 755 * チェ?済みの行?先?に、フォーカスを当てる??、チェ?の?前? 756 * 行番号??ーのリンクを作?する為の判定を行います? 757 * つまり???行番号の次の値が?チェ?されて?かど?を判断します? 758 * さらに、これ?、?上位にチェ?されて?番号の時?み 759 * 返します?(表示??ブル中、最高?のみ、true が返る? 760 * 761 * @og.rev 3.6.0.0 (2004/09/17) 新規作? 762 * @og.rev 3.7.0.3 (2005/03/01) setScrollRowNo の対? 763 * @og.rev 3.8.8.3 (2007/02/09) ??の選択?より?行番号へのフォーカスを優? 764 * @og.rev 4.2.3.1 (2008/06/11) 1件目がチェ?されて?場合?、対象外とする? 765 * @og.rev 4.2.4.0 (2008/06/25) 1件目対象外?判定で、指定行番号へのフォーカスを優先する? 766 * @og.rev 5.1.1.1 (2009/12/02) 選択行アンカーは、?身の行に出?default.js#focus2()も合わせて変更) 767 * 768 * @param row 行??? 769 * 770 * @return チェ?ON(true)?チェ?OFF(false) 771 */ 772 protected boolean isFirstChecked( final int row ) { 773 774 // ??の?回のみ、true を返す。よって、?がtrue なら?false を返す? 775 if( firstChecked ) { return false; } 776 777 // ??次の行を見るため、?オーバ?して??確? 778 // if( row+1 >= rowCount ) { return false; } 779 if( row >= rowCount ) { return false; } // 5.1.1.1 (2009/12/02) 780 781 final boolean rtn; 782 // 3.8.8.3 (2007/02/09) ??の選択?より?行番号へのフォーカスを優? 783 if( scrollRowNo >= 0 ) { 784 // rtn = ( row+1 == scrollRowNo ); 785 rtn = ( row == scrollRowNo ); // 5.1.1.1 (2009/12/02) 786 } 787 else { 788 // 1件目がチェ?されて?場合?、対象外とする?.2.3.1 (2008/06/11) 789 if( row == 0 && table.isRowChecked( row ) ) { 790 firstChecked = true; 791 return false; 792 } 793 794 // rtn = table.isRowChecked( row+1 ); 795 rtn = table.isRowChecked( row ); // 5.1.1.1 (2009/12/02) 796 } 797 798 // ??の?回のみ、true を返す。よって、?がtrue なら?false を返す? 799 if( rtn ) { firstChecked = true; } 800 return rtn; 801 } 802 803 /** 804 * そ?行が、??象かど?をチェ?します? 805 * 処?象かど?は、書き込み可能な?rowWritable == true) 806 * で且つ チェ?された?rowChecked == true) とします? 807 * 例えば,NEXT/PREVでスキ??等?処?行う場合?? 処?象以外を 808 * スキ??することで実現できます? 809 * 810 * @param row 行番号 811 * 812 * @return 処?象(true)???象でな?false) 813 */ 814 public boolean isMarked( final int row ) { 815 return ( isWritable( row ) && isChecked( row ) ); 816 } 817 818 /** 819 * カラ?表示可能かど?を返します? 820 * もし?表示不可の場合?,こ?カラ??全??タが,表示対象から外されます? 821 * 822 * @param column カラ?号 823 * 824 * @return 表示可能(true)?不可能(false) 825 */ 826 protected boolean isColumnDisplay( final int column ) { 827 if( rowWritableFlag && column == 0 ) { return false; } 828 return clmDisplay[ column ]; 829 } 830 831 /** 832 * 表示可能なカラ??数を返します? 833 * 834 * @return 表示可能なカラ? 835 */ 836 protected int getColumnDisplayCount() { 837 int rtn = 0; 838 for( int i=0; i<columnCount; i++ ) { 839 if( isColumnDisplay(i) ) { rtn++ ; } 840 } 841 842 return rtn; 843 } 844 845 /** 846 * カラ?表示可能かど?をセ?します? 847 * DBColumnのROLE属?による表示可否は、ViewFormTag で設定されます? 848 * 849 * @param column カラ?号 850 * @param rw 表示可能(true)?不可能(false) 851 */ 852 public void setColumnDisplay( final int column,final boolean rw ) { 853 clmDisplay[ column ] = rw; 854 } 855 856 /** 857 * 表示可能カラ?を?カンマ区?で与えます? 858 * 例?OYA,KO,HJO,SU,DYSET,DYUPD" 859 * setColumnDisplay( int column,boolean rw ) の簡易版です? 860 * null を与えた?合?,なにもしません? 861 * また?全カラ?つ?、有効にする場合?、columnName="*" を設定します? 862 * 863 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 864 * 865 * @param columnName カラ? 866 */ 867 public void setColumnDisplay( final String columnName ) { 868 setBooleanArray( columnName,true,clmDisplay ); 869 870 // if( columnName != null ) { 871 // String[] clmNames = StringUtil.csv2Array( columnName ); 872 // Arrays.fill( clmDisplay ,false ); // すべて表示しな?設定する? 873 // for( int i=0; i<clmNames.length; i++ ) { 874 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 875 // int no = table.getColumnNo( clmNames[i] ); 876 // if( no >= 0 ) { clmDisplay[ no ] = true; } 877 // } 878 // } 879 // } 880 } 881 882 /** 883 * 表示不可カラ?を?カンマ区?で与えます? 884 * 例?OYA,KO,HJO,SU,DYSET,DYUPD" 885 * null を与えた?合?,なにもしません? 886 * また?全カラ?つ?、有効にする場合?、columnName="*" を設定します? 887 * 888 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 889 * 890 * @param columnName カラ? 891 */ 892 public void setNoDisplay( final String columnName ) { 893 setBooleanArray( columnName,false,clmDisplay ); 894 895 // if( columnName != null ) { 896 // String[] clmNames = StringUtil.csv2Array( columnName ); 897 // Arrays.fill( clmDisplay ,true ); // すべて表示するに設定する? 898 // for( int i=0; i<clmNames.length; i++ ) { 899 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 900 // int no = table.getColumnNo( clmNames[i] ); 901 // if( no >= 0 ) { clmDisplay[ no ] = false; } 902 // } 903 // } 904 // } 905 } 906 907 /** 908 * 同?示??タをまとめる(表示しな?カラ?を?カンマ区?で与えます? 909 * 910 * これは、カラ??グループ化?を行います? 911 * 同じカラ?号で?上?行番号と同じ?の場合に、表示しな??も?です? 912 * 対応?、表示(Renderer)時?みとします? 913 * カラ?位なので、新しいゼブラによる色?は行いません?任意?カラ?適用できる為) 914 * また?ファイル出力などの??タ自身は変更されて?せんので、そのまま??タが落ちます? 915 * また?全カラ?つ?、有効にする場合?、group="*" を設定します? 916 * 917 * @og.rev 3.8.5.0 (2006/03/20) 新規追? 918 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 919 * 920 * @param group まとめるカラ?(CSV形? 921 */ 922 public void setColumnGroup( final String group ) { 923 if( group != null ) { 924 if( groupType == null ) { groupType = CLM_GRP.KIGO ; } 925 setBooleanArray( group,true,clmGroup ); 926 927 // String[] clmNames = StringUtil.csv2Array( group ); 928 // Arrays.fill( clmGroup ,false ); // すべてグループ化しな?設定する? 929 // for( int i=0; i<clmNames.length; i++ ) { 930 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 931 // int no = table.getColumnNo( clmNames[i] ); 932 // if( no >= 0 ) { clmGroup[ no ] = true; } 933 // } 934 // } 935 } 936 } 937 938 /** 939 * 同?示??タをまとめな?ラ?を?カンマ区?で与えます? 940 * 941 * これは、カラ??グループ化?で、同?もまとめな?ラ??するほ?簡単な場合に 942 * 使用します?例えば、キー??以外?、グループ化?したい場合などに便利です? 943 * 動作?、columnGroup の動きと同じです?(まとめな?ラ??するだけです?) 944 * 945 * これは、同?示??タをまとめるカラ?の??columnGroup)と同時にセ?する 946 * ことは出来ません? 947 * また?全カラ?つ?、有効にする場合?、group="*" を設定します? 948 * 949 * @og.rev 5.1.8.0 (2010/07/01) 新規追? 950 * 951 * @param group まとめるカラ?(CSV形? 952 */ 953 public void setNoGroup( final String group ) { 954 if( group != null ) { 955 if( groupType == null ) { groupType = CLM_GRP.KIGO ; } 956 setBooleanArray( group,false,clmGroup ); 957 } 958 } 959 960 /** 961 * 同?示??タをまとめる場合?、表示方法を?します? 962 * 963 * これは、カラ??グループ化??columnGroup)を行う場合?、まとめ表示の方法を?します? 964 * なにも指定しな??合?、まとめカラ??、表示しな?ゼロ??)になります? 965 * そ?場合?先?行と同じ場合も、変更されたカラ?、NULL(ゼロ??)であった?合も? 966 * 同じ用に表示されるため?区別が付きません? 967 * そこで、前の行と同じ??タの場合に、特殊な処?行うことで、区別できるようにします? 968 * ?方法が特殊なので、注意が?です? 969 * 記号の場合? 970 * 記号(-- , ?, ?, * など)が指定された場合?、そのままの?に置き換えられます? 971 * アルファベット?場合? 972 * アルファベッ?a-z,A-Z)の場合??lt;span class="アルファベッ?>????lt;/span> 973 * 例えば、バ?カラーに色を付ける??を?灰色にする、などできます? 974 * ただし???タ量が圧倒的に増えるため?大量???タ等で使用するのは避けたほ?良?思います? 975 * 976 * @og.rev 3.8.5.0 (2006/03/20) 新規追? 977 * 978 * @param grpCls まとめ表示の方? 979 */ 980 public void setGroupClass( final String grpCls ) { 981 if( grpCls != null ) { 982 groupClass = grpCls ; 983 if( groupClass.length() == 0 ) { // ゼロ??の場? 984 groupType = CLM_GRP.KIGO ; 985 } 986 else { 987 char ch = groupClass.charAt(0); 988 if( ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'a' && ch <= 'z' ) ) { 989 groupType = CLM_GRP.CHAR ; 990 } 991 else { 992 groupType = CLM_GRP.KIGO ; 993 } 994 } 995 } 996 } 997 998 /** 999 * カラ?リンクソートを表示するカラ?を?カンマ区?で与えます? 1000 * 1001 * ヘッ??にソート用リンクを作?する useTableSorter 属? に対して? 1002 * カラ??別に作?する場合?カラ?をカンマ区??で?します? 1003 * こ? tableSorterKeys 属?は、useTableSorter 属? と無関係に、指定し? 1004 * カラ??み、リンクを表示します? 1005 * また?全カラ?つ?、有効にする場合?、columnName="*" を設定します? 1006 * 例?OYA,KO,HJO,SU,DYSET,DYUPD" 1007 * 1008 * @og.rev 3.6.0.0 (2004/09/17) 新規作? 1009 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 1010 * 1011 * @param columnName カラ? 1012 */ 1013 public void setTableSorterKeys( final String columnName ) { 1014 if( columnName != null ) { 1015 setBooleanArray( columnName,true,sortKeys ); 1016 1017 useSorterKeys = true; // 使用したことを記? 1018 // String[] clmNames = StringUtil.csv2Array( columnName ); 1019 // for( int i=0; i<clmNames.length; i++ ) { 1020 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 1021 // int no = table.getColumnNo( clmNames[i] ); 1022 // if( no >= 0 ) { sortKeys[ no ] = true; } 1023 // } 1024 // } 1025 } 1026 } 1027 1028 /** 1029 * ?ラ??フィールド???タ長を返します? 1030 * 1031 * @og.rev 3.5.5.5 (2004/04/23) DBColumn の size と maxlength の 意味を変更 1032 * 1033 * @param column カラ?号 1034 * 1035 * @return カラ? 1036 */ 1037 protected int getColumnSize( final int column ) { 1038 return dbColumn[column].getTotalSize(); // 4.0.0 (2005/01/31) メソ?名変更 1039 } 1040 1041 /** 1042 * カラ?を返します? 1043 * 1044 * @return カラ? 1045 */ 1046 protected int getColumnCount() { 1047 return columnCount ; 1048 } 1049 1050 /** 1051 * 行数を返します? 1052 * 1053 * @return 行数 1054 */ 1055 protected int getRowCount() { 1056 return rowCount; 1057 } 1058 1059 /** 1060 * リスト??スを作?する場合? name をセ?します? 1061 * 1062 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1063 * 1064 * @param name 属? 1065 */ 1066 protected void setName( final String name ) { 1067 this.name = name; 1068 } 1069 1070 /** 1071 * リスト??スを作?する場合? name を返します? 1072 * 1073 * @return name属? 1074 */ 1075 protected String getName() { 1076 return name; 1077 } 1078 1079 /** 1080 * カラ?をもとに、そのカラ?号を返します? 1081 * カラ?が存在しな??合?? HybsSystemException ?throw します? 1082 * 1083 * @param columnName カラ? 1084 * 1085 * @return カラ?号 1086 */ 1087 protected int getColumnNo( final String columnName ) { 1088 return table.getColumnNo( columnName ); 1089 } 1090 1091 /** 1092 * 表示開始位置を返します? 1093 * 1094 * @return 表示開始位置 1095 */ 1096 public int getStartNo() { 1097 return startNo; 1098 } 1099 1100 /** 1101 * 表示開始位置をセ?します? 1102 * 1103 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1104 * 1105 * @param no 表示開始位置 1106 */ 1107 public void setStartNo( final int no ) { 1108 if( no >= 0 ) { startNo = no; } 1109 } 1110 1111 /** 1112 * 先?へ戻るリンク間隔を返します? 1113 * 1114 * @return backLinkCount リンク間隔 1115 */ 1116 public int getBackLinkCount() { 1117 return backLinkCount; 1118 } 1119 1120 /** 1121 * 先?へ戻るリンク間隔をセ?します? 1122 * 1123 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1124 * 1125 * @param no リンク間隔 1126 */ 1127 public void setBackLinkCount( final int no ) { 1128 if( no >= 0 ) { backLinkCount = no; } 1129 } 1130 1131 /** 1132 * ヘッ??を?力する間隔を取得します? 1133 * 1134 * @og.rev 3.5.2.0 (2003/10/20) 新規作? 1135 * 1136 * @return ヘッ??の表示間隔 ( 0:通常ヘッ??n:n回ごとに現れる ) 1137 */ 1138 public int getHeaderSkipCount() { 1139 return headerSkipCount; 1140 } 1141 1142 /** 1143 * ヘッ??を?力する間隔をセ?します? 1144 * 1145 * 0を指定すると、繰り返しません(つまり?ヘッ??を最初に表示する?です?) 1146 * 数字を?すると、その回数毎に、??ーをデータの行に挿入します? 1147 * 1148 * @og.rev 3.5.2.0 (2003/10/20) 新規作? 1149 * 1150 * @param hsc ヘッ??の表示間隔 ( 0:通常ヘッ??n:n回ごとに現れる ) 1151 */ 1152 public void setHeaderSkipCount( final int hsc ) { 1153 headerSkipCount = hsc; 1154 } 1155 1156 /** 1157 * 表示件数を取得します? 1158 * 1159 * @return 表示件数 1160 */ 1161 public int getPageSize() { 1162 return pageSize; 1163 } 1164 1165 /** 1166 * 表示件数をセ?します? 1167 * 1168 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1169 * 1170 * @param psize 表示件数 1171 */ 1172 public void setPageSize( final int psize ) { 1173 if( psize > 0 ) { pageSize = psize; } 1174 } 1175 1176 /** 1177 * フォーマットを設定します? 1178 * ※ こ?クラスでは実?れて?せん? 1179 * 1180 * @og.rev 3.5.4.0 (2003/11/25) 新規作? 1181 * @param list TableFormatterのリス? 1182 */ 1183 public void setFormatterList( final List<TableFormatter> list ) { // 4.3.3.6 (2008/11/15) Generics警告対? 1184 String errMsg = "こ?メソ?は、フォーマット関係?ビューでのみ使用できます?"; 1185 throw new UnsupportedOperationException( errMsg ); 1186 } 1187 1188 /** 1189 * 表示時?選択用オブジェクト?タイプを?します? 1190 * ・?選択可能時? "checkbox" を指定します? 1191 * ・??選ばせる場合?, "radio" を指定します? 1192 * ・?フィールドで全件を選ぶ場合??hidden" を指定します? 1193 * ・Noカラ?のも?を表示させな??合??none" を指定します? 1194 * 初期値は?checkbox" です? 1195 * 1196 * @og.rev 2.2.0.0 (2002/12/17) 選択用オブジェクト?タイプとして"hidden" を追? 1197 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1198 * @og.rev 3.5.1.0 (2003/10/03) displayNumber ?。numberType 新規追?? 1199 * 1200 * @param type 選択用オブジェクト?タイ? "checkbox"/"radio"/"hidden"/"null" ) 1201 */ 1202 public void setSelectedType( final String type ) { 1203 if( type != null ) { 1204 if( "checkbox".equalsIgnoreCase( type ) || 1205 "radio".equalsIgnoreCase( type ) || 1206 "hidden".equalsIgnoreCase( type ) ) { 1207 selectedType = type; 1208 } 1209 else { 1210 selectedType = null; 1211 } 1212 } 1213 } 1214 1215 /** 1216 * 表示時?行番号の表示方法を?します? 1217 * ・sequenceは?から始まる?番です? 1218 * ・none を指定すると、番号は表示されません? 1219 * ・delete を指定すると、行番号表示そ?も?のタグを取り除きます?(3.5.5.0 追? 1220 * ・skip=カラ?を指定すると、そのカラ??値?NULL の場合?、番号をスキ??します? 1221 * ・view=カラ?を指定すると、そのカラ??値が?使用されます?(ラベルは付きません) 1222 * skip=XX と、view=XX は?の前後にスペ?スを?れな?下さ?? 1223 * 初期値は?sequence" です? 1224 * 1225 * @og.rev 3.5.1.0 (2003/10/03) 新規作? 1226 * @og.rev 3.5.5.0 (2004/03/12) numberType 属?の "delete" 値追?伴な??numberDisplay 変数の追?? 1227 * @og.rev 5.3.0.0 (2010/12/01) 左右?スクロール(SplitViewTag)対応?numberType 再設定時のnumberDisplay初期? 1228 * 1229 * @param type 行番号の表示方法?タイ? /sequence/none/delete/skip=カラ?/view=カラ?/ ) 1230 */ 1231 public void setNumberType( final String type ) { 1232 1233 numberType = type ; 1234 numberDisplay = true; // 5.3.0.0 (2010/12/01) numberType 再設定時のnumberDisplay初期? 1235 if( type != null && !type.startsWith( "seq" ) && !type.startsWith( "none" ) ) { 1236 if( type.startsWith( "skip=" ) ) { 1237 numberTypeClm = table.getColumnNo( type.substring( 5 ) ); 1238 numberTypeData = new String[rowCount]; 1239 int cnt = 1; 1240 for( int i=0; i<rowCount; i++ ) { 1241 String tmp = table.getValue( i,numberTypeClm ); 1242 if( tmp != null && tmp.length() > 0 ) { 1243 numberTypeData[i] = String.valueOf( cnt ); 1244 cnt++ ; 1245 } 1246 else { 1247 numberTypeData[i] = "" ; 1248 } 1249 } 1250 } 1251 else if( type.startsWith( "view=" ) ) { 1252 numberTypeClm = getColumnNo( type.substring( 5 ) ); 1253 } 1254 // 3.5.5.0 (2004/03/12) 1255 else if( type.startsWith( "delete" ) ) { 1256 numberDisplay = false; 1257 } 1258 else { 1259 // 3.5.5.0 (2004/03/12) 不正な値をエラーチェ? 1260 String errMsg = "numberType属?の値が不正です?numberType=[" + numberType + "]" + 1261 HybsSystem.CR + 1262 "設定できるのは、sequence/none/delete/skip=カラ?/view=カラ?/ です?"; 1263 throw new HybsSystemException( errMsg ); 1264 } 1265 } 1266 } 1267 1268 /** 1269 * 表示時?選択用オブジェクト?タイプを返します? 1270 * ?選択可能時? "checkbox" ??選ばせる場合?, "radio" を指定します? 1271 * 初期値は?checkbox" です? 1272 * "checkbox"/"radio"/"hidden" 以外???の場合?, null を返します? 1273 * 1274 * @return 選択用オブジェクト?タイ? "checkbox"/"radio"/"hidden"/"null" ) 1275 */ 1276 protected String getSelectedType() { 1277 return selectedType ; 1278 } 1279 1280 /** 1281 * No カラ????を取得します? 1282 * setNumberType で?した?(sequence / none / skip=カラ? / view=カラ?)に 1283 * 応じた?(レン?ーの値)を返します? 1284 * 1285 * @og.rev 3.5.1.0 (2003/10/03) 新規作? 1286 * 1287 * @param row 行番号 1288 * 1289 * @return Noカラ???? 1290 */ 1291 protected String getNumberData( final int row ) { 1292 String rtn = null; 1293 1294 if( numberType == null || numberType.startsWith( "se" ) ) { // sequence 1295 rtn = String.valueOf( row + 1 ); 1296 } 1297 else { 1298 if( numberType.startsWith( "no" ) ) { // none 1299 rtn = ""; 1300 } 1301 else if( numberType.startsWith( "vi" ) ) { // view 1302 rtn = getRendererValue( row,numberTypeClm ); 1303 } 1304 else if( numberType.startsWith( "sk" ) ) { // skip 1305 rtn = numberTypeData[row]; 1306 } 1307 } 1308 1309 return rtn ; 1310 } 1311 1312 /** 1313 * No カラ??ヘッ????を取得します? 1314 * setNumberType で?した?(sequence / none / skip=カラ? / view=カラ?)に 1315 * 応じた?(ラベル)を返します? 1316 * 具体的には、none 以外??No" と??を、none の時??"(ゼロストリング)を返します? 1317 * 1318 * @og.rev 3.5.4.6 (2004/01/30) 新規作? 1319 * 1320 * @return Noカラ??ヘッ???? 1321 */ 1322 protected String getNumberHeader() { 1323 String rtn = NO_HEADER; 1324 1325 if( numberType.startsWith( "no" ) ) { // none 1326 rtn = ""; 1327 } 1328 1329 return rtn ; 1330 } 1331 1332 /** 1333 * ??ブル等?チェ?ボックスに属?を付加しま? 1334 * JavaScript などの HTML基本タグ以外?属?を?そ?まま 1335 * チェ?ボックス/ラジオボタン等に使用します? 1336 * 1337 * @og.rev 3.1.1.0 (2003/03/28) 同期メソ?(synchronized付き)を非同期に変更する? 1338 * 1339 * @param option オプション属??? 1340 */ 1341 public void setOptionTypeAttributes( final String option ) { 1342 optTypeAttri = option; 1343 } 1344 1345 /** 1346 * ??ブル等?チェ?ボックスに属?を付加しま? 1347 * JavaScript などの HTML基本タグ以外?属?を?そ?まま 1348 * チェ?ボックス/ラジオボタン等に使用します? 1349 * 1350 * @return オプション属? 1351 */ 1352 protected String getOptionTypeAttributes() { 1353 return optTypeAttri ; 1354 } 1355 1356 /** 1357 * ?表示番号を取得します? 1358 * ?表示番号は、表示開始位置 + 表示件数 で求まります? 1359 * lastNo = startNo + pageSize; 1360 * 1361 * ただし??表示番号 > ??タ件数 の場合?? ?表示番号 = ??タ件数 1362 * とします? 1363 * なお?表示件数 ?-1 の場合???ォルト?表示件数を使用します? 1364 * 1365 * @param startNo 表示開始位置 1366 * @param pageSize 表示件数 1367 * 1368 * @return ?表示番号 1369 */ 1370 protected int getLastNo( final int startNo, final int pageSize ) { 1371 int lastNo = startNo + (( pageSize < 0 ) ? getPageSize() : pageSize ); 1372 if( lastNo > rowCount ) { 1373 lastNo = rowCount ; 1374 } 1375 1376 if( rowCount < 0 || startNo < 0 || lastNo < 0 ) { 1377 String errMsg = "startNo lastNo の?が不正です?" + HybsSystem.CR 1378 + " startNo=" + startNo + " , lastNo=" + lastNo + " , RowCount=" + rowCount; 1379 throw new HybsSystemException( errMsg ); 1380 } 1381 1382 return lastNo ; 1383 } 1384 1385 /** 1386 * ビューフォー??タイプを返します? 1387 * これは、ViewFormFactory で、org.opengion.hayabusa.html.ViewForm_ + 『type? 1388 * で作?されるサブクラスの 『type?部?返します? 1389 * 1390 * @og.rev 3.5.4.3 (2004/01/05) viewFormID を使用するように変更します? 1391 * 1392 * @return ビューフォー??タイ? 1393 */ 1394 public String getViewFormType() { 1395 return viewFormID ; 1396 } 1397 1398 /** 1399 * ビューリンクオブジェクトを設定します? 1400 * これは、ViewLink タグで作?され?キー(カラ?)とリンク??? 1401 * 持って? Attributes オブジェクトを受け取り、?部でリンク表示に 1402 * 使用します? 1403 * 1404 * @og.rev 3.5.6.4 (2004/07/16) table ?null の場合?、セ?しません? 1405 * 1406 * @param link ビューリンクオブジェク? 1407 */ 1408 public void setViewLink( final ViewMarker link ) { 1409 viewLink = link; 1410 if( viewLink != null && table != null ) { 1411 viewLink.setDBTableModel( table ) ; 1412 } 1413 } 1414 1415 /** 1416 * ビューマ?カーオブジェクトを設定します? 1417 * これは、ViewMarker タグで作?され?キー(カラ?)とマ?カー??? 1418 * 持って? Attributes オブジェクトを受け取り、?部でマ?カー表示に 1419 * 使用します? 1420 * 1421 * @og.rev 3.5.6.4 (2004/07/16) table ?null の場合?、セ?しません? 1422 * 1423 * @param marker ビューマ?カーオブジェク? 1424 */ 1425 public void setViewMarker( final ViewMarker marker ) { 1426 viewMarker = marker; 1427 if( viewMarker != null && table != null ) { 1428 viewMarker.setDBTableModel( table ) ; 1429 } 1430 } 1431 1432 /** 1433 * エ??マ?カーオブジェクトを設定します? 1434 * これは、ViewMarker タグで、isRendere="false" で作?され?エ??キー(カラ?)と 1435 * マ?カー??を持って? Attributes オブジェクトを受け取り、?部でマ?カー表示に 1436 * 使用します? 1437 * 1438 * @og.rev 3.8.6.1 (2006/10/20) 新規追? 1439 * 1440 * @param marker ビューマ?カーオブジェク? 1441 */ 1442 public void setEditMarker( final ViewMarker marker ) { 1443 editMarker = marker; 1444 if( editMarker != null && table != null ) { 1445 editMarker.setDBTableModel( table ) ; 1446 } 1447 } 1448 1449 /** 1450 * 検索結果メ?ージを表示する/しな?設定しま? 1451 * 初期値は、表示する(false)です? 1452 * 1453 * @param noMessage [true:表示しな?false:表示する] 1454 */ 1455 public void setNoMessage( final boolean noMessage ) { 1456 this.noMessage = noMessage; 1457 } 1458 1459 /** 1460 * DBColumn オブジェクトを返します? 1461 * 1462 * @og.rev 3.1.8.0 (2003/05/16) DBColumn オブジェクト取得用のメソ?追? 1463 * 1464 * @param column カラ?号 1465 * 1466 * @return DBColumnオブジェク? 1467 */ 1468 protected DBColumn getDBColumn( final int column ) { 1469 return dbColumn[column]; 1470 } 1471 1472 1473 /** 1474 * カラ??にカラ?ブジェクトを割り当てます? 1475 * カラ?ブジェクト??ラベル?ー?ど?そのカラ?報? 1476 * 保持したオブジェクトです? 1477 * 1478 * @og.rev 5.6.2.3 (2013/03/22) 新規追? 1479 * 1480 * @param column カラ?ブジェク? 1481 * @param clm ヘッ??を適応するカラ?? 1482 */ 1483 protected void setDBColumn( int column, DBColumn clm ) { 1484 dbColumn[column] = clm; 1485 } 1486 1487 /** 1488 * チェ?の入った行?みを表示させるかど??します? 1489 * 1490 * "true" で、チェ?の入った行?みを表示させます? 1491 * 従来は、TextField系のViewに対して、NEXT,PREVでチェ?の 1492 * 入った行?みを表示させる機?でしたが?Table系のViewに対しても? 1493 * 同様に機?するように、しました? 1494 * 初期値は、ViewForm.DEFAULT_SKIP です? 1495 * 1496 * @og.rev 3.5.3.1 (2003/10/31) 新規追? 1497 * 1498 * @param skp チェ?の入った行?みを表示させるかど?(true:のみ表示/false:前件表示) 1499 */ 1500 public void setSkip( final boolean skp ) { 1501 skip = skp; 1502 } 1503 1504 /** 1505 * チェ?の入った行?みを表示させるかど?(スキ??するかど?)を返します? 1506 * 1507 * skip=true で、かつ、チェ?の入って???場合に、trueを返します? 1508 * つまり?skip=trueの場合?、チェ?の入って???、スキ??すると? 1509 * 判断を行います? 1510 * skip属?の初期値は、ViewForm.DEFAULT_SKIP です? 1511 * 1512 * @og.rev 3.5.3.1 (2003/10/31) 新規追? 1513 * 1514 * @param row 行番号 1515 * 1516 * @return スキ??する(true)?スキ??しな?false) 1517 */ 1518 protected boolean isSkip( final int row ) { 1519 return skip && ! isChecked( row ); 1520 } 1521 1522 /** 1523 * チェ?ボックスの全チェ?を選択するJavaScript の機?を使用するかど?を指定します? 1524 * 1525 * 1 で、コントロール用のチェ?ボックスが現れて、この機?を使用することができるようになります? 1526 * 0 は、従来どおりです? 1527 * 使用するにあたり?jsp/commpn/default.js にJavaScriptを設定しておきます?(設定済み) 1528 * 初期値は、シス?パラメータ の VIEW_USE_CHECK_CONTROL です?(0:使用しな? 1529 * 1530 * @og.rev 3.5.4.3 (2004/01/05) 新規追? 1531 * @og.rev 3.7.0.1 (2005/01/31) 全件チェ?コントロール変更( boolean ?int ) 1532 * 1533 * @param chCtrl チェ?ボックスの全チェ?を選択する機?を使用するかど? 1534 * (1:使用する/0:使用しな?2:初期値チェ?済み) 1535 */ 1536 public void setUseCheckControl( final int chCtrl ) { 1537 useCheckControl = chCtrl; 1538 } 1539 1540 /** 1541 * チェ?ボックスの全チェ?を選択するJavaScript の機?を使用するかど?を返します? 1542 * 1543 * ??は?1:使用する/0:使用しな?2:初期値チェ?済み)の値を保持して?すが? 1544 * タグを作?する場合には、まず?使用するかど?を指定する?があるため? 1545 * 1:使用する/2:初期値チェ?済み は、true:使用する? は、false:使用しな? 1546 * を返します? 1547 * 1548 * @og.rev 3.5.4.3 (2004/01/05) 新規追? 1549 * 1550 * @return チェ?ボックスの全チェ?を選択する機?を使用するかど?(true:使用する/false:使用しな? 1551 */ 1552 protected boolean isUseCheckControl() { 1553 return useCheckControl > 0; 1554 } 1555 1556 /** 1557 * チェ?ボックスの全チェ?を選択す?タグ??を返します? 1558 * 1559 * ??は?1:使用する/0:使用しな?2:初期値チェ?済み)の値? 1560 * 保持して?す?で、それに対応した文字?を返します? 1561 * 1562 * @og.rev 3.7.0.1 (2005/01/31) 新規追? 1563 * @og.rev 5.1.8.0 (2010/07/01) 全チェ?を押した状態で画面遷移した場合にチェ?状態を保持する? 1564 * 1565 * @return チェ?ボックスの全チェ?を選択する機?を使用するかど? 1566 * (1:使用する/0:使用しな?2:初期値チェ?済み) 1567 */ 1568 protected String getAllCheckControl() { 1569 final String rtn; 1570 switch( useCheckControl ) { 1571 case 1: rtn = "<input type=\"checkbox\" name=\"ALL_CHECK\" value=\"2\" onClick=\"checkbox(this);\" />" ; 1572 break; 1573 case 2: rtn = "<input type=\"checkbox\" name=\"ALL_CHECK\" value=\"2\" onClick=\"checkbox(this);\" checked=\"checked\" />" ; 1574 break; 1575 default : rtn = "" ; 1576 } 1577 return rtn ; 1578 } 1579 1580 /** 1581 * ヘッ??にソート用リンクを作?するかど?を指定します? 1582 * 1583 * "true" で、??ーにソート用リンクを作?します? 1584 * false は、作?しません? 1585 * 1586 * @og.rev 3.5.4.7 (2004/02/06) 新規追? 1587 * 1588 * @param flag ヘッ??にソート用リンクを作?するかど?(true:作?する/false:作?しな? 1589 */ 1590 public void setUseTableSorter( final boolean flag ) { 1591 useTableSorter = flag; 1592 } 1593 1594 /** 1595 * ヘッ??にソート用リンクを作?する時?、リクエスト引数のMapを設定します? 1596 * 1597 * ソート用URLに、リクエスト時の引数を設定する?があります? 1598 * そ?ため、リクエスト時のキーと値のセ?をMapで?します? 1599 * こ?Map は、リクエストキャ?ュより取り出します? 1600 * 実?は、このMapを?に、URLのQuery部??を作?します?処?程において? 1601 * こ?Map を書き換えることは行いません? 1602 * 1603 * @og.rev 3.6.0.0 (2004/09/17) 新規作? 1604 * @og.rev 3.6.0.0 (2004/09/22) 引数?null の時?処?? 1605 * @og.rev 4.0.0.0 (2005/01/31) Map.keySet より Map.entrySet を使用するように変更 1606 * 1607 * @param map ヘッ??ソート時のリンクに追?るリクエスト変数のキャ?ュMap 1608 */ 1609 public void makeTableSorterQuery( final Map<?,?> map ) { // 4.3.3.6 (2008/11/15) Generics警告対? 1610 if( map == null ) { return; } // 3.6.0.0 (2004/09/22) 1611 1612 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_MIDDLE ); 1613 Iterator<?> ite = map.entrySet().iterator() ; // 4.0.0 (2005/01/31) 1614 while( ite.hasNext() ) { 1615 Map.Entry<?,?> entry = (Map.Entry<?,?>)ite.next(); // 4.3.3.6 (2008/11/15) Generics警告対? 1616 String key = (String)entry.getKey(); 1617 if( key != null 1618 && ! key.equalsIgnoreCase( "command" ) 1619 && ! key.equalsIgnoreCase( HybsSystem.SORT_COLUMNS ) ) { 1620 String[] vals = (String[])entry.getValue(); // 4.0.0 (2005/01/31) 1621 if( vals != null ) { 1622 for( int i=0; i<vals.length; i++ ) { 1623 buf.append( "&" ).append( key ).append( "=" ); 1624 buf.append( StringUtil.urlEncode( vals[i] ) ); 1625 } 1626 } 1627 } 1628 } 1629 1630 if( buf.length() > 0 ) { 1631 sorterQuery = buf.toString(); 1632 } 1633 } 1634 1635 /** 1636 * カラ?ート機?(リンク)の付いたラベル名を返します? 1637 * カラ???名に対して,見える形の??を返します? 1638 * ?には,リソースバンドルと?せて,?ロケール毎にラベル? 1639 * ?えます? 1640 * 1641 * @og.rev 3.5.4.7 (2004/02/06) 新規追? 1642 * @og.rev 3.6.0.0 (2004/09/17) sortKeys の使用によるカラ??別のリンク有無追? 1643 * @og.rev 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?を利用する場合?処?追? 1644 * @og.rev 5.2.3.0 (2010/12/01) チェ?ボックスでは、onChange ではなく?onClick でイベントを発生させます? 1645 * 1646 * @param column カラ?号 1647 * 1648 * @return ソート機?(リンク)の付いたラベル? 1649 */ 1650 protected String getSortedColumnLabel( final int column ) { 1651 String rtn = getColumnLabel( column ) ; 1652 1653 if( ( useSorterKeys && sortKeys[column] ) || 1654 ( ! useSorterKeys && useTableSorter ) ) { 1655 // return "<a href=\"?command=VIEW&" + 1656 // HybsSystem.SORT_COLUMNS + "=" + dbColumn[column].getName() + 1657 // sorterQuery + "\">" + 1658 // getColumnLabel( column ) + "</a>" ; // 4.0.0 (2005/01/31) 1659 rtn = "<a href=\"?command=VIEW&" + 1660 HybsSystem.SORT_COLUMNS + "=" + dbColumn[column].getName() + 1661 sorterQuery + "\">" + 1662 rtn + "</a>" ; 1663 } 1664 // else { 1665 // return getColumnLabel( column ) ; // 4.0.0 (2005/01/31) 1666 // } 1667 1668 // 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?対? 1669 if( isClmBulkSet( column ) ) { 1670 org.opengion.hayabusa.db.DBColumnConfig config = dbColumn[column].getConfig(); 1671 config.setAddNoValue( true ); 1672 if( "TEXT".equals( config.getEditor() ) ) { 1673 String mlen = config.getMaxlength(); 1674 if( mlen != null && Integer.parseInt(mlen) < COLUMNS_MAXSIZE ) { 1675 config.setViewLength( mlen ); 1676 } 1677 config.setMaxlength( "1000" ); 1678 } 1679 else if( "RADIO".equals( config.getEditor() ) ) { 1680 config.setEditor( "MENU" ); 1681 } 1682 1683 Attributes attri = new Attributes(); 1684 // 5.2.3.0 (2010/12/01) チェ?ボックスでは、onChange ではなく?onClick でイベントを発生させます? 1685 if( "CHBOX".equals( config.getEditor() ) ) { 1686 attri.add( "onClick", "bulkSet(this);" ); 1687 } 1688 else { 1689 attri.add( "onChange", "bulkSet(this);" ); 1690 attri.add( "ondblclick","bulkPaste(this);" ); 1691 } 1692 attri.add( "onkeydown", "ctrlCV(this);" ); 1693 config.setEditorAttributes( attri ); 1694 1695 String key = config.getName(); 1696 config.setName( "h_" + key ); 1697 DBColumn clm = new DBColumn( config ); 1698 1699 rtn = rtn + "<br />" + clm.getEditorValue( null ) ; 1700 } 1701 1702 return rtn ; 1703 } 1704 1705 /** 1706 * ?カラ?oがmust?されて?かど? 1707 * 1708 * @og.rev 5.5.4.2 (2012/07/13) 1709 * 1710 * @param column カラ?O 1711 * @return must?されて?かど?[true:されて?/false:されて?い] 1712 */ 1713 protected boolean isMustColumn( final int column){ 1714 if( nullCheck != null && nullCheck.length > 0 ){ 1715 for(int i=0; i < nullCheck.length; i++){ 1716 if( nullCheck[i].equals( dbColumn[column].getName() ) ){ 1717 return true; 1718 } 1719 } 1720 } 1721 return false; 1722 } 1723 1724 /** 1725 * ?カラ?oがmustAny?されて?かど? 1726 * 1727 * @og.rev 5.5.4.2 (2012/07/13) 1728 * 1729 * @param column カラ?O 1730 * @return mustAny?されて?かど?[true:されて?/false:されて?い] 1731 */ 1732 protected boolean isMustAnyColumn( final int column){ 1733 if( mustAnyCheck != null && mustAnyCheck.length > 0 ){ 1734 for(int i=0; i < mustAnyCheck.length; i++){ 1735 if( mustAnyCheck[i].equals( dbColumn[column].getName() ) ){ 1736 return true; 1737 } 1738 } 1739 } 1740 return false; 1741 } 1742 1743 /** 1744 * ViewForm のサブクラスに渡すパラメータマップを設定します? 1745 * 1746 * @og.rev 3.5.4.8 (2004/02/23) ViewParamTag のパラメータを追?ます? 1747 * 1748 * @param map パラメータマッ? 1749 */ 1750 public void setParam( final Map<String,String> map ) { 1751 viewParam = map ; 1752 } 1753 1754 /** 1755 * ViewForm のサブクラスに渡すパラメータマップ?値を返します? 1756 * パラメータ?存在しな?null)か?値?存在しな?null)の場合?? 1757 * 初期値を返します? 1758 * 1759 * @og.rev 3.5.5.9 (2004/06/07) 新規追? 1760 * 1761 * @param key パラメータの取り出すキー 1762 * @param def パラメータが存在しな??合?初期値 1763 * 1764 * @return パラメータ値 1765 */ 1766 protected String getParam( final String key, final String def ) { 1767 if( viewParam == null ) { return def; } 1768 // String rtn = (String)viewParam.get( key ); 1769 String rtn = viewParam.get( key ); // 4.3.3.6 (2008/11/15) Generics警告対? 1770 1771 return ( rtn != null ) ? rtn : def ; 1772 } 1773 1774 /** 1775 * ViewForm のサブクラスに渡すパラメータマップ?値を返します? 1776 * パラメータは、?期?が設定されて?も?とし?そ?まま、?を返します? 1777 * 1778 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1779 * 1780 * @param key パラメータの取り出すキー 1781 * 1782 * @return パラメータ値 1783 */ 1784 protected String getParam( final String key ) { 1785 return (viewParam == null) ? null : viewParam.get( key ); 1786 } 1787 1788 /** 1789 * ViewForm のサブクラスに渡すパラメータマップ?値?int で返します? 1790 * パラメータは、?期?が設定されて?も?とし?null の場合??1 を返します? 1791 * 1792 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1793 * 1794 * @param key パラメータの取り出すキー 1795 * 1796 * @return パラメータ値(未設定時は?1) 1797 */ 1798 protected int getIntParam( final String key ) { 1799 String rtn = (viewParam == null) ? null : viewParam.get( key ); 1800 return (rtn == null) ? -1 : Integer.parseInt( rtn ); 1801 } 1802 1803 /** 1804 * ViewForm のサブクラスに渡すパラメータマップ?値?boolean で返します? 1805 * パラメータは、?期?が設定されて?も?とし?null の場合?、false を返します? 1806 * 1807 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1808 * 1809 * @param key パラメータの取り出すキー 1810 * 1811 * @return パラメータ値(未設定時は、false) 1812 */ 1813 protected boolean getBoolParam( final String key ) { 1814 String rtn = (viewParam == null) ? null : viewParam.get( key ); 1815 return (rtn == null) ? false : Boolean.parseBoolean( rtn ); 1816 } 1817 1818 /** 1819 * ViewForm のサブクラスに渡すパラメータ(??配?のArrayList)を設定します? 1820 * 1821 * @og.rev 5.5.8.3 (2012/11/17) ViewParamTag のパラメータを追?ます? 1822 * @og.rev 5.5.9.0 (2012/12/03) ArrayListに変更 1823 * 1824 * @param list ??配?のArrayList 1825 */ 1826 // public void setViewObject( final Map<String,Object> obj ) { 1827 public void setViewArrayList( final ArrayList<String[]> list ) { 1828 viewArrayList = list ; 1829 } 1830 1831 /** 1832 * ViewForm のサブクラスに渡すパラメータ(??配?のArrayList)の値を返します? 1833 * パラメータは、?期?が設定されて?も?とし?そ?まま、?を返します? 1834 * 1835 * @og.rev 5.5.8.3 (2012/11/17) 新規追? 1836 * @og.rev 5.5.9.0 (2012/12/03) ArrayListに変更 1837 * 1838 * @return パラメータ値 1839 */ 1840 //protected Object getViewObject( final String key ) { 1841 protected ArrayList<String[]> getViewArrayList() { 1842 return viewArrayList; 1843 } 1844 1845 /** 1846 * No ?のも?を作?するかど?を返します? 1847 * 1848 * numberType 属?に?delete" と?値を設定した?合?、No ?のも?? 1849 * 作?しません。それ以外?、作?します? 1850 * 初期値は、作?する(true)です? 1851 * 1852 * @og.rev 3.5.5.0 (2004/03/12) 新規追? 1853 * 1854 * @return No?のも?を作?するかど?(true:作?する/false:作?しな? 1855 */ 1856 protected boolean isNumberDisplay() { 1857 return numberDisplay; 1858 } 1859 1860 /** 1861 * マ?カーオブジェク?リンク、?ーカー)を設定します? 1862 * ここでは、旧 ViewForm 属??新ViewForm に直接セ?します? 1863 * 1864 * @og.rev 3.5.6.1 (2004/06/25) 新規追? 1865 * @og.rev 3.8.6.1 (2006/10/20) editMarker 追? 1866 * 1867 * @param view ViewFormオブジェク? 1868 */ 1869 public void markerSet( final ViewForm view ) { 1870 if( view instanceof AbstractViewForm ) { 1871 viewLink = ((AbstractViewForm)view).viewLink ; 1872 if( viewLink != null ) { viewLink.setDBTableModel( table ); } 1873 viewMarker = ((AbstractViewForm)view).viewMarker; 1874 if( viewMarker != null ) { viewMarker.setDBTableModel( table ); } 1875 editMarker = ((AbstractViewForm)view).editMarker; 1876 if( editMarker != null ) { editMarker.setDBTableModel( table ); } 1877 } 1878 else { 1879 String errMsg = "AbstractViewForm 以外? view は、サポ?トして?せん? 1880 + " view=[" + view + "]" ; 1881 throw new HybsSystemException( errMsg ); 1882 } 1883 } 1884 1885 /** 1886 * ??ブルのバックグラウンドカラーの入れ替え?サイクルをセ?します? 1887 * 0(ゼブラな??1(ワーニング)?2以?エラー)?(ゼブラ)?以?行数まと? 1888 * 初期値は?(ゼブラ)です? 1889 * 1890 * @og.rev 3.5.6.2 (2004/07/05) ViewForm_HTMLTable より移? 1891 * 1892 * @param sycle 0(ゼブラな??1(ワーニング)?2以?エラー)?(ゼブラ)?以?行数まと? 1893 */ 1894 public void setBgColorCycle( final int sycle ) { 1895 bgColorCycle = 1; // 強制?設? 1896 1897 if( sycle > 0 ) { // 1(ゼブラ)?以?行数まと? 1898 color_row0 = BG_COLOR_ROW0 ; 1899 color_row1 = BG_COLOR_ROW1 ; 1900 bgColorCycle = sycle; // こ?ケースのみ引数を設? 1901 } 1902 else if( sycle == -1 ) { // -1(ワーニング) 1903 color_row0 = BG_WARNING_COLOR_ROW0 ; 1904 color_row1 = BG_WARNING_COLOR_ROW1 ; 1905 } 1906 else if( sycle < -1 ) { // -2以?エラー) 1907 color_row0 = BG_ERROR_COLOR_ROW0 ; 1908 color_row1 = BG_ERROR_COLOR_ROW1 ; 1909 } 1910 else { // 0(ゼブラな? 1911 color_row0 = "" ; 1912 color_row1 = "" ; 1913 } 1914 } 1915 1916 /** 1917 * ??ブルのバックグラウンドカラーのクラスに?するカラ?を指定します? 1918 * 1919 * 通常のゼブラ模様?、tr 属?のクラス?として、row_0、row_1 が指定されます? 1920 * そ?代わりに、ここで?されたカラ??値がクラス属?として設定されます? 1921 * (?する?はカラ?です?行単位にクラス属?の値を変えることが可能です?) 1922 * 選択?row_sel)は、優先して使用されます? 1923 * 出力されるクラス名??row_" + 属?値 になります? 1924 * 1925 * @og.rev 5.1.8.0 (2010/07/01) 新規追? 1926 * 1927 * @param clsClm ゼブラ模様?替わりに?するクラスを?納したカラ? 1928 */ 1929 public void setBgColorClsClm( final String clsClm ) { 1930 if( clsClm != null ) { 1931 bgColorClsClmNo = table.getColumnNo( clsClm ); 1932 } 1933 } 1934 1935 /** 1936 * ??ブルのバックグラウンドカラーの値をセ?します? 1937 * これは、DBTableModele が指定?行番号の時に、BG_COLOR_ROWSEL ? 1938 * 返します?それ以外???常の getBgColorCycleClass( int )と 1939 * 同じ結果を返します? 1940 * BG_COLOR_ROWSEL の使用有無は、シス?パラメータの 1941 * VIEW_USE_SELROW_COLOR 属?で?できます? 1942 * 1943 * @og.rev 3.7.0.3 (2005/03/01) 新規追? 1944 * @og.rev 3.7.1.1 (2005/05/31) SEL_ROW機?使用時に、BG_COLOR_ROWSEL の使用 ?無を指? 1945 * 1946 * @param indx 先?からの連番( ?から始め?) 1947 * @param row 行番号 1948 * 1949 * @return 行?色を指定す?class 属?( cssファイルで??) 1950 * @see #getBgColorCycleClass( int ) 1951 */ 1952 protected String getBgColorCycleClass( final int indx,final int row ) { 1953 if( useSelRowColor && ( scrollRowNo == row ) ) { 1954 return BG_COLOR_ROWSEL; 1955 } 1956 else { 1957 return getBgColorCycleClass( indx ); 1958 } 1959 } 1960 1961 /** 1962 * ??ブルのバックグラウンドカラーの値をセ?します? 1963 * 行番号は, ?から始まる?で、?数?HTML_BG_COLOR_ROW0 ? 1964 * ?行を HTML_BG_COLOR_ROW1 とします? 1965 * setBgColorCycle で、設定?変換して?す? 1966 * bgColorClsClm が指定されて?場合?、その値を利用したクラス属?を返します? 1967 * クラス名??row_" + ?カラ??値 です? 1968 * ?カラ??値 が?null また?、空??の場合?、従来のゼブラ模様が優先されます? 1969 * また?行選択があれば、そちらが?先されます? 1970 * 1971 * @og.rev 3.5.6.2 (2004/07/05) ViewForm_HTMLTable より移? 1972 * @og.rev 5.1.8.0 (2010/07/01) bgColorClsClmNo 対? 1973 * 1974 * @param row 行番号( ?から始め?) 1975 * 1976 * @return 行?色を指定す?class 属?( cssファイルで??) 1977 * @see #setBgColorClsClm( String ) 1978 */ 1979 protected String getBgColorCycleClass( final int row ) { 1980 String rtn = null ; 1981 1982 // 5.1.8.0 (2010/07/01) bgColorClsClmNo 対? 1983 if( bgColorClsClmNo >= 0 ) { 1984 String val = table.getValue( row,bgColorClsClmNo ); 1985 if( val != null && val.length() > 0 ) { 1986 rtn = " class=\"row_" + val + "\""; 1987 } 1988 } 1989 1990 if( rtn == null ) { 1991 if( (row/bgColorCycle) % 2 == 0 ) { 1992 rtn = color_row0; // 偶数の場? 1993 } 1994 else { 1995 rtn = color_row1; // ?の場? 1996 } 1997 } 1998 1999 return rtn ; 2000 } 2001 2002 /** 2003 * スクロールバ?用のDIV要?出力するかど?(初期値はシス?パラメータ) 2004 * 2005 * スクロールバ?対応する為、テーブルの先?に、DIV要?出力します? 2006 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR です? 2007 * ※ 互換性の関係より?false になって?す? 2008 * ※ 互換性の関係より?新しいタイプ?ヘッ??固定を、TYPE2 とします? 2009 * <del> barType String ヘッ??固定?タイプをセ?しま?null/TYPE2)</del> 2010 * 2011 * @og.rev 3.5.6.4 (2004/07/16) 新規追? 2012 * @og.rev 3.8.0.3 (2005/07/15) barType 変数の追? 2013 * @og.rev 4.0.0.0 (2007/04/10) ヘッ??固定?スクロールタイプ?、TYPE2 のみにする? 2014 * 2015 * @param useBar スクロールバ?用のDIV要??出?[true:出力す?false:出力しない] 2016 */ 2017 public void setUseScrollBar( final boolean useBar ) { 2018 useScrollBar = useBar; 2019 } 2020 2021 /** 2022 * スクロールバ?用の開始DIV要?します? 2023 * 2024 * スクロールバ?対応する為、テーブルの先?に、DIV要?出力します? 2025 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR で?されたDIV要?す? 2026 * DIV要??開始タグになります? 2027 * 2028 * @og.rev 3.8.0.3 (2005/07/15) 新規追? 2029 * @og.rev 4.2.0.0 (2008/03/18) outerにwidthとheightを?すよ?修正 2030 * 2031 * @return LAYER_ST スクロールバ?用の開始DIV要? 2032 */ 2033 protected String getScrollBarStartDiv() { 2034 String layerStart = LAYER_ST0 ; 2035 if( useScrollBar ) { 2036 // layerStart = LAYER_ST2 ; 2037 layerStart = "<div id=\"divPos\" style=\""; 2038 if( height != null ){ 2039 layerStart += "height:" + height + ";"; 2040 } 2041 if( width != null ){ 2042 layerStart += "width:" + width + ";"; 2043 } 2044 layerStart += "\" >" 2045 + "<div id=\"outer\">" 2046 + "<div id=\"layer\" onscroll=\"SetScrollHeader(this);\">" 2047 + "<div id=\"divHide\">" ; 2048 } 2049 return layerStart; 2050 } 2051 2052 /** 2053 * スクロールバ?用の終?IV要?します? 2054 * 2055 * スクロールバ?対応する為、テーブルの終?、DIV要?出力します? 2056 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR で?されたDIV要?す? 2057 * DIV要??終?グになります? 2058 * 2059 * @og.rev 3.8.0.3 (2005/07/15) 新規追? 2060 * 2061 * @return スクロールバ?用の終?IV要? 2062 */ 2063 protected String getScrollBarEndDiv() { 2064 String layerEnd = LAYER_END0 ; 2065 if( useScrollBar ) { 2066 layerEnd = LAYER_END2 ; 2067 } 2068 return layerEnd; 2069 } 2070 2071 /** 2072 * ??行番号まで画面をスクロールさせる?合?行番号を設定します? 2073 * 2074 * 画面をスクロール後?リンク等で他画面を表示後?戻ってきた場合に? 2075 * 先?スクロール位置まで戻します? 2076 * ただし?厳?戻すことはできな?め?大体?あたりに戻します? 2077 * ?しな???クリアする場?は?1 をセ?してください? 2078 * useSelRowColor は?択行に色づけするかど?を指定します? 2079 * 2080 * @og.rev 3.7.0.3 (2005/03/01) 新規追? 2081 * @og.rev 3.7.1.1 (2005/05/31) 選択行?ーカーの使用有無 2082 * 2083 * @param rowNo ??行番号まで画面をスクロールさせる?合?行番号 2084 * @param useSelRowColor 選択行?ーカーの使用有無 2085 */ 2086 public void setScrollRowNo( final int rowNo, final boolean useSelRowColor ) { 2087 scrollRowNo = rowNo; 2088 firstChecked = false; 2089 this.useSelRowColor = useSelRowColor; 2090 } 2091 2092 /** 2093 * 設定?に "_" が含まれて?場合にレン?ーを使用するカラ?CSV形式で?します? 2094 * 2095 * これは、従来の カラ?義の WRITABLE エ?ターと同等?働きを行うように 2096 * カラ??を指定します? 2097 * WRITABLE エ?ターは、設定?にアン??バ? "_" が含まれて?場合に? 2098 * そ?値を書込み禁止にする機?です?これは、エ?ター自身が?を判断して 2099 * 書き込み許可か禁止かを判断して?す? 2100 * こ?動きを汎用?するため、指定?カラ?カンマ区???CSV)で?? 2101 * することにより、レン?ーとエ?ターを設定?によって動的に?替える 2102 * 機?を実現します? 2103 * そ?場合?表示/編?もに、?頭のアン??バ?は削除されます? 2104 * また?全カラ?つ?、有効にする場合?、writableControl="*" を設定します? 2105 * 2106 * @og.rev 3.8.0.9 (2005/10/17) 新規追? 2107 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 2108 * 2109 * @param wrtCtrl 書き込み制御を行いたいカラ?CSV形式で?? 2110 */ 2111 public void setWritableControl( final String wrtCtrl ) { 2112 setBooleanArray( wrtCtrl,true,writeCtrl ); 2113 2114 // if( wrtCtrl != null ) { 2115 // // 書き込み制御の許可 をカラ?位で設定?* の場合?、?カラ?可 2116 // if( "*".equals( wrtCtrl ) ) { 2117 // Arrays.fill( writeCtrl,true ); 2118 // } 2119 // else { 2120 // Arrays.fill( writeCtrl,false ); 2121 // String[] clmNames = StringUtil.csv2Array( wrtCtrl ); 2122 // for( int i=0; i<clmNames.length; i++ ) { 2123 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 2124 // int no = table.getColumnNo( clmNames[i] ); 2125 // if( no >= 0 ) { writeCtrl[ no ] = true; } 2126 // } 2127 // } 2128 // } 2129 // } 2130 } 2131 2132 /** 2133 * CSV形式で?されたカラ?、true/false の初期設定を行います? 2134 * 2135 * 従来は、各クラスで実?れて?処?、??にまとめます? 2136 * これにより、各種機?をあらかじめ実?ておきます? 2137 * ??カラ?、null の場合?、何も処?行いません?つまり?初期値のまま) 2138 * ??カラ?? の場合?、すべてのカラ??されたとみなし?配?に値を設定します? 2139 * ??カラ??"(ゼロ??)の場合?、なにもカラ??されて??のとみなされ? 2140 * 初期値の?埋められます? 2141 * 2142 * @og.rev 5.1.8.0 (2010/07/01) 新規追? 2143 * 2144 * @param clsm ??カラ?CSV形式で?? 2145 * @param def 設定する? 2146 * @param arrays 設定す?配? 2147 */ 2148 private void setBooleanArray( final String clsm , final boolean def , final boolean[] arrays ) { 2149 if( clsm != null ) { 2150 // 書き込み制御の許可 をカラ?位で設定?* の場合?、?カラ?可 2151 if( "*".equals( clsm ) ) { 2152 Arrays.fill( arrays,def ); 2153 } 2154 else { 2155 Arrays.fill( arrays,!def ); 2156 String[] clmNames = StringUtil.csv2Array( clsm ); 2157 for( int i=0; i<clmNames.length; i++ ) { 2158 if( clmNames[i] != null && clmNames[i].length() > 0 ) { 2159 int no = table.getColumnNo( clmNames[i] ); 2160 if( no >= 0 ) { arrays[ no ] = def; } 2161 } 2162 } 2163 } 2164 } 2165 } 2166 2167 /** 2168 * ogPopup で検索結果の値を返すキーを?CSV形式で?します? 2169 * 2170 * popup の検索結果を返す画面で、結果のラジオボタンにイベントセ?します? 2171 * こ?場合?オープンもとのwindow に値を返しますが、そのキーをCSV形式で 2172 * ?します? 2173 * なお?こ?メソ?は、?表示(HTMLTable)関係?ビューのみでサポ?トして 2174 * ?すが、チェ?メソ?の関係で、それ以外?ビューに適用しても??? 2175 * するようにします?(エラーにしません) 2176 * 2177 * @og.rev 3.8.6.1 (2006/10/20) 新規追? 2178 * 2179 * @param rtnKeys ogPopupで値を返すカラ?字?(CSV形? 2180 */ 2181 public void setPopupReturnKeys( final String rtnKeys ) { 2182 // こ?メソ?は、?表示(HTMLTable)関係?ビューのみでサポ?トして 2183 // ?すが、チェ?メソ?の関係で、それ以外?ビューに適用しても??? 2184 // するようにします?(エラーにしません) 2185 } 2186 2187 /** 2188 * table要?対して class 属?を設定します? 2189 * 2190 * 従来の シス?リソースでの??ブルレイアウト?設定を?し? 2191 * CSSファイルで、指定するよ?変更して?す? 2192 * これに伴??CSSファイルのキーとして、クラス属?を?力します? 2193 * view(また?、?力されるtableタグ)のレイアウト?、このクラス属?で 2194 * ?することが可能になります? 2195 * 初期値は、viewTable です? 2196 * 2197 * @og.rev 4.0.0.0 (2007/04/16) 新規追? 2198 * 2199 * @param cls class属?を表す文字? 2200 */ 2201 public void setTableClass( final String cls ) { 2202 if( cls != null ) { 2203 clazz = cls; 2204 } 2205 } 2206 2207 /** 2208 * table要?対して class 属?を返します? 2209 * 2210 * @og.rev 4.0.0.0 (2007/04/16) 新規追? 2211 * 2212 * @return class属?を表す文字? 2213 */ 2214 protected String getTableClass() { 2215 return clazz; 2216 } 2217 2218 /** 2219 * outerのIDを持つDIV要?heightを指定しま? 2220 * 2221 * ビューの高さ、??できるようにします? 2222 * これによって?画面に?つのビューを?力する事も可能となります? 2223 * 初期値はnullです? 2224 * 2225 * @og.rev 4.2.0.0 (2008/03/18) 新規追? 2226 * 2227 * @param high ビューの高さ 2228 */ 2229 public void setHeight( final String high ) { 2230 height = high; 2231 } 2232 2233 /** 2234 * outerのIDを持つDIV要?widthを指定しま? 2235 * 2236 * ビューの高さ、??できるようにします? 2237 * これによって?画面に?つのビューを?力する事も可能となります? 2238 * 初期値はnullです? 2239 * 2240 * @og.rev 4.2.0.0 (2008/03/18) 新規追? 2241 * 2242 * @param wide ビューの高さ 2243 */ 2244 public void setWidth( final String wide ) { 2245 width = wide; 2246 } 2247 2248 /** 2249 * リソースマネージャを設定します? 2250 * クロス?時に、useColumnHeader="true"とした場合?み設定されます? 2251 * 2252 * @og.rev 4.0.0.0 新規作? 2253 * 2254 * @param res リソースマネージャー 2255 */ 2256 public void setResourceManager( final ResourceManager res ) { 2257 resourceManager = res; 2258 } 2259 2260 /** 2261 * リソースマネージャを取得します? 2262 * 2263 * @og.rev 4.0.0.0 新規作? 2264 * 2265 * @return ResourceManagerリソースマネージャー 2266 */ 2267 protected ResourceManager getResourceManager() { 2268 return resourceManager; 2269 } 2270 2271 /** 2272 * 改廃Cのつ???をスキ??するかど??します? 2273 * 2274 * "true" で、改廃Cのつ?行をスキ??します? 2275 * 初期値はfalseです? 2276 * 2277 * @og.rev 4.3.1.0 (2008/09/08) 新規追? 2278 * 2279 * @param sne 改廃Cのつ???をスキ??するかど?(true:スキ??する/false:スキ??しな? 2280 */ 2281 public void setSkipNoEdit( final boolean sne ) { 2282 skipNoEdit = sne; 2283 } 2284 2285 /** 2286 * 改廃Cのつ???をスキ??するかど??します? 2287 * 2288 * skipNoEdit="true"でかつ、編?れて??改廃Cがつ???場合?み 2289 * trueを返します? 2290 * 2291 * @og.rev 4.3.1.0 (2008/09/08) 新規追? 2292 * 2293 * @param row 行番号 2294 * 2295 * @return スキ??対象行か 2296 */ 2297 protected boolean isSkipNoEdit( final int row ) { 2298 return skipNoEdit && ( table.getModifyType( row ) == null || table.getModifyType( row ).length() == 0 ); 2299 } 2300 2301 /** 2302 * 画面遷移なしモードに対応した形で処?行うかを?します? 2303 * 2304 * "true" で、画面遷移なしモードに対応します? 2305 * 初期値はfalseです? 2306 * 2307 * @og.rev 4.3.3.0 (2008/10/01) 新規追? 2308 * 2309 * @param flag 画面遷移なしモードに対応するかど?(true:対応す?false:対応しな? 2310 */ 2311 public void setNoTransition( final boolean flag ) { 2312 noTransition = flag; 2313 } 2314 2315 /** 2316 * 画面遷移なしモードに対応した形で処?行うかを返します? 2317 * 2318 * "true" で、画面遷移なしモードに対応します? 2319 * 初期値はfalseです? 2320 * 2321 * @og.rev 4.3.3.0 (2008/10/01) 新規追? 2322 * 2323 * @return 画面遷移なしモードに対応するかど?(true:対応す?false:対応しな? 2324 */ 2325 protected boolean isNoTransition() { 2326 return noTransition; 2327 } 2328 2329 /** 2330 * 該当行?行番号と改廃Cを?力します? 2331 * 出力形式??rid="[行番号]" kh="[改廃C]" です? 2332 * 改廃Cが付加されて???合?、改廃Cがnullの場合?、kh属?は出力されません? 2333 * (画面遷移なしモードで使用しま? 2334 * 2335 * @og.rev 4.3.3.0 (2008/10/01) 新規作? 2336 * 2337 * @param row 行番号( ?から始め?) 2338 * 2339 * @return 該当行?行番号と改廃C 2340 */ 2341 protected String getHiddenRowValue( final int row ) { 2342 String kh = ""; 2343 if( table.getModifyType( row ) != null && table.getModifyType( row ).length() > 0 ) { 2344 kh = " " + hiddenCdkhKey + "=\"" + table.getModifyType( row ) + "\""; 2345 } 2346 return " " + hiddenRowKey + "=\"" + row + "\"" + kh; 2347 } 2348 2349 /** 2350 * ビューで表示したカラ???をカンマ区?で返します? 2351 * 2352 * @og.rev 5.1.6.0 (2010/05/01) 新規追? 2353 * 2354 * @return ビューで表示したカラ??? 2355 */ 2356 public String getViewClms() { 2357 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_MIDDLE ); 2358 for( int i=0; i<clmDisplay.length; i++ ) { 2359 if( clmDisplay[i] && !( rowWritableFlag && i==0 ) ) { 2360 if( buf.length() > 0 ) { buf.append( ',' ); } 2361 buf.append( dbColumn[i].getName() ); 2362 } 2363 } 2364 return buf.toString(); 2365 } 2366 2367 /** 2368 * 表示?の編?並び替?が可能かど?を返しま? 2369 * 2370 * @og.rev 5.1.6.0 (2010/05/01) 新規追? 2371 * 2372 * @return 表示?の編?並び替?が可能かど?(true:可能) 2373 */ 2374 public boolean isEditable() { 2375 return true; 2376 } 2377 2378 /** 2379 * こ?ViewFormが作?された画面IDをセ?します? 2380 * 2381 * @og.rev 5.1.7.0 (2010/06/01) 新規追? 2382 * 2383 * @param gamenId 画面ID 2384 */ 2385 public void setGamenId( final String gamenId ) { 2386 this.gamenId = gamenId; 2387 } 2388 2389 /** 2390 * こ?ViewFormが作?された画面IDを返します? 2391 * 2392 * @og.rev 5.1.7.0 (2010/06/01) 新規追? 2393 * 2394 * @return 画面ID 2395 */ 2396 public String getGamenId() { 2397 return gamenId; 2398 } 2399 2400 /** 2401 * カラ??入力アシスト機?を利用するかど?を返します? 2402 * 2403 * 条件は、?入力アシストカラ?、かつ、書き込み許可(isColumnWritable(clm)==true)の場合とする? 2404 * 2405 * @og.rev 5.2.1.0 (2010/10/01) 新規作? 2406 * 2407 * @param column カラ?号 2408 * 2409 * @return 利用する(true)?しな?false) 2410 */ 2411 protected boolean isClmBulkSet( final int column ) { 2412 return clmBulkSet[ column ] && clmWritable[ column ]; 2413 } 2414 2415 /** 2416 * ?入力カラ??アシスト機?を利用するカラ?を?カンマ区?で与えます? 2417 * 2418 * これは、カラ??書き込み時に、?入力可能なカラ?ヘッ??に表示し? 2419 * ?登録できる機?を提供します? 2420 * こ?機?は、jsp/common/bulkSet.js JavaScript とともに提供されます? 2421 * IE につ?は、クリ??ボ?ドも利用できます?Ctrl-C と Ctrl-V でそれぞれ 2422 * ??のカラ??値の取り出しと書き込みが可能になります? 2423 * "*" を指定すると、すべてのカラ?(columnBulkSet)?したことになります? 2424 * 2425 * @og.rev 5.2.1.0 (2010/10/01) 新規作? 2426 * 2427 * @param columnName 例?OYA,KO,HJO,SU,DYSET,DYUPD" 2428 */ 2429 public void setColumnBulkSet( final String columnName ) { 2430 setBooleanArray( columnName,true,clmBulkSet ); 2431 } 2432 }