XNameContainer xNameContainer = xCustPresSupplier.getCustomPresentations();
XSingleServiceFactory xFactory = (XSingleServiceFactory)
UnoRuntime.queryInterface( XSingleServiceFactory.class, xNameContainer );
Object xObj;
XIndexContainer xContainer;
/* instanciate an IndexContainer that will take
a list of draw pages for the first custom show */
xObj = xFactory.createInstance();
xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
for ( i = 5; i < 10; i++ )
xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
xNameContainer.insertByName( "ShortVersion", xContainer );
/* instanciate an IndexContainer that will take
a list of draw page for the second custom show */
xObj = xFactory.createInstance();
xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
for ( i = 1; i < 10; i++ )
xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
xNameContainer.insertByName( "LongVersion", xContainer );
/* which custom show is to use
can been set in the presentation settings */