public void setInput()

in plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/AttributeTypeDescriptionDetailsPage.java [343:484]


    public void setInput( Object input )
    {
        AttributeType atd = null;
        
        if ( input instanceof AttributeType )
        {
            atd = ( AttributeType ) input;
        }

        // create main content
        createMainContent( atd );

        // set flags
        if ( ( atd != null ) && ( atd.isSingleValued() ) )
        {
            singleValuedLabel.setForeground( getColor( CommonUIConstants.DEFAULT_COLOR ) );
        }
        else
        {
            singleValuedLabel.setForeground( getColor( CommonUIConstants.DISABLED_COLOR ) );
        }

        if ( atd != null && atd.isObsolete() )
        {
            isObsoleteLabel.setForeground( getColor( CommonUIConstants.DEFAULT_COLOR ) );
        }
        else
        {
            isObsoleteLabel.setForeground( getColor( CommonUIConstants.DISABLED_COLOR ) );
        }

        if ( atd != null && atd.isCollective() )
        {
            collectiveLabel.setForeground( getColor( CommonUIConstants.DEFAULT_COLOR ) );
        }
        else
        {
            collectiveLabel.setForeground( getColor( CommonUIConstants.DISABLED_COLOR ) );
        }

        if ( atd != null && !atd.isUserModifiable() )
        {
            noUserModificationLabel.setForeground( getColor( CommonUIConstants.DEFAULT_COLOR ) );
        }
        else
        {
            noUserModificationLabel.setForeground( getColor( CommonUIConstants.DISABLED_COLOR ) );
        }

        flagSection.layout();

        // set syntax content
        String lsdOid = null;
        LdapSyntax lsd = null;
        long lsdLength = 0;
        
        if ( atd != null )
        {
            lsdOid = SchemaUtils.getSyntaxNumericOidTransitive( atd, getSchema() );
            
            if ( lsdOid != null && getSchema().hasLdapSyntaxDescription( lsdOid ) )
            {
                lsd = getSchema().getLdapSyntaxDescription( lsdOid );
            }
            
            lsdLength = SchemaUtils.getSyntaxLengthTransitive( atd, getSchema() );
        }
        
        syntaxLink.setText( getNonNullString( lsd != null ? lsd.getOid() : lsdOid ) );
        syntaxLink.setHref( lsd );
        syntaxLink.setUnderlined( lsd != null );
        syntaxLink.setEnabled( lsd != null );
        syntaxDescText.setText( getNonNullString( lsd != null ? lsd.getDescription() : null ) );
        lengthText.setText( getNonNullString( lsdLength > 0 ? Long.toString( lsdLength ) : null ) );
        syntaxSection.layout();

        // set matching rules content
        String emrOid = null;
        MatchingRule emr = null;
        
        if ( atd != null )
        {
            emrOid = SchemaUtils.getEqualityMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            
            if ( emrOid != null && getSchema().hasMatchingRuleDescription( emrOid ) )
            {
                emr = getSchema().getMatchingRuleDescription( emrOid );
            }
        }
        
        equalityLink.setText( getNonNullString( emr != null ? SchemaUtils.toString( emr ) : emrOid ) );
        equalityLink.setHref( emr );
        equalityLink.setUnderlined( emr != null );
        equalityLink.setEnabled( emr != null );

        String smrOid = null;
        MatchingRule smr = null;
        
        if ( atd != null )
        {
            smrOid = SchemaUtils.getSubstringMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            
            if ( smrOid != null && getSchema().hasMatchingRuleDescription( smrOid ) )
            {
                smr = getSchema().getMatchingRuleDescription( smrOid );
            }
        }
        
        substringLink.setText( getNonNullString( smr != null ? SchemaUtils.toString( smr ) : smrOid ) );
        substringLink.setHref( smr );
        substringLink.setUnderlined( smr != null );
        substringLink.setEnabled( smr != null );

        String omrOid = null;
        MatchingRule omr = null;
        
        if ( atd != null )
        {
            omrOid = SchemaUtils.getOrderingMatchingRuleNameOrNumericOidTransitive( atd, getSchema() );
            
            if ( omrOid != null && getSchema().hasMatchingRuleDescription( omrOid ) )
            {
                omr = getSchema().getMatchingRuleDescription( omrOid );
            }
        }
        
        orderingLink.setText( getNonNullString( omr != null ? SchemaUtils.toString( omr ) : omrOid ) );
        orderingLink.setHref( omr );
        orderingLink.setUnderlined( omr != null );
        orderingLink.setEnabled( omr != null );
        matchingRulesSection.layout();

        // create contents of dynamic sections
        createOtherMatchContent( atd );
        createUsedAsMustContent( atd );
        createUsedAsMayContent( atd );
        createSupertypeContent( atd );
        createSubtypesContent( atd );
        createRawContents( atd );

        detailForm.reflow( true );
    }