*/
public String getText( Object obj )
{
if ( obj instanceof IEntry )
{
IEntry entry = ( IEntry ) obj;
StringBuffer append = new StringBuffer();
if ( entry instanceof IRootDSE )
{
append.append( "Root DSE" );
}
if ( entry.isChildrenInitialized() && ( entry.getChildrenCount() > 0 ) || entry.getChildrenFilter() != null )
{
append.append( " (" ).append( entry.getChildrenCount() );
if ( entry.hasMoreChildren() )
{
append.append( "+" );
}
if ( entry.getChildrenFilter() != null )
{
append.append( ", filtered" );
}
append.append( ")" );
}
if ( entry instanceof ReferralBaseEntry )
{
return entry.getUrl().toString() + " " + append.toString();
}
else if ( entry instanceof AliasBaseEntry )
{
return entry.getDn().toString() + " " + append.toString();
}
else if ( entry instanceof BaseDNEntry )
{
return entry.getDn().toString() + " " + append.toString();
}
else if ( entry.hasParententry() )
{
String label = "";
if ( preferences.getEntryLabel() == BrowserCommonConstants.SHOW_DN )
{
label = entry.getDn().toString();
}
else if ( preferences.getEntryLabel() == BrowserCommonConstants.SHOW_RDN )
{
label = entry.getRdn().toString();
}
else if ( preferences.getEntryLabel() == BrowserCommonConstants.SHOW_RDN_VALUE )
{
label = entry.getRdn().getValue();
}
label += append.toString();
if ( preferences.isEntryAbbreviate() && label.length() > preferences.getEntryAbbreviateMaxLength() )
{
label = Utils.shorten( label, preferences.getEntryAbbreviateMaxLength() );
}
return label;
}
else
{
return entry.getDn() + append.toString();
}
}
else if ( obj instanceof BrowserEntryPage )
{
BrowserEntryPage container = ( BrowserEntryPage ) obj;