}
else if ( element instanceof ObjectClassDifference )
{
ObjectClassDifference ocd = ( ObjectClassDifference ) element;
ObjectClass oc = null;
switch ( ocd.getType() )
{
case ADDED:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
case MODIFIED:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
case REMOVED:
oc = ( ( ObjectClass ) ocd.getSource() );
break;
case IDENTICAL:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
}
// Label
if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
label = names.get( 0 );
}
else
{
label = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
label = ViewUtils.concateAliases( names );
}
else
{
label = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( labelValue == PluginConstants.PREFS_SCHEMA_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( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
// Abbreviate
if ( abbreviate && ( abbreviateMaxLength < label.length() ) )
{
label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
}
}
else if ( element instanceof Folder )
{
Folder folder = ( Folder ) element;
return folder.getName() + " (" + folder.getChildren().size() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
// Secondary Label
if ( secondaryLabelDisplay )
{
String secondaryLabel = ""; //$NON-NLS-1$
if ( element instanceof AttributeTypeDifference )
{
AttributeTypeDifference atd = ( AttributeTypeDifference ) element;
AttributeType at = null;
switch ( atd.getType() )
{
case ADDED:
at = ( ( AttributeType ) atd.getDestination() );
break;
case MODIFIED:
at = ( ( AttributeType ) atd.getDestination() );
break;
case REMOVED:
at = ( ( AttributeType ) atd.getSource() );
break;
case IDENTICAL:
at = ( ( AttributeType ) atd.getDestination() );
break;
}
if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
List<String> names = at.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = names.get( 0 );
}
else
{
secondaryLabel = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = at.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_OID )
{
secondaryLabel = at.getOid();
}
}
else if ( element instanceof ObjectClassDifference )
{
ObjectClassDifference ocd = ( ObjectClassDifference ) element;
ObjectClass oc = null;
switch ( ocd.getType() )
{
case ADDED:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
case MODIFIED:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
case REMOVED:
oc = ( ( ObjectClass ) ocd.getSource() );
break;
case IDENTICAL:
oc = ( ( ObjectClass ) ocd.getDestination() );
break;
}
if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = names.get( 0 );
}
else
{
secondaryLabel = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
{
List<String> names = oc.getNames();
if ( ( names != null ) && ( names.size() > 0 ) )
{
secondaryLabel = ViewUtils.concateAliases( names );
}
else
{
secondaryLabel = Messages.getString( "DifferencesWidgetSchemaLabelProvider.None" ); //$NON-NLS-1$
}
}
else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_OID )
{
secondaryLabel = oc.getOid();
}
}
if ( secondaryLabelAbbreviate && ( secondaryLabelAbbreviateMaxLength < secondaryLabel.length() ) )
{