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 * @og.rev 5.6.9.1 (2013/10/11) カラ?にカンマが入った?合?対? 1646 * 1647 * @param column カラ?号 1648 * 1649 * @return ソート機?(リンク)の付いたラベル? 1650 */ 1651 protected String getSortedColumnLabel( final int column ) { 1652 String rtn = getColumnLabel( column ) ; 1653 1654 if( ( useSorterKeys && sortKeys[column] ) || 1655 ( ! useSorterKeys && useTableSorter ) ) { 1656 // return "<a href=\"?command=VIEW&" + 1657 // HybsSystem.SORT_COLUMNS + "=" + dbColumn[column].getName() + 1658 // sorterQuery + "\">" + 1659 // getColumnLabel( column ) + "</a>" ; // 4.0.0 (2005/01/31) 1660 rtn = "<a href=\"?command=VIEW&" + 1661 HybsSystem.SORT_COLUMNS + "=" + dbColumn[column].getName() + 1662 sorterQuery + "\">" + 1663 rtn + "</a>" ; 1664 } 1665 // else { 1666 // return getColumnLabel( column ) ; // 4.0.0 (2005/01/31) 1667 // } 1668 1669 // 5.2.1.0 (2010/10/01) ?入力カラ??アシスト機?対? 1670 if( isClmBulkSet( column ) ) { 1671 org.opengion.hayabusa.db.DBColumnConfig config = dbColumn[column].getConfig(); 1672 config.setAddNoValue( true ); 1673 if( "TEXT".equals( config.getEditor() ) ) { 1674 String mlen = config.getMaxlength(); 1675 int idx = mlen.indexOf( "," ); // 5.6.9.1 (2013/10/11) カンマが入って?場合?対? 1676 if( idx < 0 ){ idx = mlen.length();} 1677 // if( mlen != null && Integer.parseInt(mlen) < COLUMNS_MAXSIZE ) { 1678 if( mlen != null && Integer.parseInt( mlen.substring( 0, idx ) ) < COLUMNS_MAXSIZE ) { // 5.6.9.1 (2013/10/11) 1679 config.setViewLength( mlen ); 1680 } 1681 config.setMaxlength( "1000" ); 1682 } 1683 else if( "RADIO".equals( config.getEditor() ) ) { 1684 config.setEditor( "MENU" ); 1685 } 1686 1687 Attributes attri = new Attributes(); 1688 // 5.2.3.0 (2010/12/01) チェ?ボックスでは、onChange ではなく?onClick でイベントを発生させます? 1689 if( "CHBOX".equals( config.getEditor() ) ) { 1690 attri.add( "onClick", "bulkSet(this);" ); 1691 } 1692 else { 1693 attri.add( "onChange", "bulkSet(this);" ); 1694 attri.add( "ondblclick","bulkPaste(this);" ); 1695 } 1696 attri.add( "onkeydown", "ctrlCV(this);" ); 1697 config.setEditorAttributes( attri ); 1698 1699 String key = config.getName(); 1700 config.setName( "h_" + key ); 1701 DBColumn clm = new DBColumn( config ); 1702 1703 rtn = rtn + "<br />" + clm.getEditorValue( null ) ; 1704 } 1705 1706 return rtn ; 1707 } 1708 1709 /** 1710 * ?カラ?oがmust?されて?かど? 1711 * 1712 * @og.rev 5.5.4.2 (2012/07/13) 1713 * 1714 * @param column カラ?O 1715 * @return must?されて?かど?[true:されて?/false:されて?い] 1716 */ 1717 protected boolean isMustColumn( final int column){ 1718 if( nullCheck != null && nullCheck.length > 0 ){ 1719 for(int i=0; i < nullCheck.length; i++){ 1720 if( nullCheck[i].equals( dbColumn[column].getName() ) ){ 1721 return true; 1722 } 1723 } 1724 } 1725 return false; 1726 } 1727 1728 /** 1729 * ?カラ?oがmustAny?されて?かど? 1730 * 1731 * @og.rev 5.5.4.2 (2012/07/13) 1732 * 1733 * @param column カラ?O 1734 * @return mustAny?されて?かど?[true:されて?/false:されて?い] 1735 */ 1736 protected boolean isMustAnyColumn( final int column){ 1737 if( mustAnyCheck != null && mustAnyCheck.length > 0 ){ 1738 for(int i=0; i < mustAnyCheck.length; i++){ 1739 if( mustAnyCheck[i].equals( dbColumn[column].getName() ) ){ 1740 return true; 1741 } 1742 } 1743 } 1744 return false; 1745 } 1746 1747 /** 1748 * ViewForm のサブクラスに渡すパラメータマップを設定します? 1749 * 1750 * @og.rev 3.5.4.8 (2004/02/23) ViewParamTag のパラメータを追?ます? 1751 * 1752 * @param map パラメータマッ? 1753 */ 1754 public void setParam( final Map<String,String> map ) { 1755 viewParam = map ; 1756 } 1757 1758 /** 1759 * ViewForm のサブクラスに渡すパラメータマップ?値を返します? 1760 * パラメータ?存在しな?null)か?値?存在しな?null)の場合?? 1761 * 初期値を返します? 1762 * 1763 * @og.rev 3.5.5.9 (2004/06/07) 新規追? 1764 * 1765 * @param key パラメータの取り出すキー 1766 * @param def パラメータが存在しな??合?初期値 1767 * 1768 * @return パラメータ値 1769 */ 1770 protected String getParam( final String key, final String def ) { 1771 if( viewParam == null ) { return def; } 1772 // String rtn = (String)viewParam.get( key ); 1773 String rtn = viewParam.get( key ); // 4.3.3.6 (2008/11/15) Generics警告対? 1774 1775 return ( rtn != null ) ? rtn : def ; 1776 } 1777 1778 /** 1779 * ViewForm のサブクラスに渡すパラメータマップ?値を返します? 1780 * パラメータは、?期?が設定されて?も?とし?そ?まま、?を返します? 1781 * 1782 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1783 * 1784 * @param key パラメータの取り出すキー 1785 * 1786 * @return パラメータ値 1787 */ 1788 protected String getParam( final String key ) { 1789 return (viewParam == null) ? null : viewParam.get( key ); 1790 } 1791 1792 /** 1793 * ViewForm のサブクラスに渡すパラメータマップ?値?int で返します? 1794 * パラメータは、?期?が設定されて?も?とし?null の場合??1 を返します? 1795 * 1796 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1797 * 1798 * @param key パラメータの取り出すキー 1799 * 1800 * @return パラメータ値(未設定時は?1) 1801 */ 1802 protected int getIntParam( final String key ) { 1803 String rtn = (viewParam == null) ? null : viewParam.get( key ); 1804 return (rtn == null) ? -1 : Integer.parseInt( rtn ); 1805 } 1806 1807 /** 1808 * ViewForm のサブクラスに渡すパラメータマップ?値?boolean で返します? 1809 * パラメータは、?期?が設定されて?も?とし?null の場合?、false を返します? 1810 * 1811 * @og.rev 5.5.5.6 (2012/08/31) 新規追? 1812 * 1813 * @param key パラメータの取り出すキー 1814 * 1815 * @return パラメータ値(未設定時は、false) 1816 */ 1817 protected boolean getBoolParam( final String key ) { 1818 String rtn = (viewParam == null) ? null : viewParam.get( key ); 1819 return (rtn == null) ? false : Boolean.parseBoolean( rtn ); 1820 } 1821 1822 /** 1823 * ViewForm のサブクラスに渡すパラメータ(??配?のArrayList)を設定します? 1824 * 1825 * @og.rev 5.5.8.3 (2012/11/17) ViewParamTag のパラメータを追?ます? 1826 * @og.rev 5.5.9.0 (2012/12/03) ArrayListに変更 1827 * 1828 * @param list ??配?のArrayList 1829 */ 1830 // public void setViewObject( final Map<String,Object> obj ) { 1831 public void setViewArrayList( final ArrayList<String[]> list ) { 1832 viewArrayList = list ; 1833 } 1834 1835 /** 1836 * ViewForm のサブクラスに渡すパラメータ(??配?のArrayList)の値を返します? 1837 * パラメータは、?期?が設定されて?も?とし?そ?まま、?を返します? 1838 * 1839 * @og.rev 5.5.8.3 (2012/11/17) 新規追? 1840 * @og.rev 5.5.9.0 (2012/12/03) ArrayListに変更 1841 * 1842 * @return パラメータ値 1843 */ 1844 //protected Object getViewObject( final String key ) { 1845 protected ArrayList<String[]> getViewArrayList() { 1846 return viewArrayList; 1847 } 1848 1849 /** 1850 * No ?のも?を作?するかど?を返します? 1851 * 1852 * numberType 属?に?delete" と?値を設定した?合?、No ?のも?? 1853 * 作?しません。それ以外?、作?します? 1854 * 初期値は、作?する(true)です? 1855 * 1856 * @og.rev 3.5.5.0 (2004/03/12) 新規追? 1857 * 1858 * @return No?のも?を作?するかど?(true:作?する/false:作?しな? 1859 */ 1860 protected boolean isNumberDisplay() { 1861 return numberDisplay; 1862 } 1863 1864 /** 1865 * マ?カーオブジェク?リンク、?ーカー)を設定します? 1866 * ここでは、旧 ViewForm 属??新ViewForm に直接セ?します? 1867 * 1868 * @og.rev 3.5.6.1 (2004/06/25) 新規追? 1869 * @og.rev 3.8.6.1 (2006/10/20) editMarker 追? 1870 * 1871 * @param view ViewFormオブジェク? 1872 */ 1873 public void markerSet( final ViewForm view ) { 1874 if( view instanceof AbstractViewForm ) { 1875 viewLink = ((AbstractViewForm)view).viewLink ; 1876 if( viewLink != null ) { viewLink.setDBTableModel( table ); } 1877 viewMarker = ((AbstractViewForm)view).viewMarker; 1878 if( viewMarker != null ) { viewMarker.setDBTableModel( table ); } 1879 editMarker = ((AbstractViewForm)view).editMarker; 1880 if( editMarker != null ) { editMarker.setDBTableModel( table ); } 1881 } 1882 else { 1883 String errMsg = "AbstractViewForm 以外? view は、サポ?トして?せん? 1884 + " view=[" + view + "]" ; 1885 throw new HybsSystemException( errMsg ); 1886 } 1887 } 1888 1889 /** 1890 * ??ブルのバックグラウンドカラーの入れ替え?サイクルをセ?します? 1891 * 0(ゼブラな??1(ワーニング)?2以?エラー)?(ゼブラ)?以?行数まと? 1892 * 初期値は?(ゼブラ)です? 1893 * 1894 * @og.rev 3.5.6.2 (2004/07/05) ViewForm_HTMLTable より移? 1895 * 1896 * @param sycle 0(ゼブラな??1(ワーニング)?2以?エラー)?(ゼブラ)?以?行数まと? 1897 */ 1898 public void setBgColorCycle( final int sycle ) { 1899 bgColorCycle = 1; // 強制?設? 1900 1901 if( sycle > 0 ) { // 1(ゼブラ)?以?行数まと? 1902 color_row0 = BG_COLOR_ROW0 ; 1903 color_row1 = BG_COLOR_ROW1 ; 1904 bgColorCycle = sycle; // こ?ケースのみ引数を設? 1905 } 1906 else if( sycle == -1 ) { // -1(ワーニング) 1907 color_row0 = BG_WARNING_COLOR_ROW0 ; 1908 color_row1 = BG_WARNING_COLOR_ROW1 ; 1909 } 1910 else if( sycle < -1 ) { // -2以?エラー) 1911 color_row0 = BG_ERROR_COLOR_ROW0 ; 1912 color_row1 = BG_ERROR_COLOR_ROW1 ; 1913 } 1914 else { // 0(ゼブラな? 1915 color_row0 = "" ; 1916 color_row1 = "" ; 1917 } 1918 } 1919 1920 /** 1921 * ??ブルのバックグラウンドカラーのクラスに?するカラ?を指定します? 1922 * 1923 * 通常のゼブラ模様?、tr 属?のクラス?として、row_0、row_1 が指定されます? 1924 * そ?代わりに、ここで?されたカラ??値がクラス属?として設定されます? 1925 * (?する?はカラ?です?行単位にクラス属?の値を変えることが可能です?) 1926 * 選択?row_sel)は、優先して使用されます? 1927 * 出力されるクラス名??row_" + 属?値 になります? 1928 * 1929 * @og.rev 5.1.8.0 (2010/07/01) 新規追? 1930 * 1931 * @param clsClm ゼブラ模様?替わりに?するクラスを?納したカラ? 1932 */ 1933 public void setBgColorClsClm( final String clsClm ) { 1934 if( clsClm != null ) { 1935 bgColorClsClmNo = table.getColumnNo( clsClm ); 1936 } 1937 } 1938 1939 /** 1940 * ??ブルのバックグラウンドカラーの値をセ?します? 1941 * これは、DBTableModele が指定?行番号の時に、BG_COLOR_ROWSEL ? 1942 * 返します?それ以外???常の getBgColorCycleClass( int )と 1943 * 同じ結果を返します? 1944 * BG_COLOR_ROWSEL の使用有無は、シス?パラメータの 1945 * VIEW_USE_SELROW_COLOR 属?で?できます? 1946 * 1947 * @og.rev 3.7.0.3 (2005/03/01) 新規追? 1948 * @og.rev 3.7.1.1 (2005/05/31) SEL_ROW機?使用時に、BG_COLOR_ROWSEL の使用 ?無を指? 1949 * 1950 * @param indx 先?からの連番( ?から始め?) 1951 * @param row 行番号 1952 * 1953 * @return 行?色を指定す?class 属?( cssファイルで??) 1954 * @see #getBgColorCycleClass( int ) 1955 */ 1956 protected String getBgColorCycleClass( final int indx,final int row ) { 1957 if( useSelRowColor && ( scrollRowNo == row ) ) { 1958 return BG_COLOR_ROWSEL; 1959 } 1960 else { 1961 return getBgColorCycleClass( indx ); 1962 } 1963 } 1964 1965 /** 1966 * ??ブルのバックグラウンドカラーの値をセ?します? 1967 * 行番号は, ?から始まる?で、?数?HTML_BG_COLOR_ROW0 ? 1968 * ?行を HTML_BG_COLOR_ROW1 とします? 1969 * setBgColorCycle で、設定?変換して?す? 1970 * bgColorClsClm が指定されて?場合?、その値を利用したクラス属?を返します? 1971 * クラス名??row_" + ?カラ??値 です? 1972 * ?カラ??値 が?null また?、空??の場合?、従来のゼブラ模様が優先されます? 1973 * また?行選択があれば、そちらが?先されます? 1974 * 1975 * @og.rev 3.5.6.2 (2004/07/05) ViewForm_HTMLTable より移? 1976 * @og.rev 5.1.8.0 (2010/07/01) bgColorClsClmNo 対? 1977 * 1978 * @param row 行番号( ?から始め?) 1979 * 1980 * @return 行?色を指定す?class 属?( cssファイルで??) 1981 * @see #setBgColorClsClm( String ) 1982 */ 1983 protected String getBgColorCycleClass( final int row ) { 1984 String rtn = null ; 1985 1986 // 5.1.8.0 (2010/07/01) bgColorClsClmNo 対? 1987 if( bgColorClsClmNo >= 0 ) { 1988 String val = table.getValue( row,bgColorClsClmNo ); 1989 if( val != null && val.length() > 0 ) { 1990 rtn = " class=\"row_" + val + "\""; 1991 } 1992 } 1993 1994 if( rtn == null ) { 1995 if( (row/bgColorCycle) % 2 == 0 ) { 1996 rtn = color_row0; // 偶数の場? 1997 } 1998 else { 1999 rtn = color_row1; // ?の場? 2000 } 2001 } 2002 2003 return rtn ; 2004 } 2005 2006 /** 2007 * スクロールバ?用のDIV要?出力するかど?(初期値はシス?パラメータ) 2008 * 2009 * スクロールバ?対応する為、テーブルの先?に、DIV要?出力します? 2010 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR です? 2011 * ※ 互換性の関係より?false になって?す? 2012 * ※ 互換性の関係より?新しいタイプ?ヘッ??固定を、TYPE2 とします? 2013 * <del> barType String ヘッ??固定?タイプをセ?しま?null/TYPE2)</del> 2014 * 2015 * @og.rev 3.5.6.4 (2004/07/16) 新規追? 2016 * @og.rev 3.8.0.3 (2005/07/15) barType 変数の追? 2017 * @og.rev 4.0.0.0 (2007/04/10) ヘッ??固定?スクロールタイプ?、TYPE2 のみにする? 2018 * 2019 * @param useBar スクロールバ?用のDIV要??出?[true:出力す?false:出力しない] 2020 */ 2021 public void setUseScrollBar( final boolean useBar ) { 2022 useScrollBar = useBar; 2023 } 2024 2025 /** 2026 * スクロールバ?用の開始DIV要?します? 2027 * 2028 * スクロールバ?対応する為、テーブルの先?に、DIV要?出力します? 2029 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR で?されたDIV要?す? 2030 * DIV要??開始タグになります? 2031 * 2032 * @og.rev 3.8.0.3 (2005/07/15) 新規追? 2033 * @og.rev 4.2.0.0 (2008/03/18) outerにwidthとheightを?すよ?修正 2034 * 2035 * @return LAYER_ST スクロールバ?用の開始DIV要? 2036 */ 2037 protected String getScrollBarStartDiv() { 2038 String layerStart = LAYER_ST0 ; 2039 if( useScrollBar ) { 2040 // layerStart = LAYER_ST2 ; 2041 layerStart = "<div id=\"divPos\" style=\""; 2042 if( height != null ){ 2043 layerStart += "height:" + height + ";"; 2044 } 2045 if( width != null ){ 2046 layerStart += "width:" + width + ";"; 2047 } 2048 layerStart += "\" >" 2049 + "<div id=\"outer\">" 2050 + "<div id=\"layer\" onscroll=\"SetScrollHeader(this);\">" 2051 + "<div id=\"divHide\">" ; 2052 } 2053 return layerStart; 2054 } 2055 2056 /** 2057 * スクロールバ?用の終?IV要?します? 2058 * 2059 * スクロールバ?対応する為、テーブルの終?、DIV要?出力します? 2060 * 初期値は、シス?パラメータ の VIEW_USE_SCROLLBAR で?されたDIV要?す? 2061 * DIV要??終?グになります? 2062 * 2063 * @og.rev 3.8.0.3 (2005/07/15) 新規追? 2064 * 2065 * @return スクロールバ?用の終?IV要? 2066 */ 2067 protected String getScrollBarEndDiv() { 2068 String layerEnd = LAYER_END0 ; 2069 if( useScrollBar ) { 2070 layerEnd = LAYER_END2 ; 2071 } 2072 return layerEnd; 2073 } 2074 2075 /** 2076 * ??行番号まで画面をスクロールさせる?合?行番号を設定します? 2077 * 2078 * 画面をスクロール後?リンク等で他画面を表示後?戻ってきた場合に? 2079 * 先?スクロール位置まで戻します? 2080 * ただし?厳?戻すことはできな?め?大体?あたりに戻します? 2081 * ?しな???クリアする場?は?1 をセ?してください? 2082 * useSelRowColor は?択行に色づけするかど?を指定します? 2083 * 2084 * @og.rev 3.7.0.3 (2005/03/01) 新規追? 2085 * @og.rev 3.7.1.1 (2005/05/31) 選択行?ーカーの使用有無 2086 * 2087 * @param rowNo ??行番号まで画面をスクロールさせる?合?行番号 2088 * @param useSelRowColor 選択行?ーカーの使用有無 2089 */ 2090 public void setScrollRowNo( final int rowNo, final boolean useSelRowColor ) { 2091 scrollRowNo = rowNo; 2092 firstChecked = false; 2093 this.useSelRowColor = useSelRowColor; 2094 } 2095 2096 /** 2097 * 設定?に "_" が含まれて?場合にレン?ーを使用するカラ?CSV形式で?します? 2098 * 2099 * これは、従来の カラ?義の WRITABLE エ?ターと同等?働きを行うように 2100 * カラ??を指定します? 2101 * WRITABLE エ?ターは、設定?にアン??バ? "_" が含まれて?場合に? 2102 * そ?値を書込み禁止にする機?です?これは、エ?ター自身が?を判断して 2103 * 書き込み許可か禁止かを判断して?す? 2104 * こ?動きを汎用?するため、指定?カラ?カンマ区???CSV)で?? 2105 * することにより、レン?ーとエ?ターを設定?によって動的に?替える 2106 * 機?を実現します? 2107 * そ?場合?表示/編?もに、?頭のアン??バ?は削除されます? 2108 * また?全カラ?つ?、有効にする場合?、writableControl="*" を設定します? 2109 * 2110 * @og.rev 3.8.0.9 (2005/10/17) 新規追? 2111 * @og.rev 5.1.8.0 (2010/07/01) ?ロジ?変更(setBooleanArray) 2112 * 2113 * @param wrtCtrl 書き込み制御を行いたいカラ?CSV形式で?? 2114 */ 2115 public void setWritableControl( final String wrtCtrl ) { 2116 setBooleanArray( wrtCtrl,true,writeCtrl ); 2117 2118 // if( wrtCtrl != null ) { 2119 // // 書き込み制御の許可 をカラ?位で設定?* の場合?、?カラ?可 2120 // if( "*".equals( wrtCtrl ) ) { 2121 // Arrays.fill( writeCtrl,true ); 2122 // } 2123 // else { 2124 // Arrays.fill( writeCtrl,false ); 2125 // String[] clmNames = StringUtil.csv2Array( wrtCtrl ); 2126 // for( int i=0; i<clmNames.length; i++ ) { 2127 // if( clmNames[i] != null && clmNames[i].length() > 0 ) { 2128 // int no = table.getColumnNo( clmNames[i] ); 2129 // if( no >= 0 ) { writeCtrl[ no ] = true; } 2130 // } 2131 // } 2132 // } 2133 // } 2134 } 2135 2136 /** 2137 * CSV形式で?されたカラ?、true/false の初期設定を行います? 2138 * 2139 * 従来は、各クラスで実?れて?処?、??にまとめます? 2140 * これにより、各種機?をあらかじめ実?ておきます? 2141 * ??カラ?、null の場合?、何も処?行いません?つまり?初期値のまま) 2142 * ??カラ?? の場合?、すべてのカラ??されたとみなし?配?に値を設定します? 2143 * ??カラ??"(ゼロ??)の場合?、なにもカラ??されて??のとみなされ? 2144 * 初期値の?埋められます? 2145 * 2146 * @og.rev 5.1.8.0 (2010/07/01) 新規追? 2147 * 2148 * @param clsm ??カラ?CSV形式で?? 2149 * @param def 設定する? 2150 * @param arrays 設定す?配? 2151 */ 2152 private void setBooleanArray( final String clsm , final boolean def , final boolean[] arrays ) { 2153 if( clsm != null ) { 2154 // 書き込み制御の許可 をカラ?位で設定?* の場合?、?カラ?可 2155 if( "*".equals( clsm ) ) { 2156 Arrays.fill( arrays,def ); 2157 } 2158 else { 2159 Arrays.fill( arrays,!def ); 2160 String[] clmNames = StringUtil.csv2Array( clsm ); 2161 for( int i=0; i<clmNames.length; i++ ) { 2162 if( clmNames[i] != null && clmNames[i].length() > 0 ) { 2163 int no = table.getColumnNo( clmNames[i] ); 2164 if( no >= 0 ) { arrays[ no ] = def; } 2165 } 2166 } 2167 } 2168 } 2169 } 2170 2171 /** 2172 * ogPopup で検索結果の値を返すキーを?CSV形式で?します? 2173 * 2174 * popup の検索結果を返す画面で、結果のラジオボタンにイベントセ?します? 2175 * こ?場合?オープンもとのwindow に値を返しますが、そのキーをCSV形式で 2176 * ?します? 2177 * なお?こ?メソ?は、?表示(HTMLTable)関係?ビューのみでサポ?トして 2178 * ?すが、チェ?メソ?の関係で、それ以外?ビューに適用しても??? 2179 * するようにします?(エラーにしません) 2180 * 2181 * @og.rev 3.8.6.1 (2006/10/20) 新規追? 2182 * 2183 * @param rtnKeys ogPopupで値を返すカラ?字?(CSV形? 2184 */ 2185 public void setPopupReturnKeys( final String rtnKeys ) { 2186 // こ?メソ?は、?表示(HTMLTable)関係?ビューのみでサポ?トして 2187 // ?すが、チェ?メソ?の関係で、それ以外?ビューに適用しても??? 2188 // するようにします?(エラーにしません) 2189 } 2190 2191 /** 2192 * table要?対して class 属?を設定します? 2193 * 2194 * 従来の シス?リソースでの??ブルレイアウト?設定を?し? 2195 * CSSファイルで、指定するよ?変更して?す? 2196 * これに伴??CSSファイルのキーとして、クラス属?を?力します? 2197 * view(また?、?力されるtableタグ)のレイアウト?、このクラス属?で 2198 * ?することが可能になります? 2199 * 初期値は、viewTable です? 2200 * 2201 * @og.rev 4.0.0.0 (2007/04/16) 新規追? 2202 * 2203 * @param cls class属?を表す文字? 2204 */ 2205 public void setTableClass( final String cls ) { 2206 if( cls != null ) { 2207 clazz = cls; 2208 } 2209 } 2210 2211 /** 2212 * table要?対して class 属?を返します? 2213 * 2214 * @og.rev 4.0.0.0 (2007/04/16) 新規追? 2215 * 2216 * @return class属?を表す文字? 2217 */ 2218 protected String getTableClass() { 2219 return clazz; 2220 } 2221 2222 /** 2223 * outerのIDを持つDIV要?heightを指定しま? 2224 * 2225 * ビューの高さ、??できるようにします? 2226 * これによって?画面に?つのビューを?力する事も可能となります? 2227 * 初期値はnullです? 2228 * 2229 * @og.rev 4.2.0.0 (2008/03/18) 新規追? 2230 * 2231 * @param high ビューの高さ 2232 */ 2233 public void setHeight( final String high ) { 2234 height = high; 2235 } 2236 2237 /** 2238 * outerのIDを持つDIV要?widthを指定しま? 2239 * 2240 * ビューの高さ、??できるようにします? 2241 * これによって?画面に?つのビューを?力する事も可能となります? 2242 * 初期値はnullです? 2243 * 2244 * @og.rev 4.2.0.0 (2008/03/18) 新規追? 2245 * 2246 * @param wide ビューの高さ 2247 */ 2248 public void setWidth( final String wide ) { 2249 width = wide; 2250 } 2251 2252 /** 2253 * リソースマネージャを設定します? 2254 * クロス?時に、useColumnHeader="true"とした場合?み設定されます? 2255 * 2256 * @og.rev 4.0.0.0 新規作? 2257 * 2258 * @param res リソースマネージャー 2259 */ 2260 public void setResourceManager( final ResourceManager res ) { 2261 resourceManager = res; 2262 } 2263 2264 /** 2265 * リソースマネージャを取得します? 2266 * 2267 * @og.rev 4.0.0.0 新規作? 2268 * 2269 * @return ResourceManagerリソースマネージャー 2270 */ 2271 protected ResourceManager getResourceManager() { 2272 return resourceManager; 2273 } 2274 2275 /** 2276 * 改廃Cのつ???をスキ??するかど??します? 2277 * 2278 * "true" で、改廃Cのつ?行をスキ??します? 2279 * 初期値はfalseです? 2280 * 2281 * @og.rev 4.3.1.0 (2008/09/08) 新規追? 2282 * 2283 * @param sne 改廃Cのつ???をスキ??するかど?(true:スキ??する/false:スキ??しな? 2284 */ 2285 public void setSkipNoEdit( final boolean sne ) { 2286 skipNoEdit = sne; 2287 } 2288 2289 /** 2290 * 改廃Cのつ???をスキ??するかど??します? 2291 * 2292 * skipNoEdit="true"でかつ、編?れて??改廃Cがつ???場合?み 2293 * trueを返します? 2294 * 2295 * @og.rev 4.3.1.0 (2008/09/08) 新規追? 2296 * 2297 * @param row 行番号 2298 * 2299 * @return スキ??対象行か 2300 */ 2301 protected boolean isSkipNoEdit( final int row ) { 2302 return skipNoEdit && ( table.getModifyType( row ) == null || table.getModifyType( row ).length() == 0 ); 2303 } 2304 2305 /** 2306 * 画面遷移なしモードに対応した形で処?行うかを?します? 2307 * 2308 * "true" で、画面遷移なしモードに対応します? 2309 * 初期値はfalseです? 2310 * 2311 * @og.rev 4.3.3.0 (2008/10/01) 新規追? 2312 * 2313 * @param flag 画面遷移なしモードに対応するかど?(true:対応す?false:対応しな? 2314 */ 2315 public void setNoTransition( final boolean flag ) { 2316 noTransition = flag; 2317 } 2318 2319 /** 2320 * 画面遷移なしモードに対応した形で処?行うかを返します? 2321 * 2322 * "true" で、画面遷移なしモードに対応します? 2323 * 初期値はfalseです? 2324 * 2325 * @og.rev 4.3.3.0 (2008/10/01) 新規追? 2326 * 2327 * @return 画面遷移なしモードに対応するかど?(true:対応す?false:対応しな? 2328 */ 2329 protected boolean isNoTransition() { 2330 return noTransition; 2331 } 2332 2333 /** 2334 * 該当行?行番号と改廃Cを?力します? 2335 * 出力形式??rid="[行番号]" kh="[改廃C]" です? 2336 * 改廃Cが付加されて???合?、改廃Cがnullの場合?、kh属?は出力されません? 2337 * (画面遷移なしモードで使用しま? 2338 * 2339 * @og.rev 4.3.3.0 (2008/10/01) 新規作? 2340 * 2341 * @param row 行番号( ?から始め?) 2342 * 2343 * @return 該当行?行番号と改廃C 2344 */ 2345 protected String getHiddenRowValue( final int row ) { 2346 String kh = ""; 2347 if( table.getModifyType( row ) != null && table.getModifyType( row ).length() > 0 ) { 2348 kh = " " + hiddenCdkhKey + "=\"" + table.getModifyType( row ) + "\""; 2349 } 2350 return " " + hiddenRowKey + "=\"" + row + "\"" + kh; 2351 } 2352 2353 /** 2354 * ビューで表示したカラ???をカンマ区?で返します? 2355 * 2356 * @og.rev 5.1.6.0 (2010/05/01) 新規追? 2357 * 2358 * @return ビューで表示したカラ??? 2359 */ 2360 public String getViewClms() { 2361 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_MIDDLE ); 2362 for( int i=0; i<clmDisplay.length; i++ ) { 2363 if( clmDisplay[i] && !( rowWritableFlag && i==0 ) ) { 2364 if( buf.length() > 0 ) { buf.append( ',' ); } 2365 buf.append( dbColumn[i].getName() ); 2366 } 2367 } 2368 return buf.toString(); 2369 } 2370 2371 /** 2372 * 表示?の編?並び替?が可能かど?を返しま? 2373 * 2374 * @og.rev 5.1.6.0 (2010/05/01) 新規追? 2375 * 2376 * @return 表示?の編?並び替?が可能かど?(true:可能) 2377 */ 2378 public boolean isEditable() { 2379 return true; 2380 } 2381 2382 /** 2383 * こ?ViewFormが作?された画面IDをセ?します? 2384 * 2385 * @og.rev 5.1.7.0 (2010/06/01) 新規追? 2386 * 2387 * @param gamenId 画面ID 2388 */ 2389 public void setGamenId( final String gamenId ) { 2390 this.gamenId = gamenId; 2391 } 2392 2393 /** 2394 * こ?ViewFormが作?された画面IDを返します? 2395 * 2396 * @og.rev 5.1.7.0 (2010/06/01) 新規追? 2397 * 2398 * @return 画面ID 2399 */ 2400 public String getGamenId() { 2401 return gamenId; 2402 } 2403 2404 /** 2405 * カラ??入力アシスト機?を利用するかど?を返します? 2406 * 2407 * 条件は、?入力アシストカラ?、かつ、書き込み許可(isColumnWritable(clm)==true)の場合とする? 2408 * 2409 * @og.rev 5.2.1.0 (2010/10/01) 新規作? 2410 * 2411 * @param column カラ?号 2412 * 2413 * @return 利用する(true)?しな?false) 2414 */ 2415 protected boolean isClmBulkSet( final int column ) { 2416 return clmBulkSet[ column ] && clmWritable[ column ]; 2417 } 2418 2419 /** 2420 * ?入力カラ??アシスト機?を利用するカラ?を?カンマ区?で与えます? 2421 * 2422 * これは、カラ??書き込み時に、?入力可能なカラ?ヘッ??に表示し? 2423 * ?登録できる機?を提供します? 2424 * こ?機?は、jsp/common/bulkSet.js JavaScript とともに提供されます? 2425 * IE につ?は、クリ??ボ?ドも利用できます?Ctrl-C と Ctrl-V でそれぞれ 2426 * ??のカラ??値の取り出しと書き込みが可能になります? 2427 * "*" を指定すると、すべてのカラ?(columnBulkSet)?したことになります? 2428 * 2429 * @og.rev 5.2.1.0 (2010/10/01) 新規作? 2430 * 2431 * @param columnName 例?OYA,KO,HJO,SU,DYSET,DYUPD" 2432 */ 2433 public void setColumnBulkSet( final String columnName ) { 2434 setBooleanArray( columnName,true,clmBulkSet ); 2435 } 2436 }