label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
}
}
else if ( obj instanceof ObjectClassWrapper )
{
ObjectClass oc = ( ( ObjectClassWrapper ) obj ).getObjectClass();
// Label
if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
label = names.get( 0 );
}
else
{
label = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
else
{
label = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
{
label = oc.getOid();
}
else
// Default
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
label = names.get( 0 );
}
else
{
label = Messages.getString( "HierarchyViewLabelProvider.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 ( obj instanceof AttributeTypeWrapper )
{
AttributeType at = ( ( AttributeTypeWrapper ) obj ).getAttributeType();
if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
{
List<String> names = at.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = names.get( 0 );
}
else
{
secondaryLabel = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = at.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
{
secondaryLabel = at.getOid();
}
}
else if ( obj instanceof ObjectClassWrapper )
{
ObjectClass oc = ( ( ObjectClassWrapper ) obj ).getObjectClass();
if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = names.get( 0 );
}
else
{
secondaryLabel = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "HierarchyViewLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
{
secondaryLabel = oc.getOid();
}
}
if ( secondaryLabelAbbreviate && ( secondaryLabelAbbreviateMaxLength < secondaryLabel.length() ) )
{