IAttribute[] attributes = ( IAttribute[] ) attributeMap.values().toArray(
new IAttribute[attributeMap.size()] );
if ( attributes.length > 0 )
{
AttributeComparator comparator = new AttributeComparator( entries[0].getConnection() );
Arrays.sort( attributes, comparator );
}
returningAttributes = new String[attributes.length];
for ( int i = 0; i < attributes.length; i++ )
{
returningAttributes[i] = attributes[i].getDescription();
}
}
// header
if ( this.mode != MODE_TABLE
|| BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
{
text.append( quoteCharacter );
text.append( "DN" );
text.append( quoteCharacter );
text.append( attributeDelimiter );
}
for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
{
text.append( quoteCharacter );
text.append( returningAttributes[a] );
text.append( quoteCharacter );
if ( a + 1 < returningAttributes.length )
{
text.append( attributeDelimiter );
}
}
text.append( lineSeparator );
for ( int e = 0; entries != null && e < entries.length; e++ )
{
if ( this.mode != MODE_TABLE
|| BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) )
{
text.append( quoteCharacter );
text.append( entries[e].getDn().toString() );
text.append( quoteCharacter );
text.append( attributeDelimiter );
}
for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
{
AttributeComparator comparator = new AttributeComparator( entries[e] );
AttributeHierarchy ah = entries[e].getAttributeWithSubtypes( returningAttributes[a] );
if ( ah != null )
{
StringBuffer valueSB = new StringBuffer();