/*
 * Copyright 2006 Mask@ Project.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.maskat.ide.property.descriptor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;

public final class PropDescriptors implements IPropertyIDConstants {

	private static PropDescriptors inst = null;

	private Map propNameMap = new HashMap(), eventNameMap = new HashMap();

	private List eventPropIDs = new ArrayList();

	// 各イベントのPropertyDescriptor
	private IPropertyDescriptor NAME, TEXT, CLASSNAME, TYPE, ISREQUIRED, DISABLE, ROWS,
			AUTOUP, ORIENTATION, STYLE, PROP, LIMINF, LIMSUP, WITHIMG, REVERSECLOSE,
			TAILLECURS, ALT, ENABLE;

	private EventPropertyDescriptor ONCLICK, ONDBLCLICK, ONSETDISPLAY, ONBLUR, ONFOCUS,
			ONCELLEDIT, ONCELLWRITE;

	private IPropertyDescriptor TITLE, WIDTH, POSITION, DRAGGABLE, AUTORESIZEPARENT,
			DYNAMIC, INITIAL, IMAGEOUT, IMAGEON, ALTERNATETEXT;

	private IPropertyDescriptor BACKGROUNDCOLOR, WIDTHTABNAME, NOACTIVETAB, AUTOREDIMTAB,
			ISCLOSABLE, DRAGGABLEITEM;

	private IPropertyDescriptor URL, BOOLWITHLABEL, GROUP, CHECKED, VALUE, RANG,
			LINEHEIGHT, MULTISELECT, ACTIFCLIC, SORTABLE, WIDTHLASTCELL, SWITCHABLE,
			WRITABLE;

	private IPropertyDescriptor CELLACTIVE, BNAVIG, BOOLPRINT, BOOLSELACTIVE, WITHROOT,
			ROOTOPEN, WITHT, BAUTORESIZECONTENU, DATATYPE, HEIGHTITEM, AUTORESIZABLEH,
			AUTORESIZABLEW, DRAGGABLENODE;

	private IPropertyDescriptor ICON, ICON2, OPEN, RELOAD, TYPEINFO, TREENODEONCLICK;

	private IPropertyDescriptor FIELDTYPE, DICTID, MINCHARS, AFTERUPDATEELEMENT,
			APPENDABLE, IMEMODE;

	private List COMPONENT_COMMON_PROPERTYDESC = new ArrayList();

	public IPropertyDescriptor[] COMMON_PROPERTYDESC_ARRAY;

	private IPropertyDescriptor[] mergeWithCompProperty(IPropertyDescriptor[] descs) {
		return mergeProperty(descs, COMMON_PROPERTYDESC_ARRAY);
	}

	private IPropertyDescriptor[] mergeProperty(IPropertyDescriptor[] desc1,
			IPropertyDescriptor[] desc2) {
		// 必要の長さがある配列のスペースをallocate
		IPropertyDescriptor[] result = new IPropertyDescriptor[desc1.length
				+ desc2.length];
		// コンポーネント共通のPropertyDescriptorをresultに
		System.arraycopy(desc1, 0, result, 0, desc1.length);

		// descsをresultにコピー
		System.arraycopy(desc2, 0, result, desc1.length, desc2.length);
		return result;
	}

	// 各コンポーネントのPropertyDescriptor[]
	public IPropertyDescriptor[] LABEL_PROPDESC, BUTTON_PROPDESC, FRAME_PROPDESC,
			IMAGE_PROPDESC, TEXT_PROPDESC;

	public IPropertyDescriptor[] RADIO_PROPDESC, CHECKBOX_PROPDESC, COMBO_PROPDESC,
			COMBOITEM_PROPDESC, GRID_PROPDESC, GRIDHEADER_PROPDESC, GRIDLINE_PROPDESC;

	public IPropertyDescriptor[] SPLITTER_PROPDESC, DIVSPLIT_PROPDESC,
			TABFOLDER_PROPDESC, TABITEM_PROPDESC, CODELIB_PROPDESC, TREEVIEW_PROPDESC;

	public IPropertyDescriptor[] EF_PROPDESC, AC_PROPDESC;

	private PropDescriptors() {
		eventPropIDs.add(PROP_ONCLICK);
		eventPropIDs.add(PROP_ONDBLCLICK);
		eventPropIDs.add(PROP_ONSETDISPLAY);
		eventPropIDs.add(PROP_ONBLUR);
		eventPropIDs.add(PROP_ONFOCUS);
		eventPropIDs.add(PROP_ONCELLEDIT);
		eventPropIDs.add(PROP_ONCELLWRITE);
		eventPropIDs.add(PROP_ONMOUSEDOWN);
		eventPropIDs.add(PROP_ONMOUSEUP);
		eventPropIDs.add(PROP_ONMOUSEOVER);
		eventPropIDs.add(PROP_ONMOUSEMOVE);

		propNameMap.put(PROP_ID, "id");
		propNameMap.put(PROP_NAME, "name");
		propNameMap.put(PROP_TEXT, "text");
		propNameMap.put(PROP_CLASSNAME, "className");
		propNameMap.put(PROP_METRIC, "Metric");
		propNameMap.put(PROP_ONCLICK, "onclick");
		propNameMap.put(PROP_ONDBLCLICK, "ondblclick");
		propNameMap.put(PROP_ONSETDISPLAY, "onsetdisplay");
		propNameMap.put(PROP_ONBLUR, "onblur");
		propNameMap.put(PROP_ONFOCUS, "onfocus");
		propNameMap.put(PROP_ONCELLEDIT, "oncelledit");
		propNameMap.put(PROP_ONCELLWRITE, "oncellwrite");
		propNameMap.put(PROP_ONMOUSEDOWN, "onmousedown");
		propNameMap.put(PROP_ONMOUSEUP, "onmouseup");
		propNameMap.put(PROP_ONMOUSEOVER, "onmouseover");
		propNameMap.put(PROP_ONMOUSEMOVE, "onmousemove");
		propNameMap.put(PROP_TITLE, "title");
		propNameMap.put(PROP_POSITION, "position");
		propNameMap.put(PROP_DRAGGABLE, "draggable");
		propNameMap.put(PROP_DYNAMIC, "dynamic");
		propNameMap.put(PROP_INITIAL, "initial");
		propNameMap.put(PROP_ORIENTATION, "orientation");
		propNameMap.put(PROP_BACKGROUNDCOLOR, "backgroundColor");
		propNameMap.put(PROP_WIDTHTABNAME, "widthTabName");
		propNameMap.put(PROP_NOACTIVETAB, "noActiveTab");
		propNameMap.put(PROP_AUTOREDIMTAB, "autoRedimTab");
		propNameMap.put(PROP_ISCLOSABLE,"isClosable");
		propNameMap.put(PROP_DRAGGABLEITEM,"draggableItem");
		propNameMap.put(PROP_TYPE, "type");
		propNameMap.put(PROP_DATATYPE, "datatype");
		propNameMap.put(PROP_ISREQUIRED, "isRequired");
		propNameMap.put(PROP_DISABLE, "disable");
		propNameMap.put(PROP_AUTOUP, "autoUp");
		propNameMap.put(PROP_ROWS, "rows");
		propNameMap.put(PROP_URL, "url");
		propNameMap.put(PROP_BOOLWITHLABEL, "boolWithLabel");
		propNameMap.put(PROP_STYLE, "style");
		propNameMap.put(PROP_PROP, "prop");
		propNameMap.put(PROP_LIMINF, "limInf");
		propNameMap.put(PROP_LIMSUP, "limSup");
		propNameMap.put(PROP_WITHIMG, "withImg");
		propNameMap.put(PROP_REVERSECLOSE, "reverseClose");
		propNameMap.put(PROP_TAILLECURS, "tailleCurs");
		propNameMap.put(PROP_ALT, "alt");
		propNameMap.put(PROP_ENABLE, "enable");
		propNameMap.put(PROP_GROUP, "group");
		propNameMap.put(PROP_CHECKED, "checked");
		propNameMap.put(PROP_VALUE, "value");
		propNameMap.put(PROP_RANG, "rang");
		propNameMap.put(PROP_LINEHEIGHT, "lineHeight");
		propNameMap.put(PROP_MULTISELECT, "multiSelect");
		propNameMap.put(PROP_ACTIFCLIC, "actifClic");
		propNameMap.put(PROP_CELLACTIVE, "cellActive");
		propNameMap.put(PROP_BNAVIG, "bNavig");
		propNameMap.put(PROP_BOOLPRINT, "boolPaint");
		propNameMap.put(PROP_SORTABLE, "sortable");
		propNameMap.put(PROP_WIDTHLASTCELL, "widthLastCell");
		propNameMap.put(PROP_SWITCHABLE, "switchable");
		propNameMap.put(PROP_AUTORESIZEPARENT, "autoResizeParent");
		propNameMap.put(PROP_WRITABLE, "writable");

		propNameMap.put(PROP_BOOLSELACTIVE, "boolSelActive");
		propNameMap.put(PROP_WITHROOT, "withRoot");
		propNameMap.put(PROP_ROOTOPEN, "rootOpen");
		propNameMap.put(PROP_WITHT, "withT");
		propNameMap.put(PROP_AUTORESIZABLEH, "autoResizableH");
		propNameMap.put(PROP_AUTORESIZABLEW, "autoResizableW");
		propNameMap.put(PROP_DRAGGABLENODE, "draggableNode");

		propNameMap.put(PROP_ICON, "icon");
		propNameMap.put(PROP_ICON2, "icon2");
		propNameMap.put(PROP_OPEN, "open");
		propNameMap.put(PROP_RELOAD, "reload");
		propNameMap.put(PROP_TYPEINFO, "typeInfo");
		propNameMap.put(PROP_TREENODEONCLICK, "onclick");
		propNameMap.put(PROP_WIDTH, "width");
		propNameMap.put(PROP_IMAGEON, "imageOn");
		propNameMap.put(PROP_IMAGEOUT, "imageOut");
		propNameMap.put(PROP_ALTERNATETEXT, "alternateText");
		propNameMap.put(PROP_HEIGHTITEM, "heightItem");

		// 拡張部品属性
		propNameMap.put(PROP_BAUTORESIZECONTENU, "bAutoResizeContenu");
		propNameMap.put(PROP_FIELDTYPE, "fieldType");
		propNameMap.put(PROP_DICTID, "dictId");
		propNameMap.put(PROP_MINCHARS, "minChars");
		propNameMap.put(PROP_AFTERUPDATEELEMENT, "afterUpdateElement");
		propNameMap.put(PROP_APPENDABLE, "appendable");
		propNameMap.put(PROP_IMEMODE, "imeMode");
		// 拡張部品属性

		eventNameMap.put(PROP_ONCLICK, "onclick");
		eventNameMap.put(PROP_ONDBLCLICK, "ondblclick");
		eventNameMap.put(PROP_ONSETDISPLAY, "onsetdisplay");
		eventNameMap.put(PROP_ONBLUR, "onblur");
		eventNameMap.put(PROP_ONFOCUS, "onfocus");
		eventNameMap.put(PROP_ONCELLEDIT, "oncelledit");
		eventNameMap.put(PROP_ONCELLWRITE, "oncellwrite");
		eventNameMap.put(PROP_ONMOUSEDOWN, "onmousedown");
		eventNameMap.put(PROP_ONMOUSEUP, "onmouseup");
		eventNameMap.put(PROP_ONMOUSEOVER, "onmouseover");
		eventNameMap.put(PROP_ONMOUSEMOVE, "onmousemove");

		NAME = new MaskatTextPropertyDescriptor(PROP_NAME, (String) propNameMap
				.get(PROP_NAME));
		// name属性の空白入力は不可
		((PropertyDescriptor) NAME).setValidator(new ICellEditorValidator() {
			public String isValid(Object value) {
				if (value == null || "".equals(((String) value).trim())) {
					return "コンポーネントname属性を入力してください。";
				}
				return null;
			}
		});
		TEXT = new MaskatTextPropertyDescriptor(PROP_TEXT, (String) propNameMap
				.get(PROP_TEXT));
		CLASSNAME = new MaskatTextPropertyDescriptor(PROP_CLASSNAME, (String) propNameMap
				.get(PROP_CLASSNAME));
		TYPE = new MaskatTextPropertyDescriptor(PROP_TYPE, (String) propNameMap
				.get(PROP_TYPE));
		ISREQUIRED = new MaskatTextPropertyDescriptor(PROP_ISREQUIRED,
				(String) propNameMap.get(PROP_ISREQUIRED));
		DISABLE = new MaskatTextPropertyDescriptor(PROP_DISABLE, (String) propNameMap
				.get(PROP_DISABLE));
		AUTOUP = new MaskatTextPropertyDescriptor(PROP_AUTOUP, (String) propNameMap
				.get(PROP_AUTOUP));
		ROWS = new MaskatTextPropertyDescriptor(PROP_ROWS, (String) propNameMap
				.get(PROP_ROWS));
		DATATYPE = new MaskatTextPropertyDescriptor(PROP_DATATYPE, (String) propNameMap
				.get(PROP_DATATYPE));
		ORIENTATION = new MaskatTextPropertyDescriptor(PROP_ORIENTATION,
				(String) propNameMap.get(PROP_ORIENTATION));
		STYLE = new MaskatTextPropertyDescriptor(PROP_STYLE, (String) propNameMap
				.get(PROP_STYLE));
		PROP = new MaskatTextPropertyDescriptor(PROP_PROP, (String) propNameMap
				.get(PROP_PROP));
		LIMINF = new MaskatTextPropertyDescriptor(PROP_LIMINF, (String) propNameMap
				.get(PROP_LIMINF));
		LIMSUP = new MaskatTextPropertyDescriptor(PROP_LIMSUP, (String) propNameMap
				.get(PROP_LIMSUP));
		WITHIMG = new MaskatTextPropertyDescriptor(PROP_WITHIMG, (String) propNameMap
				.get(PROP_WITHIMG));
		REVERSECLOSE = new MaskatTextPropertyDescriptor(PROP_REVERSECLOSE,
				(String) propNameMap.get(PROP_REVERSECLOSE));
		TAILLECURS = new MaskatTextPropertyDescriptor(PROP_TAILLECURS,
				(String) propNameMap.get(PROP_TAILLECURS));
		ALT = new MaskatTextPropertyDescriptor(PROP_ALT, (String) propNameMap
				.get(PROP_ALT));
		ENABLE = new MaskatTextPropertyDescriptor(PROP_ENABLE, (String) propNameMap
				.get(PROP_ENABLE));
		URL = new MaskatTextPropertyDescriptor(PROP_URL, (String) propNameMap
				.get(PROP_URL));
		BOOLWITHLABEL = new MaskatTextPropertyDescriptor(PROP_BOOLWITHLABEL,
				(String) propNameMap.get(PROP_BOOLWITHLABEL));
		GROUP = new MaskatTextPropertyDescriptor(PROP_GROUP, (String) propNameMap
				.get(PROP_GROUP));
		CHECKED = new MaskatTextPropertyDescriptor(PROP_CHECKED, (String) propNameMap
				.get(PROP_CHECKED));
		VALUE = new MaskatTextPropertyDescriptor(PROP_VALUE, (String) propNameMap
				.get(PROP_VALUE));
		RANG = new MaskatTextPropertyDescriptor(PROP_RANG, (String) propNameMap
				.get(PROP_RANG));
		LINEHEIGHT = new MaskatTextPropertyDescriptor(PROP_LINEHEIGHT,
				(String) propNameMap.get(PROP_LINEHEIGHT));
		MULTISELECT = new MaskatTextPropertyDescriptor(PROP_MULTISELECT,
				(String) propNameMap.get(PROP_MULTISELECT));
		ACTIFCLIC = new MaskatTextPropertyDescriptor(PROP_ACTIFCLIC, (String) propNameMap
				.get(PROP_ACTIFCLIC));
		SORTABLE = new MaskatTextPropertyDescriptor(PROP_SORTABLE, (String) propNameMap
				.get(PROP_SORTABLE));
		WIDTHLASTCELL = new MaskatTextPropertyDescriptor(PROP_WIDTHLASTCELL,
				(String) propNameMap.get(PROP_WIDTHLASTCELL));
		SWITCHABLE = new MaskatTextPropertyDescriptor(PROP_SWITCHABLE,
				(String) propNameMap.get(PROP_SWITCHABLE));
		WRITABLE = new MaskatTextPropertyDescriptor(PROP_WRITABLE, (String) propNameMap
				.get(PROP_WRITABLE));
		CELLACTIVE = new MaskatTextPropertyDescriptor(PROP_CELLACTIVE,
				(String) propNameMap.get(PROP_CELLACTIVE));
		BNAVIG = new MaskatTextPropertyDescriptor(PROP_BNAVIG, (String) propNameMap
				.get(PROP_BNAVIG));
		BOOLPRINT = new MaskatTextPropertyDescriptor(PROP_BOOLPRINT, (String) propNameMap
				.get(PROP_BOOLPRINT));
		BOOLSELACTIVE = new MaskatTextPropertyDescriptor(PROP_BOOLSELACTIVE,
				(String) propNameMap.get(PROP_BOOLSELACTIVE));
		WITHROOT = new MaskatTextPropertyDescriptor(PROP_WITHROOT, (String) propNameMap
				.get(PROP_WITHROOT));
		ROOTOPEN = new MaskatTextPropertyDescriptor(PROP_ROOTOPEN, (String) propNameMap
				.get(PROP_ROOTOPEN));
		WITHT = new MaskatTextPropertyDescriptor(PROP_WITHT, (String) propNameMap
				.get(PROP_WITHT));
		AUTORESIZABLEH = new MaskatTextPropertyDescriptor(PROP_AUTORESIZABLEH,
				(String) propNameMap.get(PROP_AUTORESIZABLEH));
		AUTORESIZABLEW = new MaskatTextPropertyDescriptor(PROP_AUTORESIZABLEW,
				(String) propNameMap.get(PROP_AUTORESIZABLEW));
		DRAGGABLENODE = new MaskatTextPropertyDescriptor(PROP_DRAGGABLENODE,
				(String) propNameMap.get(PROP_DRAGGABLENODE));
		BAUTORESIZECONTENU = new MaskatTextPropertyDescriptor(PROP_BAUTORESIZECONTENU,
				(String) propNameMap.get(PROP_BAUTORESIZECONTENU));
		FIELDTYPE = new MaskatTextPropertyDescriptor(PROP_FIELDTYPE, (String) propNameMap
				.get(PROP_FIELDTYPE));
		DICTID = new MaskatTextPropertyDescriptor(PROP_DICTID, (String) propNameMap
				.get(PROP_DICTID));
		MINCHARS = new MaskatTextPropertyDescriptor(PROP_MINCHARS, (String) propNameMap
				.get(PROP_MINCHARS));
		AFTERUPDATEELEMENT = new MaskatTextPropertyDescriptor(PROP_AFTERUPDATEELEMENT,
				(String) propNameMap.get(PROP_AFTERUPDATEELEMENT));
		APPENDABLE = new MaskatTextPropertyDescriptor(PROP_APPENDABLE,
				(String) propNameMap.get(PROP_APPENDABLE));
		IMEMODE = new MaskatTextPropertyDescriptor(PROP_IMEMODE, (String) propNameMap
				.get(PROP_IMEMODE));

		ICON = new MaskatTextPropertyDescriptor(PROP_ICON, (String) propNameMap
				.get(PROP_ICON));
		ICON2 = new MaskatTextPropertyDescriptor(PROP_ICON2, (String) propNameMap
				.get(PROP_ICON2));
		OPEN = new MaskatTextPropertyDescriptor(PROP_OPEN, (String) propNameMap
				.get(PROP_OPEN));
		RELOAD = new MaskatTextPropertyDescriptor(PROP_RELOAD, (String) propNameMap
				.get(PROP_RELOAD));
		TYPEINFO = new MaskatTextPropertyDescriptor(PROP_TYPEINFO, (String) propNameMap
				.get(PROP_TYPEINFO));
		TREENODEONCLICK = new MaskatTextPropertyDescriptor(PROP_TREENODEONCLICK,
				(String) propNameMap.get(PROP_TREENODEONCLICK));
		WIDTH = new MaskatTextPropertyDescriptor(PROP_WIDTH, (String) propNameMap
				.get(PROP_WIDTH));

		ONCLICK = new EventPropertyDescriptor(PROP_ONCLICK, (String) propNameMap
				.get(PROP_ONCLICK));

		ONDBLCLICK = new EventPropertyDescriptor(PROP_ONDBLCLICK, (String) propNameMap
				.get(PROP_ONDBLCLICK));

		ONSETDISPLAY = new EventPropertyDescriptor(PROP_ONSETDISPLAY,
				(String) propNameMap.get(PROP_ONSETDISPLAY));

		ONBLUR = new EventPropertyDescriptor(PROP_ONBLUR, (String) propNameMap
				.get(PROP_ONBLUR));

		ONFOCUS = new EventPropertyDescriptor(PROP_ONFOCUS, (String) propNameMap
				.get(PROP_ONFOCUS));

		ONCELLEDIT = new EventPropertyDescriptor(PROP_ONCELLEDIT, (String) propNameMap
				.get(PROP_ONCELLEDIT));

		ONCELLWRITE = new EventPropertyDescriptor(PROP_ONCELLWRITE, (String) propNameMap
				.get(PROP_ONCELLWRITE));

		TITLE = new MaskatTextPropertyDescriptor(PROP_TITLE, (String) propNameMap
				.get(PROP_TITLE));

		POSITION = new MaskatTextPropertyDescriptor(PROP_POSITION, (String) propNameMap
				.get(PROP_POSITION));

		DRAGGABLE = new MaskatTextPropertyDescriptor(PROP_DRAGGABLE, (String) propNameMap
				.get(PROP_DRAGGABLE));

		AUTORESIZEPARENT = new MaskatTextPropertyDescriptor(PROP_AUTORESIZEPARENT,
				(String) propNameMap.get(PROP_AUTORESIZEPARENT));

		DYNAMIC = new MaskatTextPropertyDescriptor(PROP_DYNAMIC, (String) propNameMap
				.get(PROP_DYNAMIC));

		INITIAL = new MaskatTextPropertyDescriptor(PROP_INITIAL, (String) propNameMap
				.get(PROP_INITIAL));

		IMAGEOUT = new MaskatTextPropertyDescriptor(PROP_IMAGEOUT, (String) propNameMap
				.get(PROP_IMAGEOUT));
		IMAGEON = new MaskatTextPropertyDescriptor(PROP_IMAGEON, (String) propNameMap
				.get(PROP_IMAGEON));
		ALTERNATETEXT = new MaskatTextPropertyDescriptor(PROP_ALTERNATETEXT,
				(String) propNameMap.get(PROP_ALTERNATETEXT));
		HEIGHTITEM = new MaskatTextPropertyDescriptor(PROP_HEIGHTITEM,
				(String) propNameMap.get(PROP_HEIGHTITEM));

		BACKGROUNDCOLOR = new MaskatTextPropertyDescriptor(PROP_BACKGROUNDCOLOR,
				(String) propNameMap.get(PROP_BACKGROUNDCOLOR));
		WIDTHTABNAME = new MaskatTextPropertyDescriptor(PROP_WIDTHTABNAME,
				(String) propNameMap.get(PROP_WIDTHTABNAME));
		NOACTIVETAB = new MaskatTextPropertyDescriptor(PROP_NOACTIVETAB,
				(String) propNameMap.get(PROP_NOACTIVETAB));
		AUTOREDIMTAB = new MaskatTextPropertyDescriptor(PROP_AUTOREDIMTAB,
				(String) propNameMap.get(PROP_AUTOREDIMTAB));
		ISCLOSABLE = new MaskatTextPropertyDescriptor(PROP_ISCLOSABLE,
				(String) propNameMap.get(PROP_ISCLOSABLE));
		DRAGGABLEITEM = new MaskatTextPropertyDescriptor(PROP_DRAGGABLEITEM,
				(String) propNameMap.get(PROP_DRAGGABLEITEM));

		COMPONENT_COMMON_PROPERTYDESC.add(NAME);
		COMPONENT_COMMON_PROPERTYDESC.add(new PropertyDescriptor(PROP_METRIC,
				(String) propNameMap.get(PROP_METRIC)));
		COMMON_PROPERTYDESC_ARRAY = (IPropertyDescriptor[]) COMPONENT_COMMON_PROPERTYDESC
				.toArray(new IPropertyDescriptor[0]);

		// 各コンポーネントのPropertyDescriptor[]を初期化
		LABEL_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { TEXT,
				CLASSNAME });

		BUTTON_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { TITLE, ALT,
				ONCLICK, ENABLE });

		FRAME_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { ONSETDISPLAY,
				TITLE, DRAGGABLE, AUTORESIZEPARENT, DYNAMIC });

		IMAGE_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { ONCLICK,
				IMAGEOUT, ALTERNATETEXT, IMAGEON });

		TEXT_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { ONBLUR,
				ONFOCUS, ISREQUIRED, DISABLE, AUTOUP, ROWS, DATATYPE });

		RADIO_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { TEXT,
				CLASSNAME, GROUP, CHECKED, ONCLICK });

		CHECKBOX_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { TEXT,
				CLASSNAME, CHECKED, ONCLICK });

		COMBO_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { ENABLE,
				HEIGHTITEM });

		COMBOITEM_PROPDESC = new IPropertyDescriptor[] { TEXT, VALUE };

		GRID_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { LINEHEIGHT,
				MULTISELECT, ACTIFCLIC, CELLACTIVE, BNAVIG, BOOLPRINT, ONCLICK,
				ONDBLCLICK, ONCELLEDIT, ONCELLWRITE, SORTABLE, WIDTHLASTCELL, SWITCHABLE,
				AUTORESIZEPARENT, WRITABLE });
		GRIDHEADER_PROPDESC = new IPropertyDescriptor[] { TITLE, TYPE, WIDTH };

		TREEVIEW_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] {
				BOOLSELACTIVE, WITHROOT, ROOTOPEN, WITHT, ONCLICK, AUTORESIZABLEH,
				AUTORESIZABLEW, DRAGGABLENODE });

		SPLITTER_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] {
				ORIENTATION, STYLE, PROP, LIMINF, LIMSUP, WITHIMG, REVERSECLOSE,
				AUTORESIZEPARENT, AUTORESIZABLEH, AUTORESIZABLEW, TAILLECURS });

		DIVSPLIT_PROPDESC = new IPropertyDescriptor[] { NAME, BACKGROUNDCOLOR };

		TABFOLDER_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] {
				WIDTHTABNAME, NOACTIVETAB, AUTOREDIMTAB, AUTORESIZEPARENT, ISCLOSABLE,
				DRAGGABLEITEM });
		TABITEM_PROPDESC = new IPropertyDescriptor[] {
				new PropertyDescriptor(PROP_NAME, (String) propNameMap.get(PROP_NAME)),
				TITLE };// tabitemのname属性はreadonlyにする
		CODELIB_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { URL,
				BOOLWITHLABEL });

		EF_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { ONSETDISPLAY,
				TITLE, POSITION, DRAGGABLE, AUTORESIZEPARENT, BAUTORESIZECONTENU,
				DYNAMIC, INITIAL });
		AC_PROPDESC = mergeWithCompProperty(new IPropertyDescriptor[] { FIELDTYPE, URL,
				DICTID, MINCHARS, AFTERUPDATEELEMENT, APPENDABLE, IMEMODE, ROWS });
	}

	public static PropDescriptors getInst() {
		if (inst == null) {
			inst = new PropDescriptors();
		}
		return inst;
	}

	/**
	 * イベント属性のプロパティIDであるかどうか
	 * 
	 * @param id
	 * @return
	 */
	public boolean isEventPropID(Object id) {
		if (eventPropIDs.contains(id))
			return true;
		return false;
	}

	/**
	 * イベント属性のプロパティIDからイベントID(onclick、onblurとか)を取得
	 * 
	 * @param id
	 * @return
	 */
	public String getEventID(Object id) {
		if (!isEventPropID(id))
			return null;
		return (String) eventNameMap.get(id);
	}
}
