IncludedLibrary includeLibrary = StructureFactory .createIncludeLibrary( ); includeLibrary.setFileName( libraryFileName ); includeLibrary.setNamespace( namespace );  ElementPropertyDefn propDefn = module .getPropertyDefn( Module.LIBRARIES_PROP ); PropertyCommand propCommand = new PropertyCommand( module, module ); propCommand.addItem( new CachedMemberRef( propDefn ), includeLibrary );
if ( module.findIncludedLibrary( namespace ) == null ) addLibraryStructure( libraryFileName, namespace );
	private void doAddLibrary( String libraryFileName, String namespace,			int action, Map overriddenValues ) throws SemanticException,			DesignFileException	{		Library library = module.loadLibrary( libraryFileName, namespace );		library.setReadOnly( );		ActivityStack activityStack = getActivityStack( );		activityStack.startTrans( );		LibraryRecord record = null;		if ( action == SIMPLE_ACTION )			record = new LibraryRecord( module, library, true );		if ( action == RELOAD_ACTION )			record = new LibraryRecord( module, library, overriddenValues );		getActivityStack( ).execute( record );		// Add includedLibraries		IncludedLibrary includeLibrary = StructureFactory				.createIncludeLibrary( );		includeLibrary.setFileName( libraryFileName );		includeLibrary.setNamespace( namespace );		ElementPropertyDefn propDefn = module				.getPropertyDefn( Module.LIBRARIES_PROP );		PropertyCommand propCommand = new PropertyCommand( module, module );		propCommand.addItem( new CachedMemberRef( propDefn ), includeLibrary );		activityStack.commit( );	}