label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
}
}
else if ( element instanceof ObjectClassImpl )
{
ObjectClassImpl oc = ( ObjectClassImpl ) element;
// Label
if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
String[] names = oc.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
label = names[0];
}
else
{
label = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
String[] names = oc.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
else
{
label = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_OID )
{
label = oc.getOid();
}
else
// Default
{
String[] names = oc.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
label = names[0];
}
else
{
label = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
// Abbreviate
if ( abbreviate && ( abbreviateMaxLength < label.length() ) )
{
label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
}
}
// Secondary Label
if ( secondaryLabelDisplay )
{
String secondaryLabel = ""; //$NON-NLS-1$
if ( element instanceof AttributeTypeImpl )
{
AttributeTypeImpl at = ( AttributeTypeImpl ) element;
if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
String[] names = at.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
secondaryLabel = names[0];
}
else
{
secondaryLabel = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
String[] names = at.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_OID )
{
secondaryLabel = at.getOid();
}
}
else if ( element instanceof ObjectClassImpl )
{
ObjectClassImpl oc = ( ObjectClassImpl ) element;
if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_FIRST_NAME )
{
String[] names = oc.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
secondaryLabel = names[0];
}
else
{
secondaryLabel = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_ALL_ALIASES )
{
String[] names = oc.getNamesRef();
if ( ( names != null ) && ( names.length > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "SearchViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SEARCH_VIEW_LABEL_OID )
{
secondaryLabel = oc.getOid();
}
}
if ( secondaryLabelAbbreviate && ( secondaryLabelAbbreviateMaxLength < secondaryLabel.length() ) )
{