⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reportcomponentidregistry.js

📁 基于eclipse的birt报表!!! 是个web项目!
💻 JS
字号:
/******************************************************************************
 *	Copyright (c) 2004 Actuate Corporation and others.
 *	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:
 *		Actuate Corporation - Initial implementation.
 *****************************************************************************/

/** 
 * Class ReportComponentIdRegistry 
 */
ReportComponentIdRegistry =
{
	types:
	{
		DOCUMENT : null,
		TABLE : null,
		LABEL : null,
		CHART : null,
		TABLE_T : null,
		LABEL_T : null,
		CHART_T : null
	},
	
	ids: {},
	
	getDocumentType : function( )
	{
		return 'DOCUMENT';
	},
	
	getTableType : function( )
	{
		return 'TABLE';
	},
	
	getLabelType : function( )
	{
		return 'LABEL';
	},
	
	getChartType : function( )
	{
		return 'CHART';
	},
	
	getTemplateTableType : function( )
	{
		return 'TABLE_T';
	},
	
	getTemplateLabelType : function( )
	{
		return 'LABEL_T';
	},
	
	getTemplateChartType : function( )
	{
		return 'CHART_T';
	},
	
	getTypeForId : function( id )
	{
		if ( this.ids[id] )
		{
			return this.ids[id];
		}
		return null;
	},

	setHandlerObjectForType : function( object, type )
	{
		for ( var i in this.types )
		{
			if ( i == type )
			{
				this.types[i] = object;
				return;
			}
		}
	},
	
	getObjectForId : function( id )
	{
		var type = this.getTypeForId( id );
		if ( type )
		{
			return this.types[type];
		}
		return null;
	},
	
	getObjectForType : function( type )
	{
		if ( type )
		{
			if ( type.toUpperCase( ) == 'Group'.toUpperCase( )
					|| type.toUpperCase( ) == 'ColumnInfo'.toUpperCase( ) )
			{
				return this.types['TABLE'];
			}
			else
			{
				return this.types[type.toUpperCase( )];
			}
		}
		
		return null;
		
	},

	addId : function( id, type )
	{
		this.ids[id] = type;
	},
	
	removeId : function( id )
	{
		if ( this.ids[id] )
		{
			this.ids[id] = null;
			delete this.ids[id];
		}
	}	
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -