orderingMatchingRuleText.setLayoutData( orderingMatchingRuleTextGridData );
IAttribute attribute = getAttribute( getElement() );
if ( attribute != null )
{
Schema schema = attribute.getEntry().getBrowserConnection().getSchema();
int bytes = 0;
int valCount = 0;
IValue[] allValues = attribute.getValues();
for ( int valIndex = 0; valIndex < allValues.length; valIndex++ )
{
if ( !allValues[valIndex].isEmpty() )
{
valCount++;
bytes += allValues[valIndex].getBinaryValue().length;
}
}
this.setMessage( NLS.bind(
Messages.getString( "AttributePropertyPage.Attribute" ), new String[] { attribute.getDescription() } ) ); //$NON-NLS-1$
attributeNameText.setText( attribute.getDescription() );
attributeTypeText.setText( attribute.isString() ? "String" : "Binary" ); //$NON-NLS-1$ //$NON-NLS-2$
attributeValuesText.setText( "" + valCount ); //$NON-NLS-1$
attributeSizeText.setText( Utils.formatBytes( bytes ) );
if ( schema.hasAttributeTypeDescription( attribute.getDescription() ) )
{
AttributeTypeDescription atd = schema.getAttributeTypeDescription( attribute.getDescription() );
atdOidText.setText( atd.getNumericOid() );
String atdNames = atd.getNames().toString();
atdNamesText.setText( atdNames.substring( 1, atdNames.length() - 1 ) );
atdDescText.setText( Utils.getNonNullString( atd.getDescription() ) );
atdUsageText.setText( Utils.getNonNullString( atd.getUsage() ) );
singleValuedFlag.setSelection( atd.isSingleValued() );
noUserModificationFlag.setSelection( !atd.isUserModifiable() );
collectiveFlag.setSelection( atd.isCollective() );
obsoleteFlag.setSelection( atd.isObsolete() );
String syntaxNumericOid = SchemaUtils.getSyntaxNumericOidTransitive( atd, schema );
int syntaxLength = SchemaUtils.getSyntaxLengthTransitive( atd, schema );
String syntaxDescription = syntaxNumericOid != null ? schema
.getLdapSyntaxDescription( syntaxNumericOid ).getDescription() : null;
syntaxOidText.setText( Utils.getNonNullString( syntaxNumericOid ) );
syntaxDescText.setText( Utils.getNonNullString( syntaxDescription ) );
syntaxLengthText.setText( Utils.getNonNullString( syntaxLength > 0 ? Integer.toString( syntaxLength )
: null ) );