popReportItem( );
		public Object visitExtendedItem( ExtendedItemDesign item, Object value )		{			// create user-defined generation-time helper object			ExtendedItemHandle handle = (ExtendedItemHandle) item.getHandle( );			String tagName = handle.getExtensionName( );			// TODO: check in plugin registry whetherthe needQuery property is			// set to host or item.			// Only do the following for "host"			IReportItemQuery itemQuery = ExtensionManager.getInstance( )					.createQueryItem( tagName );			IBaseQueryDefinition[] queries = null;			IBaseQueryDefinition parentQuery = getParentQuery( );			IBaseTransform parentTrans = getTransform( );			if ( itemQuery != null )			{				try				{					itemQuery.setModelObject( handle );					queries = itemQuery.getReportQueries( parentQuery );				}				catch ( BirtException ex )				{					logger.log( Level.WARNING, ex.getMessage( ), ex );				}				if ( queries != null )				{					item.setQueries( queries );					for ( int i = 0; i < queries.length; i++ )					{						// only a regular query need add to list						if ( queries[i] != null )						{							if ( queries[i] instanceof IQueryDefinition )							{								this.queryIDs.put( queries[i], String										.valueOf( item.getID( ) )										+ "_" + String.valueOf( i ) );								this.queries.add( queries[i] );								// to support parameter binding with data								// related expression in report query								Collection bindings = ( (IQueryDefinition) queries[i] )										.getInputParamBindings( );								if ( bindings.size( ) > 0 )								{									if ( parentTrans != null )									{										Iterator iter = bindings.iterator( );										while ( iter.hasNext( ) )										{											IInputParameterBinding binding = (IInputParameterBinding) iter													.next( );											parentTrans.getRowExpressions( )													.add( binding.getExpr( ) );										}									}								}							}							else if ( queries[i] instanceof ISubqueryDefinition )							{								// TODO: chart engine make a mistake here								if ( parentTrans != null )								{									parentTrans.getSubqueries( ).add(											queries[i] );								}							}							registerQueryAndElement( queries[i], item );						}					}					if ( queries.length > 0 )					{						IBaseQueryDefinition query = queries[0];						if ( query != null )						{							item.setQuery( query );							pushQuery( query );							pushExpressions( query.getRowExpressions( ) );							handleReportItemExpressions( item );							// handleActionExpressions(item.getAction());							popExpressions( );							popQuery( );						}					}				}			}			return value;		}