001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.plugin.column;
017
018 import org.opengion.hayabusa.db.CellEditor;
019 import org.opengion.hayabusa.db.DBColumn;
020 import org.opengion.hayabusa.db.SelectionFactory; // 5.7.3.0 (2014/02/07)
021
022 /**
023 * カラãƒ??編é›?ƒ‘ラメーターの開始ã?終äº??スãƒ?ƒƒプã?フォーマットã?titleフォーマットã?æƒ??よりã€?
024 * プルãƒ?‚¦ンメニューを作æ?して編é›?�™るå?合に使用するエãƒ?‚£タークラスですã?
025 *
026 * パラメータの初期値はã€?–‹å§?0)、終äº?14)、スãƒ?ƒƒãƒ?1)、フォーマッãƒ?MM/dd)、titleフォーマッãƒ?null) ですã?
027 *
028 * ここでは、日ä»?年/æœ?日?‰ã?自動生成を行いますã?
029 * 基準ã?、実行日に対してã€?¼‹-ã?数字をæŒ?®šしますã?
030 * 例ï¼?0130206 に対してã€?2,3,1 を指定するとã€?0130204,20130205,20130206,20130207,20130208,20130209 となりますã?
031 *
032 * 開始ã?終äº?�«、特殊なコマンドをæŒ?®šする事も可能ですã?
033 * ・SD ?š当月のæœ??の日付にセãƒ?ƒˆしますã?(当月?‘日)
034 * ・ED ?š当月のæœ?¾Œã?日付にセãƒ?ƒˆしますã?(当月月末)
035 * ・SW ?š日付å?ç�??週初め(月曜日)にセãƒ?ƒˆしますã?日付ã?当日より前に移動しますã?
036 * ・EW ?š日付å?ç�??週末(日曜日)にセãƒ?ƒˆしますã?日付ã?当日より後ろに移動しますã?
037 * ・D1 ??DXXX ?š日を指定ã?åˆ?� けé?めますã?D1なら翌日、D200 なã‚?00日å¾?
038 * ・M1 ??MXXX ?š月を指定ã?åˆ?� けé?めますã?M1なら翌月、M6 なら半年å¾?
039 * ・BSD ?šå?月ã?æœ??の日付にセãƒ?ƒˆしますã?(先月?‘日)
040 * ・BED ?šå?月ã?æœ?¾Œã?日付にセãƒ?ƒˆしますã?(先月月末)
041 * ・ASD ?š翌月のæœ??の日付にセãƒ?ƒˆしますã?(翌月?‘日)
042 * ・AED ?š翌月のæœ?¾Œã?日付にセãƒ?ƒˆしますã?(翌月月末)
043 * ・M1 ?š1か月å?。数字部åˆ??、任意にæŒ?®šできるため、M5 とすればã€?¼•か月å?ã€?-2 はã€?¼’か月前
044 *
045 * スãƒ?ƒƒプã?、無æŒ?®šã?場合ã?ã€?¼‘日単位ですã?例えば、SW,M6,7 とすれば、毎é?月曜日を6か月å?まで作æ?しますã?
046 * またã?M1 はã€?¼‘か月単位になりますã?ただしã?開始日ã‚?SD などにしなã�?�¨、大の月と小ã?月で、おかしくなるã?で
047 * ご注意くã�?�•ã�??
048 *
049 * キーはã€?¼˜文字ã? yyyyMMdd 形式で与えられますã?ラベルは、フォーマットã?æŒ?®šに準拠しますã?
050 * フォーマットをæŒ?®šするå?合ã?、スãƒ?ƒƒプã?、å¿??となりますã?
051 * フォーマットã?初期値は、MM/dd ですã?
052 * titleフォーマッãƒ?は、tips表示する場合ã?フォーマットになりますã?初期値は、ありませんã€?
053 *
054 * カラãƒ??表示にå¿?¦�な属æ?は, DBColumn オブジェクãƒ?より取り出しますã?
055 * こã?クラスは、DBColumn オブジェクト毎に?‘つ作æ?されますã?
056 *
057 * @og.rev 5.6.1.1 (2013/02/08) 新規作æ?
058 * @og.group ãƒ??タ編é›?
059 *
060 * @version 4.0
061 * @author Kazuhiko Hasegawa
062 * @since JDK5.0,
063 */
064 public class Editor_YMDMENU extends Editor_MENU {
065 //* こã?プログラãƒ??VERSIONæ–?—å?を設定しますã? {@value} */
066 private static final String VERSION = "5.7.7.1 (2014/06/13)" ;
067
068 /**
069 * ãƒ?ƒ•ォルトコンストラクターã€?
070 * こã?コンストラクターで、基本オブジェクトを作æ?しますã?
071 *
072 */
073 public Editor_YMDMENU() {
074 super();
075 }
076
077 /**
078 * コンストラクターã€?
079 *
080 * ここでは、親クラスの Editor_MENU で初期化を行い、セレクションオブジェクãƒ?にã€?
081 * Selection_YMD を使用するように再設定しますã?
082 *
083 * @og.rev 5.7.3.0 (2014/02/07) SelectionFactory 対å¿?
084 * @og.rev 5.7.7.1 (2014/06/13) バグ修正
085 *
086 * @param clm DBColumnオブジェクãƒ?
087 */
088 private Editor_YMDMENU( final DBColumn clm ) {
089 super( clm );
090
091 // selection = SelectionFactory.newSelection( "YMD" , clm.getCodeData() );
092 selection = SelectionFactory.newSelection( "YMD" , clm.getEditorParam() ); // 5.7.7.1 (2014/06/13) バグ修正
093 }
094
095 /**
096 * å�?‚ªブジェクトからè?åˆ??インスタンスを返しますã?
097 * 自åˆ??身をキャãƒ?‚·ュするのかã?新たに作æ?するのかã?、各サブクラスの実è£?�«
098 * まかされますã?
099 *
100 * @param clm DBColumnオブジェクãƒ?
101 *
102 * @return CellEditorオブジェクãƒ?
103 */
104 @Override
105 public CellEditor newInstance( final DBColumn clm ) {
106 return new Editor_YMDMENU( clm );
107 }
108 }