本文整理汇总了Java中org.eclipse.birt.report.model.api.ModuleHandle类的典型用法代码示例。如果您正苦于以下问题:Java ModuleHandle类的具体用法?Java ModuleHandle怎么用?Java ModuleHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleHandle类属于org.eclipse.birt.report.model.api包,在下文中一共展示了ModuleHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOdaDataSetHandle
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* create OdaDataSetHandle
*
* @param response
* @param parentHandle
* @return
* @throws OdaException
* @throws SemanticException
*/
public OdaDataSetHandle createOdaDataSetHandle(
DesignSessionResponse response, ModuleHandle parentHandle )
throws SemanticException
{
initDesignSessionFields( response );
OdaDataSetHandle dataSetHandle = null;
if ( isSessionOk( ) )
{
try
{
dataSetHandle = modelOdaAdapter.createDataSetHandle( response.getDataSetDesign( ),
parentHandle );
updateROMDesignerState( dataSetHandle );
}
catch ( SemanticException e )
{
throw e;
}
}
return dataSetHandle;
}
示例2: createComputedMeasureView
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public static ExtendedItemHandle createComputedMeasureView(
ModuleHandle module, String measureViewName )
throws SemanticException
{
if ( module == null )
return null;
ExtendedItemHandle extendedItem = module.getElementFactory( )
.newExtendedItem( measureViewName,
COMPUTED_MEASURE_VIEW_EXTENSION_NAME );
if ( extendedItem == null )
return null;
// prepare detail cell
ExtendedItemHandle cellHandle = createAggregationCell( module );
if ( cellHandle != null )
{
extendedItem.getPropertyHandle( IMeasureViewConstants.DETAIL_PROP )
.add( cellHandle );
}
return extendedItem;
}
示例3: getAvailableDataSetNames
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* Gets names of the available data sets and extended data sets
* @param module
* @return
*/
public static List<String> getAvailableDataSetNames( ModuleHandle module )
{
List<String> dataSets = new ArrayList<String>();
if( module == null )
{
return dataSets;
}
for ( Iterator iterator = module.getVisibleDataSets( ).iterator( ); iterator.hasNext( ); )
{
DataSetHandle dataSetHandle = (DataSetHandle) iterator.next( );
dataSets.add( dataSetHandle.getName( ) );
}
for (Iterator itr = new LinkedDataSetAdapter().getVisibleLinkedDataSets( ).iterator( ); itr.hasNext( );)
{
dataSets.add( (String) itr.next( ) );
}
return dataSets;
}
示例4: getMessageFile
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* Gets message file URL.
*
* @param moduleHandle
* module handle
* @param fileName
* file name
* @param location
* the location to search
* @return message file URL.
*/
private URL getMessageFile( ModuleHandle moduleHandle, String fileName,
int location )
{
if ( moduleHandle == null )
return null;
ULocale locale = moduleHandle.getModule( ).getSession( ).getLocale( );
List<String> possibleFiles = BundleHelper.getHelper( moduleHandle.getModule( ),
fileName )
.getMessageFilenames( locale );
for ( int i = 0; i < possibleFiles.size( ); i++ )
{
String filename = possibleFiles.get( i );
URL url = getResource( moduleHandle, filename, location );
if ( url != null )
return url;
}
return null;
}
示例5: notifySaveFile
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public void notifySaveFile( ModuleHandle owner )
{
if ( owner instanceof LibraryHandle )
{
IReportResourceSynchronizer synchronizer = ReportPlugin.getDefault( )
.getResourceSynchronizerService( );
if ( synchronizer != null )
{
synchronizer.notifyResourceChanged( new LibrarySaveChangeEvent( owner,
null,
IReportResourceChangeEvent.LibraySaveChange,
owner.getFileName( ) ) );
}
}
}
示例6: 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;
}
示例7: createIntPropertyDefn
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public static void createIntPropertyDefn( ModuleHandle module, String id,
String key ) throws UserPropertyException
{
UserPropertyDefnHandle property = module.getUserPropertyDefnHandle( id
+ BuilderConstants.PROPERTY_SEPARATOR
+ key );
if ( property != null
&& property.getType( ) != PropertyType.INTEGER_TYPE )
module.dropUserPropertyDefn( property.getName( ) );
UserPropertyDefn propertyDefn = new UserPropertyDefn( );
propertyDefn.setName( id + BuilderConstants.PROPERTY_SEPARATOR + key );
propertyDefn.setType( DEUtil.getMetaDataDictionary( )
.getPropertyType( PropertyType.INTEGER_TYPE ) );
propertyDefn.setVisible( false );
module.addUserPropertyDefn( propertyDefn );
}
示例8: setDesignFile
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
*
* set ReportDesignHandle properties.
*
* @param fileName
* @throws DesignFileException
* @throws SemanticException
* @throws IOException
*/
private void setDesignFile( String fileName ) throws DesignFileException,
SemanticException, IOException
{
ReportDesignHandle newHandle = SessionHandleAdapter.getInstance( )
.getSessionHandle( )
.openDesign( fileName );
if ( !page.getDisplayName( ).equals( "" ) ) //$NON-NLS-1$
newHandle.setDisplayName( page.getDisplayName( ) );
newHandle.setProperty( ModuleHandle.DESCRIPTION_PROP,
page.getDescription( ) );
if ( !page.getPreviewImagePath( ).equals( "" ) ) //$NON-NLS-1$
{
newHandle.setIconFile( page.getPreviewImagePath( ) );
newHandle.deleteThumbnail( );
}
// if ( !page.getCheetSheetPath( ).equals( "" ) ) //$NON-NLS-1$
// handle.setCheetSheet( page.getCheetSheetPath( ) );
newHandle.save( );
newHandle.close( );
}
示例9: isEnabled
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public boolean isEnabled( )
{
LibraryHandle library = getSelectedLibrary( );
ModuleHandle moduleHandle = SessionHandleAdapter.getInstance( )
.getReportDesignHandle( );
boolean enabled = library != null
&& moduleHandle != null
&& !moduleHandle.isInclude( library )
&& ( library.getFileName( ) != null && !library.getFileName( )
.equals( moduleHandle.getFileName( ) ) );
if ( enabled )
enabled = testRun( library );
if ( library != null )
library.close( );
return enabled;
}
示例10: rebuildReportDesign
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* Rebuild report design model.
*
* @param oldModel
*/
protected void rebuildReportDesign( ModuleHandle oldModel )
{
// Initializes command stack
WrapperCommandStack stack = (WrapperCommandStack) getCommandStack( );
if ( stack != null )
{
stack.removeCommandStackListener( getCommandStackListener( ) );
stack.setActivityStack( getModel( ).getCommandStack( ) );
stack.addCommandStackListener( getCommandStackListener( ) );
}
// Resets the mediator
SessionHandleAdapter.getInstance( ).resetReportDesign( oldModel,
getModel( ) );
SessionHandleAdapter.getInstance( ).setReportDesignHandle( getModel( ) );
UIUtil.processSessionResourceFolder( getEditorInput( ),
UIUtil.getProjectFromInput( getEditorInput( ) ),
getModel( ) );
}
示例11: test_regression_119220
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* @throws DesignFileException
*/
public void test_regression_119220( ) throws DesignFileException
{
openDesign( filename );
libraryHandle = designHandle.getLibrary( "Lib" ); //$NON-NLS-1$
assertNotNull( libraryHandle );
PropertyHandle libImages = libraryHandle
.getPropertyHandle( ModuleHandle.IMAGES_PROP );
ImageHandle imageHandle = (ImageHandle) designHandle
.findElement( "Image" ); //$NON-NLS-1$
assertNotNull( imageHandle );
assertEquals( "Lib.actuatetop.jpg", imageHandle.getImageName( ) ); //$NON-NLS-1$
assertEquals( "Lib.actuatetop.jpg", imageHandle //$NON-NLS-1$
.getProperty( IImageItemModel.IMAGE_NAME_PROP ) );
// make sure the embedded image refer to the library.
assertEquals( libImages.getAt( 0 ).getStructure( ), imageHandle
.getEmbeddedImage( ).getStructure( ) );
}
示例12: getCubes
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
/**
* Gets all the Cubes available.
*
* @return A String array contains all the Cubs.
*/
public static String[] getCubes( )
{
ArrayList list = new ArrayList( );
ModuleHandle handle = SessionHandleAdapter.getInstance( )
.getReportDesignHandle( );
for ( Iterator iterator = handle.getVisibleCubes( ).iterator( ); iterator.hasNext( ); )
{
CubeHandle CubeHandle = (CubeHandle) iterator.next( );
list.add( CubeHandle.getQualifiedName( ) );
}
list.addAll(getLinkedDataSetNames());
return (String[]) list.toArray( new String[0] );
}
示例13: gotoLibraryLayoutPage
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
protected void gotoLibraryLayoutPage( IMarker marker,
ReportElementHandle reportElementHandle )
{
String pageId = LibraryLayoutEditorFormPage.ID;
if ( activatePage( pageId ) == false )
{
return;
}
ModuleHandle moduleHandle = editorPart.getModel( );
reportElementHandle = getReportElementHandle( moduleHandle, marker );
if ( reportElementHandle != null
&& ( !isElementInMasterPage( reportElementHandle ) ) )
{
SetCurrentEditModelCommand command = new SetCurrentEditModelCommand( reportElementHandle );
command.execute( );
}
else
// can not find it in this editpage
{
MessageDialog.openError( UIUtil.getDefaultShell( ),
Messages.getString( "BIRTGotoMarker.Error.Title" ), //$NON-NLS-1$
Messages.getString( "BIRTGotoMarker.Error.Message" ) ); //$NON-NLS-1$
}
}
示例14: doSave
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public void doSave( IProgressMonitor progressMonitor )
{
super.doSave( progressMonitor );
IReportProvider provider = getProvider( );
if ( provider != null && getErrorLIine( false ) == -1 )
{
ModuleHandle model = provider.getReportModuleHandle( getEditorInput( ),
true );
SessionHandleAdapter.getInstance( ).setReportDesignHandle( model );
UIUtil.processSessionResourceFolder( getEditorInput( ),
UIUtil.getProjectFromInput( getEditorInput( ) ), model );
UIUtil.doFinishSave( model );
}
}
示例15: getImage
import org.eclipse.birt.report.model.api.ModuleHandle; //导入依赖的package包/类
public IImage getImage( String name )
{
ModuleHandle moduleHandle = getModuleHandle( );
EmbeddedImage embeddedImage = moduleHandle.findImage( name );
if ( embeddedImage != null )
{
Image image = new Image( embeddedImage.getData( moduleHandle
.getModule( ) ), name );
image.setReportRunnable( this );
return image;
}
return null;
}