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.AbstractEditor;
019import org.opengion.hayabusa.db.CellEditor;
020import org.opengion.hayabusa.db.DBColumn;
021import org.opengion.fukurou.util.XHTMLTag;
022
023/**
024 * CHBOX2 エディターは、カラムのデータをチェックボックスで編集する場合に使用するクラスです。
025 *
026 * このエディターは、CHBOXとは異なりチェックボックス特有の制御を全く行いません。
027 * 特性としては、typeがcheckboxであるという1点を除いて、TEXT エディターと同じです
028 *
029 * カラムの表示に必要な属性は, DBColumn オブジェクト より取り出します。
030 * このクラスは、DBColumn オブジェクト毎に1つ作成されます。
031 *
032 * @og.group データ編集
033 *
034 * @version  4.0
035 * @author   Hiroki Nakamura
036 * @since    JDK5.0,
037 */
038public class Editor_CHBOX2 extends AbstractEditor {
039        //* このプログラムのVERSION文字列を設定します。   {@value} */
040        private static final String VERSION = "5.1.8.0 (2010/07/01)" ;
041
042        /**
043         * デフォルトコンストラクター。
044         * このコンストラクターで、基本オブジェクトを作成します。
045         *
046         */
047        public Editor_CHBOX2() {
048                return ;                // Document empty constructor 対策
049        }
050
051        /**
052         * コンストラクター。
053         *
054         * @param       clm     DBColumnオブジェクト
055         */
056        private Editor_CHBOX2( final DBColumn clm ) {
057                super( clm );
058                attributes.set( "type", "checkbox" );
059                tagBuffer.add( XHTMLTag.inputAttri( attributes ) );
060        }
061
062        /**
063         * 各オブジェクトから自分のインスタンスを返します。
064         * 自分自身をキャッシュするのか、新たに作成するのかは、各サブクラスの実装に
065         * まかされます。
066         *
067         * @param       clm     DBColumnオブジェクト
068         *
069         * @return      CellEditorオブジェクト
070         */
071        public CellEditor newInstance( final DBColumn clm ) {
072                return new Editor_CHBOX2( clm );
073        }
074}