TOCNode rootTocNode = ( (IReportDocument) handle ).findTOC( null );
String format = "html"; for ( int i = 0; i < supportedFormats.length; i++ ) { if ( ( (Button) formatCheckBtns.get( supportedFormats[i] ) ).getSelection( ) ) { format = supportedFormats[i]; break; } } ITOCTree tocTree = ( (IReportDocument) handle ).getTOCTree( format, SessionHandleAdapter.getInstance( ) .getSessionHandle( ) .getULocale( ) ); TOCNode rootTocNode = tocTree.getRoot( );
	private void initAnchorChooser( Object handle, boolean isToc )	{		anchorChooser.removeAll( );		if ( handle instanceof ReportDesignHandle )		{			if ( isToc )			{				anchorChooser.setItems( (String[]) ( (ReportDesignHandle) handle ).getAllTocs( )						.toArray( new String[0] ) );			}			else			{				anchorChooser.setItems( (String[]) ( (ReportDesignHandle) handle ).getAllBookmarks( )						.toArray( new String[0] ) );			}		}		else if ( handle instanceof IReportDocument )		{			if ( isToc )			{				TOCNode rootTocNode = ( (IReportDocument) handle ).findTOC( null );				anchorChooser.setItems( (String[]) getAllTocDisplayString( rootTocNode ).toArray( new String[0] ) );			}			else			{				anchorChooser.setItems( getDocumentBookmarks( (IReportDocument) handle ) );			}		}		bookmarkEditor.setText( "" ); //$NON-NLS-1$		String bookmark = inputHandle.getTargetBookmark( );		String[] chooserValues = anchorChooser.getItems( );		if ( bookmark != null && chooserValues != null )		{			for ( int i = 0; i < chooserValues.length; i++ )			{				if ( bookmark.equals( chooserValues[i] ) )				{					anchorChooser.select( i );					bookmarkEditor.setText( anchorChooser.getText( ) );				}			}		}		anchorChooser.setEnabled( anchorChooser.getItemCount( ) > 0 );	}