/*
 * Copyright (c) 2006-2008 Maskat Project.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Maskat Project - initial API and implementation
 */
package org.maskat.ui.views.properties.tabbed;

import java.util.HashMap;
import java.util.Map;

import org.maskat.core.event.EventTypeConstants;
import org.maskat.ui.MaskatUIPlugin;

public class EventPropertySectionRegistry implements EventTypeConstants {

	/** The mapping from section Id to event type */
	public static final Map registry;

	static {
		registry = new HashMap();
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onBlurSection", ON_BLUR);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onCellEditSection", ON_CELL_EDIT);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onCellWriteSection", ON_CELL_WRITE);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onClickSection", ON_CLICK);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onCloseSection", ON_CLOSE);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onDbleClickSection", ON_DBLE_CLICK);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onEnableTabSection", ON_ENABLE_TAB);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onFocusSection", ON_FOCUS);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onLoadSection", ON_LOAD);
		registry.put(MaskatUIPlugin.PLUGIN_ID + ".onSetDisplaySection", ON_SET_DISPLAY);
	}

	public static String getEventType(String sectionId) {
		if (registry.containsKey(sectionId)) {
			return (String) registry.get(sectionId);
		}
		return null;
	}

}
