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 */ 016package org.opengion.plugin.column; 017 018import org.opengion.hayabusa.db.CellEditor; 019import org.opengion.hayabusa.db.DBColumn; 020 021/** 022 * カラムの編集パラメーターの開始、終了、ステップの情報より、プルダウンメニューを作成して 023 * 編集する場合に使用するエディタークラスです。 024 * 025 * ここでは、数字(連番)の自動生成を行います。パラメータで、開始、終了、ステップを指定します。 026 * パラメータの初期値は、開始(1)、終了(10)、ステップ(1) です。 027 * 028 * 例:1,10,1 → 1,2,3,4,5,6,7,8,9,10 のプルダウン 029 * 例:10,100,10 → 10,20,30,40,50,60,70,80,90,100 のプルダウン 030 * 例:-5,5,1 → -5,-4,-3,-2,-1,0,1,2,3,4,5 のプルダウン 031 * 例:5,-5,-2 → 5,3,1,-1,-3,-5 のプルダウン 032 * 033 * カラムの表示に必要な属性は、DBColumn オブジェクト より取り出します。 034 * このクラスは、DBColumn オブジェクト毎に1つ作成されます。 035 * 036 * @og.rev 7.3.1.1 (2021/02/25)ゼロ埋めや少数フォーマットを自動判定する。 037 * 例:000,020,5 → 000,005,010,015,020 のプルダウン 038 * 例:0.00,1.00,0.2 → 0.00,0.20,0.40,0.60,0.80,1.00 のプルダウン 039 * 040 * 開始をゼロ埋め指定した場合は、その桁数に応じて、前ゼロ埋めします。 041 * 少数点の開始の場合は、その桁数に合わせて、後ろゼロ埋めします。 042 * 小数点の前ゼロ埋めは、サポートしていません。 043 * 044 * @og.rev 5.6.1.1 (2013/02/08) 新規作成 045 * @og.group データ編集 046 * 047 * @version 4.0 048 * @author Kazuhiko Hasegawa 049 * @since JDK5.0, 050 */ 051public class Editor_NUMMENU extends Editor_MENU { 052 /** このプログラムのVERSION文字列を設定します。 {@value} */ 053 private static final String VERSION = "6.4.2.0 (2016/01/29)" ; 054 055 /** 056 * デフォルトコンストラクター 057 * 058 * @og.rev 6.4.2.0 (2016/01/29) PMD refactoring. Each class should declare at least one constructor. 059 */ 060 public Editor_NUMMENU() { super(); } // これも、自動的に呼ばれるが、空のメソッドを作成すると警告されるので、明示的にしておきます。 061 062 /** 063 * 各オブジェクトから自分のインスタンスを返します。 064 * 自分自身をキャッシュするのか、新たに作成するのかは、各サブクラスの実装に 065 * まかされます。 066 * 067 * @og.rev 6.0.4.0 (2014/11/28) サブクラスで タイプを指定するための対応 068 * 069 * @param clm DBColumnオブジェクト 070 * 071 * @return CellEditorオブジェクト 072 * @og.rtnNotNull 073 */ 074 @Override 075 public CellEditor newInstance( final DBColumn clm ) { 076 return new Editor_MENU( clm,"NUM" ); 077 } 078}