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


Java ModuleHandle.findResource方法代码示例

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


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

示例1: processBackgroundImage

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Checks the background image property. If it is given as a relative path,
 * gets its absolute path and sets it back to the style.
 * 
 * @param style
 *            the style that defines background image related properties
 */
protected void processBackgroundImage( IStyle style )
{
	if ( style == null )
		return;

	String image = style.getBackgroundImage( );
	if ( image == null )
		return;

	ModuleHandle reportDesign = context.getDesign( );
	if ( reportDesign != null )
	{
		URL url = reportDesign.findResource( image, IResourceLocator.IMAGE,
				context.getAppContext( ) );
		if ( url != null )
		{
			style.setBackgroundImage( url.toExternalForm( ) );
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:LocalizedContentVisitor.java

示例2: generateURL

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public URL generateURL( ModuleHandle designHandle, String uri )
		throws MalformedURLException
{
	try
	{
		return new URL( uri );
	}
	catch ( MalformedURLException e )
	{
		String path = URIUtil.getLocalPath( uri );

		if ( designHandle == null )
		{
			designHandle = SessionHandleAdapter.getInstance( )
					.getReportDesignHandle( );
		}

		if ( path != null && designHandle != null )
		{
			// add by gao for lib
			return designHandle.findResource( path, IResourceLocator.IMAGE );
		}
		return URI.create( uri ).toURL( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:ImageManager.java

示例3: getNodeTooltip

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public String getNodeTooltip( Object model )
{
	if ( model instanceof CssStyleSheetHandle )
	{
		CssStyleSheetHandle cssStyleSheetHandle = (CssStyleSheetHandle) model;
		ModuleHandle moudleHandle = cssStyleSheetHandle.getModule( )
				.getModuleHandle( );
		URL url = moudleHandle.findResource( cssStyleSheetHandle.getFileName( ),
				IResourceLocator.CASCADING_STYLE_SHEET );

		if ( url != null && url.getFile( ) != null )
		{
			return url.getFile( );
		}

	}

	return super.getNodeTooltip( model );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:CssStyleSheetNodeProvider.java

示例4: buildHyperlink

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Build URI
 * 
 * @param action
 * @param context
 * @return
 */
private String buildHyperlink( IAction action, IReportContext context )
{
	IReportRunnable runnable = context.getReportRunnable( );
	String actionURL = action.getActionString( );
	if ( runnable != null )
	{
		ModuleHandle moduleHandle = runnable.getDesignHandle( )
				.getModuleHandle( );
		URL url = moduleHandle.findResource( actionURL, -1 );
		if ( url != null )
			actionURL = url.toString( );
	}

	return actionURL;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ViewerHTMLActionHandler.java

示例5: findResource

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * 
 * @param fileName
 * @param fileType
 * @param appContext
 * @return
 */
public byte[] findResource( ModuleHandle design, String fileName,
		int fileType, Map appContext )
{
	URL url = design.findResource( fileName, fileType, appContext );
	if ( url == null )
	{
		logger.log( Level.WARNING,
				MessageConstants.RESOURCE_NOT_ACCESSIBLE, fileName );
		return DUMMY_BYTES;
	}
	return findResource( url );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ResourceLocatorWrapper.java

示例6: loadResourceFolderScriptLibs

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
private static void loadResourceFolderScriptLibs( ModuleHandle handle,
		List<URL> urls )
{
	Iterator it = handle.scriptLibsIterator( );
	while ( it.hasNext( ) )
	{
		ScriptLibHandle libHandle = (ScriptLibHandle) it.next( );
		URL url = handle.findResource( libHandle.getName( ),
				IResourceLocator.LIBRARY );
		if ( url != null )
			urls.add( url );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:DataSetProvider.java

示例7: createDesignClassLoader

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * create the class loader used by the design.
 * 
 * the method should be synchronized as the class loader of a document may
 * be used by multiple tasks.
 */
protected synchronized void createDesignClassLoader( )
{
	if (designClassLoader != null)
	{
		return;
	}
	ArrayList<URL> urls = new ArrayList<URL>( );
	if ( runnable != null )
	{
		ModuleHandle module = (ModuleHandle) runnable.getDesignHandle( );
		Iterator iter = module.scriptLibsIterator( );
		while ( iter.hasNext( ) )
		{
			ScriptLibHandle lib = (ScriptLibHandle) iter.next( );
			String libPath = lib.getName( );
			if ( libPath == null )
			{
				continue;
			}
			URL url = module.findResource( libPath,
					IResourceLocator.LIBRARY, appContext );
			if ( url != null )
			{
				urls.add( url );
			}
			else
			{
				logger.log( Level.SEVERE,
						"Can not find specified jar: " + libPath ); //$NON-NLS-1$
			}
		}
	}
	final URL[] jarUrls = urls.toArray( new URL[]{} );
	if ( engine != null )
	{
		designClassLoader = AccessController.doPrivileged( new PrivilegedAction<URLClassLoader>( ) {

			@Override
			public URLClassLoader run( )
			{
				return new URLClassLoader( jarUrls,
						engine.getEngineClassLoader( ) );
			}
		} );
	}
	else
	{
		designClassLoader = AccessController.doPrivileged( new PrivilegedAction<URLClassLoader>( ) {

			@Override
			public URLClassLoader run( )
			{
				return new URLClassLoader( jarUrls );
			}
		} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:64,代码来源:ApplicationClassLoader.java

示例8: getSelectedFiles

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Returns the current selected file.
 * 
 * @return the current selected file.
 * @throws IOException
 *             if an I/O error occurs.
 */
protected Collection<File> getSelectedFiles( ) throws IOException
{
	Collection<?> currentResource = getSelectedResources( );
	Collection<File> files = new HashSet<File>( );

	if ( currentResource == null )
	{
		return files;
	}

	for ( Object resource : currentResource )
	{
		File file = null;

		if ( resource instanceof LibraryHandle )
		{
			file = new File( ( (LibraryHandle) resource ).getFileName( ) );
		}
		else if ( resource instanceof CssStyleSheetHandle )
		{
			CssStyleSheetHandle node = (CssStyleSheetHandle) resource;
			ModuleHandle module = SessionHandleAdapter.getInstance( )
					.getReportDesignHandle( );

			URL url = module.findResource( node.getFileName( ),
					IResourceLocator.CASCADING_STYLE_SHEET );

			file = convertToFile( url );
		}
		else if ( resource instanceof ResourceEntry )
		{
			file = convertToFile( ( (ResourceEntry) resource ).getURL( ) );
		}

		if ( file != null && file.exists( ) )
		{
			files.add( file );
		}
	}
	return files;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:49,代码来源:ResourceAction.java


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