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


Java ModuleHandle.getFileName方法代码示例

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


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

示例1: run

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public void run( )
{

	if ( isEnable( ) == false )
	{
		return;
	}

	ModuleHandle module = SessionHandleAdapter.getInstance( )
			.getReportDesignHandle( );

	String filePath = module.getFileName( );
	String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );

	PublishLibraryWizard publishLibrary = new PublishLibraryWizard( (LibraryHandle) module,
			fileName,
			ReportPlugin.getDefault( ).getResourceFolder( ) );

	WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
			publishLibrary );

	dialog.setPageSize( 500, 250 );
	dialog.open( );

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

示例2: run

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public void run( IAction action )
{
	ModuleHandle handle = null;

	if (handle == null )
	{
		FormEditor editor = UIUtil.getActiveReportEditor( false );
		if (editor instanceof MultiPageReportEditor)
		{
			handle = ((MultiPageReportEditor)editor).getModel( );
		}
	}
	if (handle != null)
	{
		String fileName = handle.getFileName( );
		
		ILaunchConfiguration config = ScriptLaunchShortcut.findLaunchConfiguration( fileName, ScriptLaunchShortcut.getConfigurationType( ) );
		if (config != null) {
			DebugUITools.launch(config, "debug");//$NON-NLS-1$
		}	
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:DebugScriptAction.java

示例3: getSystemId

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public String getSystemId( )
{
	ModuleHandle mod = eih.getRoot( );
	if ( mod != null )
	{
		return mod.getFileName( );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:10,代码来源:BIRTActionRenderer.java

示例4: getDefaultFileName

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
private String getDefaultFileName( )
{
	ModuleHandle handle = SessionHandleAdapter.getInstance( )
			.getReportDesignHandle( );
	if ( handle != null )
	{
		return handle.getFileName( );
	}
	return ""; //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:ScriptMainTab.java

示例5: getNodeDisplayName

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Gets the node display name of the given model
 * 
 * @param model
 *            the model
 * @return the display name
 */
public String getNodeDisplayName(Object model) {
	ModuleHandle handle = (ModuleHandle) model;
	Object obj = handle.getProperty(ModuleHandle.TITLE_PROP);
	if (obj != null && obj instanceof String) {
		return (String) obj;
	} else if (handle.getFileName() != null) {
		return handle.getFileName().substring(
				handle.getFileName().lastIndexOf(File.separator) + 1);
	}
	return super.getNodeDisplayName(model);
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ReportDesignNodeProvider.java

示例6: getReportName

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public String getReportName( )
{
	ModuleHandle moduleHandle = getModuleHandle( );
	return moduleHandle.getFileName( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:6,代码来源:DesignRunnable.java

示例7: getParamValue

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
/**
 * Get the parameter value from .rptconfig file if it does exist
 * 
 * @return the parameter value
 */
public static String getParamValue( DataSetHandle dataSetHandle,
		OdaDataSetParameterHandle paramDefn ) throws DesignFileException
{
	ModuleHandle moduleHandle = dataSetHandle.getModuleHandle( );
	String designFileName = moduleHandle.getFileName( );
	// replace the file extension
	String reportConfigName = designFileName.substring( 0,
			designFileName.length( ) - "rptdesign".length( ) ) //$NON-NLS-1$
			+ "rptconfig"; //$NON-NLS-1$
	File file = new File( reportConfigName );
	if ( file.exists( ) )
	{
		String paraName = paramDefn.getParamName( );
		ScalarParameterHandle parameterHandle = (ScalarParameterHandle) moduleHandle.findParameter( paraName );
		paraName = paraName + "_" + parameterHandle.getID( ); //$NON-NLS-1$
		SessionHandle sessionHandle = new DesignEngine( null ).newSessionHandle( ULocale.US );
		ReportDesignHandle rdHandle = null;
		// Open report config file
		rdHandle = sessionHandle.openDesign( reportConfigName );

		// handle config vars
		if ( rdHandle != null )
		{
			Iterator configVars = rdHandle.configVariablesIterator( );
			while ( configVars != null && configVars.hasNext( ) )
			{
				ConfigVariableHandle configVar = (ConfigVariableHandle) configVars.next( );
				if ( configVar != null )
				{
					String varName = prepareConfigVarName( configVar.getName( ) );
					Object varValue = configVar.getValue( );
					if ( varName == null || varValue == null )
					{
						continue;
					}
					if ( varName.equals( paraName ) )
					{
						String value = (String) varValue;
						// if the value actually is in String type, convert
						// it by adding quotation marks
						if ( isToBeConverted( parameterHandle.getDataType( ) ) )
						{
							value = "\"" + JavascriptEvalUtil.transformToJsConstants( value ) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
						}
						return value;
					}
					if ( isNullValue( varName, (String) varValue, paraName ) )
					{
						return null;
					}
				}
			}
		}
	}
	return ExpressionUtil.createJSParameterExpression( ( (OdaDataSetParameterHandle) paramDefn ).getParamName( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:62,代码来源:DataUtil.java

示例8: run

import org.eclipse.birt.report.model.api.ModuleHandle; //导入方法依赖的package包/类
public void run( IAction action )
{
	IFile file = getSelectedFile( );
	if ( file == null )
	{
		return;
	}

	String url = file.getLocation( ).toOSString( );
	ModuleHandle handle = null;
	try
	{
		handle = SessionHandleAdapter.getInstance( )
				.getSessionHandle( )
				.openLibrary( url );

		if ( handle == null )
		{
			action.setEnabled( false );
			return;
		}

		String filePath = handle.getFileName( );
		String fileName = null;
		if ( filePath != null && filePath.length( ) != 0 )
		{
			fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );
		}

		PublishLibraryWizard publishLibrary = new PublishLibraryWizard( (LibraryHandle) handle,
				fileName,
				ReportPlugin.getDefault( ).getResourceFolder( ) );

		WizardDialog dialog = new BaseWizardDialog( UIUtil.getDefaultShell( ),
				publishLibrary );

		dialog.setPageSize( 500, 250 );
		dialog.open( );
	}
	catch ( Exception e )
	{
		ExceptionUtil.handle( e );
		return;
	}
	finally
	{
		if ( handle != null )
		{
			handle.close( );
		}
	}

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


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