}
private void setDocumentInput( IDocument document, IEntry entry )
{
LdifContentRecord record = ModelConverter.entryToLdifContentRecord( entry );
// sort attribute-value lines
AttributeComparator comparator = new AttributeComparator( entry );
LdifAttrValLine[] attrValLines = record.getAttrVals();
Arrays.sort( attrValLines, comparator );
LdifContentRecord newRecord = new LdifContentRecord( record.getDnLine() );
for ( LdifAttrValLine attrValLine : attrValLines )
{
newRecord.addAttrVal( attrValLine );
}
newRecord.finish( record.getSepLine() );
// format
String newContent = newRecord.toFormattedString( Utils.getLdifFormatParameters() );
// set content
document.set( newContent );
}