directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fe...@otego.com>
Subject What is 'kind' for ??
Date Thu, 27 Nov 2008 16:42:14 GMT
Hi all

Working on externalizing strings I encountered a problem. Can please anybody explain me what
the variable 'kind' is for?
It's never read withing this function. The usage ATM seems quite obsolete to me.

Thanks
Felix

From
ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ObjectClassDescriptionDetailsPage.java


    private void createMainContent( ObjectClassDescription ocd )
    {
        // dispose old content
        if ( mainSection.getClient() != null )
        {
            mainSection.getClient().dispose();
        }

        // create new client
        Composite mainClient = toolkit.createComposite( mainSection, SWT.WRAP );
        GridLayout mainLayout = new GridLayout( 2, false );
        mainClient.setLayout( mainLayout );
        mainSection.setClient( mainClient );

        // create new content
        if ( ocd != null )
        {
            toolkit.createLabel( mainClient, "Numeric OID:", SWT.NONE );
            numericOidText = toolkit.createText( mainClient, getNonNullString( ocd.getNumericOid()
), SWT.NONE );
            numericOidText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
            numericOidText.setEditable( false );

            toolkit.createLabel( mainClient, "Objectclass names:", SWT.NONE );
            namesText = toolkit.createText( mainClient, getNonNullString( SchemaUtils.toString(
ocd ) ), SWT.NONE );
            namesText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
            namesText.setEditable( false );

            toolkit.createLabel( mainClient, "Descripton:", SWT.NONE );
            descText = toolkit.createText( mainClient, getNonNullString( ocd.getDescription()
), SWT.WRAP | SWT.MULTI );
            GridData gd = new GridData( GridData.FILL_HORIZONTAL );
            gd.widthHint = detailForm.getForm().getSize().x - 100 - 60;
            descText.setLayoutData( gd );
            descText.setEditable( false );

            String kind = "";
            switch ( ocd.getKind() )
            {
                case STRUCTURAL:
                    kind = "structural";
                    break;
                case ABSTRACT:
                    kind = "abstract";
                    break;
                case AUXILIARY:
                    kind = "auxiliary";
                    break;
            }
            if ( ocd.isObsolete() )
            {
                kind += " (obsolete)";
            }
            toolkit.createLabel( mainClient, "Objectclass kind:", SWT.NONE );
            kindText = toolkit.createText( mainClient, getNonNullString( kind ), SWT.NONE
);
            kindText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
            kindText.setEditable( false );
        }

        mainSection.layout();
    }

Mime
View raw message