當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceLocator類代碼示例

本文整理匯總了Java中org.eclipse.birt.report.model.api.IResourceLocator的典型用法代碼示例。如果您正苦於以下問題:Java IResourceLocator類的具體用法?Java IResourceLocator怎麽用?Java IResourceLocator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IResourceLocator類屬於org.eclipse.birt.report.model.api包,在下文中一共展示了IResourceLocator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAvailableResourceUrls

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
private URL[] getAvailableResourceUrls( )
{
	List<URL> urls = new ArrayList<URL>( );
	String[] baseNames = getBaseNames( );
	if ( baseNames == null )
		return urls.toArray( new URL[0] );
	else
	{
		for ( int i = 0; i < baseNames.length; i++ )
		{
			URL url = SessionHandleAdapter.getInstance( )
					.getReportDesignHandle( )
					.findResource( baseNames[i],
							IResourceLocator.MESSAGE_FILE );
			if ( url != null )
				urls.add( url );
		}
		return urls.toArray( new URL[0] );
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:CrosstabBindingDialogHelper.java

示例2: getResourceURLs

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
private URL[] getResourceURLs( )
{
	String[] baseNames = getBaseNames( );
	if ( baseNames == null )
		return null;
	else
	{
		URL[] urls = new URL[baseNames.length];
		for ( int i = 0; i < baseNames.length; i++ )
		{
			urls[i] = SessionHandleAdapter.getInstance( )
					.getReportDesignHandle( )
					.findResource( baseNames[i],
							IResourceLocator.MESSAGE_FILE );
		}
		return urls;
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:CrosstabBindingDialogHelper.java

示例3: getAvailableResourceUrls

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
private URL[] getAvailableResourceUrls( )
{
	List<URL> urls = new ArrayList<URL>( );
	String[] baseNames = getBaseNames( );
	if ( baseNames == null )
		return urls.toArray( new URL[0] );
	else
	{
		for ( int i = 0; i < baseNames.length; i++ )
		{
			URL url = getModuleHandle( ).findResource( baseNames[i],
					IResourceLocator.MESSAGE_FILE );
			if ( url != null )
				urls.add( url );
		}
		return urls.toArray( new URL[0] );
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:ChartCubeBindingDialogHelper.java

示例4: getResourceURLs

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
private URL[] getResourceURLs( )
{
	String[] baseNames = getBaseNames( );
	if ( baseNames == null )
		return null;
	else
	{
		URL[] urls = new URL[baseNames.length];
		for ( int i = 0; i < baseNames.length; i++ )
		{
			urls[i] = getModuleHandle( ).findResource( baseNames[i],
					IResourceLocator.MESSAGE_FILE );
		}
		return urls;
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:17,代碼來源:ChartCubeBindingDialogHelper.java

示例5: testResourceImage

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public void testResourceImage( )
{
	path = "file://" + this.genInputFolder( ) + separator + "resources"
			+ separator;
	// path="http://192.168.218.234:88/resource/";
	IResourceLocator locator = new EngineResourceLocator( path );
	try
	{
		renderReport( "resource_image", locator );
	}
	catch ( BirtException e )
	{
		e.printStackTrace( );
		fail( "Failed to find image resource from custom resource locator" );
	}
	File f = new File( this.genOutputFile( "resource_image.html" ) );
	assertTrue( "Failed render report from image resource", f.exists( ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:ResourceLocatorTest.java

示例6: testResourceProperties

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public void testResourceProperties( )
{
	path = "file://" + this.genInputFolder( ) + separator + "resources"
			+ separator;
	// path="http://192.168.218.234:88/resource/";
	IResourceLocator locator = new EngineResourceLocator( path );
	try
	{
		renderReport( "resource_properties", locator );
	}
	catch ( BirtException e )
	{
		e.printStackTrace( );
		fail( "Failed to find library resource from custom resource locator" );
	}
	File f = new File( this.genOutputFile( "resource_properties.html" ) );
	assertTrue( "Failed render report from properties resource", f.exists( ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:ResourceLocatorTest.java

示例7: testResourceLibrary

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public void testResourceLibrary( )
{
	path = "file://" + this.genInputFolder( ) + separator + "resources"
			+ separator;
	// path="http://192.168.218.234:88/resource/";
	IResourceLocator locator = new EngineResourceLocator( path );
	try
	{
		renderReport( "resource_library", locator );
	}
	catch ( BirtException e )
	{
		e.printStackTrace( );
		fail( "Failed to find properties resource from custom resource locator" );
	}

	File f = new File( this.genOutputFile( "resource_library.html" ) );
	assertTrue( "Failed render report from library", f.exists( ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:20,代碼來源:ResourceLocatorTest.java

示例8: testFindFile

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
/**
 * Tests the 'findFile' method of DefaultSearchFileAlgorithm.
 * 
 * @throws Exception
 *             if the test fails.
 */

public void testFindFile( ) throws Exception
{
	URL url = algorithm.findResource( designHandle,
			"1.xml", IResourceLocator.IMAGE ); //$NON-NLS-1$
	assertNull( url );

	url = algorithm.findResource( designHandle,
			INPUT, IResourceLocator.IMAGE ); //$NON-NLS-1$
	assertNotNull( url );

	designHandle.setStringProperty( ReportDesign.BASE_PROP,
			PLUGIN_PATH+ this.getFullQualifiedClassName( ) + GOLDEN_FOLDER );
	url = algorithm.findResource( designHandle,
			"1.xml", IResourceLocator.IMAGE ); //$NON-NLS-1$
	assertNull( url );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:24,代碼來源:DefaultSearchFileAlgorithmTest.java

示例9: test_regression_150687

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
/**
 * @throws SemanticException
 */
public void test_regression_150687( ) throws SemanticException
{
	DesignEngine engine = new DesignEngine( new DesignConfig( ) );
	SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH );
	ReportDesignHandle designHandle = session.createDesign( );

	ScriptLib lib1 = StructureFactory.createScriptLib( );
	lib1.setName( "test.jar" ); //$NON-NLS-1$

	designHandle.addScriptLib( lib1 );

	session.setResourceFolder( getTempFolder() + "/" + INPUT_FOLDER );
	URL url = session.getResourceLocator( ).findResource( designHandle,
			"test.jar", IResourceLocator.JAR_FILE ); //$NON-NLS-1$
	assertNotNull( url );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:20,代碼來源:Regression_150687.java

示例10: test_regression_146256

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public void test_regression_146256( ) throws Exception
{

	ResourceLocatorImpl rl = new ResourceLocatorImpl( );
	//String resource = "jar:file:" + this.getFullQualifiedClassName( ) + "/" + INPUT_FOLDER + "/" + "testRead.jar!/test/testRead.rptdesign"; //$NON-NLS-1$
	String resource = "jar:file:" + getTempFolder() + "/" + INPUT_FOLDER + "/" + "testRead.jar!/test/testRead.rptdesign"; //$NON-NLS-1$
	
	
	URL url = rl.findResource( null, resource, IResourceLocator.IMAGE );
	assertNotNull( url );

	URLConnection jarConnection = url.openConnection( );
	jarConnection.connect( );

	InputStream inputStream = jarConnection.getInputStream( );
	assertNotNull( inputStream );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:18,代碼來源:Regression_146256.java

示例11: test_regression_155509

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
/**
 * @throws DesignFileException
 */
public void test_regression_155509( ) throws DesignFileException
{
	openDesign( filename );
	rl = new ResourceLocatorImpl( );
	//sessionHandle.setResourceFolder( getClassFolder( ) );
	sessionHandle.setResourceFolder( getTempFolder( ) +"/"+INPUT_FOLDER);
	
	URL jarrsc = rl.findResource(
			designHandle,
			jarfile,
			IResourceLocator.JAR_FILE );
	assertNotNull( jarrsc );

	//sessionHandle.setResourceFolder( this.getFullQualifiedClassName( ) + "/" + INPUT_FOLDER + "/" );
	sessionHandle.setResourceFolder(  getTempFolder( ) +"/"+INPUT_FOLDER );

	URL messagersc = rl.findResource(
			designHandle,
			"Regression_155509",
			IResourceLocator.MESSAGE_FILE );
	assertNotNull( messagersc );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:Regression_155509.java

示例12: getDesignHandle

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public ReportDesignHandle getDesignHandle( String name, InputStream in )
		throws DesignFileException
{
	// Create new design session
	SessionHandle sessionHandle = new DesignEngine( new DesignConfig( ) )
			.newSessionHandle( ULocale.getDefault( ) );

	// get the resource locator form the options and set it to the session
	// handle
	IResourceLocator locator = (IResourceLocator) options
			.get( ModuleOption.RESOURCE_LOCATOR_KEY );
	if ( locator != null )
	{
		sessionHandle.setResourceLocator( locator );
	}

	// Obtain design handle
	ReportDesignHandle designHandle = null;
	ModuleOption modOptions = new ModuleOption( options );
	if ( in != null )
		designHandle = sessionHandle.openDesign( name, in, modOptions );
	else
		designHandle = sessionHandle.openDesign( name, modOptions );

	return designHandle;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:ReportParser.java

示例13: getImageUrl

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
protected String getImageUrl( String imageUri )
{
	String imageUrl = imageUri;
	ReportDesignHandle reportDesign = context.getReport( ).getDesign( )
			.getReportDesign( );
	if ( reportDesign != null )
	{
		URL url = reportDesign.findResource( imageUri,
				IResourceLocator.IMAGE, context.getReport( )
						.getReportContext( ) == null ? null : context
						.getReport( ).getReportContext( ).getAppContext( ) );
		if ( url != null )
		{
			imageUrl = url.toExternalForm( );
		}
	}
	return imageUrl;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:ContainerArea.java

示例14: processBackgroundImage

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的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

示例15: handleStyleImage

import org.eclipse.birt.report.model.api.IResourceLocator; //導入依賴的package包/類
public String handleStyleImage( String uri, Map appContext )
{
	if ( uri != null )
	{
		if ( FileUtil.isLocalResource( uri ) )
		{
			URL url = handle.findResource( uri, IResourceLocator.IMAGE,
					appContext );
			if ( url != null )
			{
				uri = url.toString( );
			}
		}
		imageSrc.add( uri );
	}
	return uri;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:18,代碼來源:BasicComponent.java


注:本文中的org.eclipse.birt.report.model.api.IResourceLocator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。