You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Felix Knecht <fe...@otego.com> on 2008/11/27 17:42:14 UTC

What is 'kind' for ??

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();
    }

Re: What is 'kind' for ??

Posted by Emmanuel Lecharny <el...@gmail.com>.
Felix Knecht wrote:
>> Is this the kind of information you are looking for ?
>>     
>
> I'm sorry to say no, even if the information is helpful. But you helped me to find it - I was just blind after so many
> externalizing today ...
>
> The part I was looking for is here:
> kindText = toolkit.createText( mainClient, getNonNullString( kind ), SWT.NONE );
>
> I thought that the variable 'kind' was nowhere used in a reading way ...
>   
objectClassKind would have been more helpfull...


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: What is 'kind' for ??

Posted by Felix Knecht <fe...@apache.org>.
Emmanuel Lecharny schrieb:
> Felix Knecht wrote:
>> 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.
>>   
> 
> From RFC 4512, 2.4. Object Classes, the paragraph just before the last
> one :
> 
> "Each object class is defined to be one of three kinds of object
> classes: Abstract, Structural, or Auxiliary."
> 
> Basically, and Objectclass can have three different 'flavor' (or 'kind'
> ). The difference between abstract and auxiliary is subtile :
> an entry can have an auxiliary OC (it's pretty muxh as an interface in
> java), but not an abstract class without its extending structural or
> auxiliary ObjectClasses.
> 
> Is this the kind of information you are looking for ?

I'm sorry to say no, even if the information is helpful. But you helped me to find it - I was just blind after so many
externalizing today ...

The part I was looking for is here:
kindText = toolkit.createText( mainClient, getNonNullString( kind ), SWT.NONE );

I thought that the variable 'kind' was nowhere used in a reading way ...

Thanks again
Felix


Re: What is 'kind' for ??

Posted by Emmanuel Lecharny <el...@gmail.com>.
Felix Knecht wrote:
> 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.
>   

 From RFC 4512, 2.4. Object Classes, the paragraph just before the last 
one :

"Each object class is defined to be one of three kinds of object classes: Abstract, Structural, or Auxiliary."

Basically, and Objectclass can have three different 'flavor' (or 'kind' ). The difference between abstract and auxiliary is subtile :
an entry can have an auxiliary OC (it's pretty muxh as an interface in java), but not an abstract class without its extending structural or auxiliary 
ObjectClasses.

Is this the kind of information you are looking for ?


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org