当前位置: 首页>>代码示例>>Java>>正文


Java ModuleHandle.getErrorList方法代码示例

本文整理汇总了Java中org.eclipse.birt.report.model.api.ModuleHandle.getErrorList方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleHandle.getErrorList方法的具体用法?Java ModuleHandle.getErrorList怎么用?Java ModuleHandle.getErrorList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.birt.report.model.api.ModuleHandle的用法示例。


在下文中一共展示了ModuleHandle.getErrorList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getErrorLineFromModuleHandle

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
private int getErrorLineFromModuleHandle( ModuleHandle handle )
{
	handle.checkReport( );
	List list = handle.getErrorList( );
	if ( list != null )
		for ( int i = 0, m = list.size( ); i < m; i++ )
		{
			Object obj = list.get( i );
			if ( obj instanceof ErrorDetail )
			{
				ErrorDetail errorDetail = (ErrorDetail) list.get( i );
				this.errorDetail = errorDetail;
				return errorDetail.getLineNo( );
			}
		}
	return 0;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ReportXMLSourceEditorFormPage.java

示例2: canPreviewWithErrors

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public static boolean canPreviewWithErrors( ModuleHandle model )
{
	if ( model == null )
	{
		return false;
	}
	model.checkReport( );
	List<?> errorList = model.getErrorList( );
	if ( errorList.size( ) > 0 )
	{
		ErrorStatus status = new ErrorStatus( ReportPlugin.REPORT_UI,
				1009,
				Messages.getString( "UIUtil.previewconfirm.title" ), //$NON-NLS-1$
				null );

		for ( int i = 0; i < errorList.size( ); i++ )
		{
			ErrorDetail ed = (ErrorDetail) errorList.get( i );

			status.addError( "Line " //$NON-NLS-1$
					+ ed.getLineNo( )
					+ ": " //$NON-NLS-1$
					+ ed.getMessage( ) );
		}

		return new ErrorDialog( Display.getCurrent( ).getActiveShell( ),
				Messages.getString( "UIUtil.previewconfirm.title" ), //$NON-NLS-1$
				Messages.getString( "UIUtil.previewconfirm.message" ), //$NON-NLS-1$
				status,
				IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR ) {

			protected void createButtonsForButtonBar( Composite parent )
			{
				createButton( parent,
						IDialogConstants.OK_ID,
						IDialogConstants.OK_LABEL,
						true );
				createButton( parent,
						IDialogConstants.CANCEL_ID,
						IDialogConstants.CANCEL_LABEL,
						false );
				createDetailsButton( parent );
			};
		}.open( ) == Window.OK;
	}
	return true;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:48,代码来源:UIUtil.java

示例3: refreshMarkers

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Deletes existed problem markers and adds new markers
 * 
 * @throws CoreException
 */
public void refreshMarkers( IEditorInput input ) throws CoreException
{
	IResource file = getFile( input );
	if ( file != null )
	{
		// Deletes existed markers
		file.deleteMarkers( ProblemMarkID, true, IResource.DEPTH_INFINITE );

		// Adds markers
		ModuleHandle reportDesignHandle = getModel( );
		if ( reportDesignHandle == null )
		{
			return;
		}

		// Model said that should checkReport( ) before getting error and
		// warning list.
		reportDesignHandle.checkReportIfNecessary( );
		List list = reportDesignHandle.getErrorList( );
		int errorListSize = list.size( );
		list.addAll( reportDesignHandle.getWarningList( ) );

		for ( int i = 0, m = list.size( ); i < m; i++ )
		{
			ErrorDetail errorDetail = (ErrorDetail) list.get( i );
			IMarker marker = file.createMarker( ProblemMarkID );

			Map<String, Object> attrib = new HashMap<String, Object>( );

			// The first part is from error list, the other is from warning
			// list
			if ( i < errorListSize )
			{
				attrib.put( IMarker.SEVERITY, IMarker.SEVERITY_ERROR );
			}
			else
			{
				attrib.put( IMarker.SEVERITY, IMarker.SEVERITY_WARNING );
			}

			attrib.put( IMarker.MESSAGE, errorDetail.getMessage( ) );
			attrib.put( IMarker.LINE_NUMBER, errorDetail.getLineNo( ) );
			attrib.put( IMarker.LOCATION, errorDetail.getTagName( ) );

			if ( errorDetail.getElement( ) != null
					&& errorDetail.getElement( ).getID( ) != 0 )
			{
				attrib.put( ELEMENT_ID,
						Integer.valueOf( (int) errorDetail.getElement( )
								.getID( ) ) );
			}

			// set all attributes together to reduce notification events
			marker.setAttributes( attrib );
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:63,代码来源:IDEMultiPageReportEditor.java


注:本文中的org.eclipse.birt.report.model.api.ModuleHandle.getErrorList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。