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