Package org.apache.directory.shared.ldap.schema.parsers

Examples of org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription


        String displayValue = value.getStringValue();

        if ( !showRawValues() && !"".equals( displayValue ) ) //$NON-NLS-1$
        {
            Schema schema = value.getAttribute().getEntry().getBrowserConnection().getSchema();
            ObjectClassDescription ocd = schema.getObjectClassDescription( displayValue );
            switch ( ocd.getKind() )
            {
                case STRUCTURAL:
                    displayValue = displayValue + Messages.getString( "ObjectClassValueEditor.Structural" ); //$NON-NLS-1$
                    break;
                case ABSTRACT:
                    displayValue = displayValue + Messages.getString( "ObjectClassValueEditor.Abstract" ); //$NON-NLS-1$
                    break;
                case AUXILIARY:
                    displayValue = displayValue + Messages.getString( "ObjectClassValueEditor.Auxiliary" ); //$NON-NLS-1$
                    break;
            }
            if ( ocd.isObsolete() )
            {
                displayValue = displayValue + Messages.getString( "ObjectClassValueEditor.Obsolete" ); //$NON-NLS-1$
            }
        }
View Full Code Here


        {
            String[] ocNames = ocAttribute.getStringValues();
            Schema schema = getBrowserConnection().getSchema();
            for ( String ocName : ocNames )
            {
                ObjectClassDescription ocd = schema.getObjectClassDescription( ocName );
                ocds.add( ocd );
            }
        }
        return ocds;
    }
View Full Code Here

                String[] ocNumericOids = objectClassIconPair.getOcNumericOids();
                for ( String ocNumericOid : ocNumericOids )
                {
                    if ( numericOids.contains( ocNumericOid ) )
                    {
                        ObjectClassDescription ocd = schema.getObjectClassDescription( ocNumericOid );
                        if ( ocd.getKind() == ObjectClassTypeEnum.STRUCTURAL )
                        {
                            weight += 3;
                        }
                        else if ( ocd.getKind() == ObjectClassTypeEnum.AUXILIARY )
                        {
                            weight += 2;
                        }
                    }
                }
View Full Code Here

         */
        public boolean select( Viewer viewer, Object parentElement, Object element )
        {
            if ( element instanceof ObjectClassDescription )
            {
                ObjectClassDescription ocd = ( ObjectClassDescription ) element;
                boolean matched = SchemaUtils.toString( ocd ).toLowerCase()
                    .indexOf( filterText.getText().toLowerCase() ) != -1
                    || ocd.getNumericOid().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
                return matched;
            }
            return false;
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void setInput( Object input )
    {
        ObjectClassDescription ocd = null;
        if ( input instanceof ObjectClassDescription )
        {
            ocd = ( ObjectClassDescription ) input;
        }

View Full Code Here

                supClient.setLayout( gl );
                for ( String name : names )
                {
                    if ( getSchema().hasObjectClassDescription( name ) )
                    {
                        ObjectClassDescription supOcd = getSchema().getObjectClassDescription( name );
                        Hyperlink superLink = toolkit.createHyperlink( supClient, SchemaUtils.toString( supOcd ),
                            SWT.WRAP );
                        superLink.setHref( supOcd );
                        superLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        superLink.setUnderlined( true );
View Full Code Here

                String[] ocNumericOids = objectClassIconPair.getOcNumericOids();
                for ( String ocNumericOid : ocNumericOids )
                {
                    if ( numericOids.contains( ocNumericOid ) )
                    {
                        ObjectClassDescription ocd = schema.getObjectClassDescription( ocNumericOid );
                        if ( ocd.getKind() == ObjectClassTypeEnum.STRUCTURAL )
                        {
                            weight += 3;
                        }
                        else if ( ocd.getKind() == ObjectClassTypeEnum.AUXILIARY )
                        {
                            weight += 2;
                        }
                    }
                }
View Full Code Here

    {
        if ( schema != null )
        {
            for ( String possibleObjectClass : possibleObjectClasses.keySet() )
            {
                ObjectClassDescription description = possibleObjectClasses.get( possibleObjectClass );
                if ( possibleObjectClass.toUpperCase().startsWith( objectClass.toUpperCase() ) )
                {
                    String replacementString = possibleObjectClass;
                    String displayString = possibleObjectClass;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                    }

                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, objectClass
                        .length(), replacementString.length(), getObjectClassImage(), displayString, null, SchemaUtils
                        .getLdifLine( schema.getObjectClassDescription( possibleObjectClass ) ) );
View Full Code Here

         */
        public boolean select( Viewer viewer, Object parentElement, Object element )
        {
            if ( element instanceof ObjectClassDescription )
            {
                ObjectClassDescription ocd = ( ObjectClassDescription ) element;
                Collection<String> lowerCaseIdentifiers = SchemaUtils.getLowerCaseIdentifiers( ocd );
                for ( String s : lowerCaseIdentifiers )
                {
                    if ( s.toLowerCase().startsWith( filterText.getText().toLowerCase() ) )
                    {
View Full Code Here

                    && SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( fc.getAttributeToken().getValue() )
                    && fc.getValueToken() != null && fc.getValueToken().getOffset() <= hoverRegion.getOffset()
                    && hoverRegion.getOffset() <= fc.getValueToken().getOffset() + fc.getValueToken().getLength() )
                {
                    String objectClass = fc.getValueToken().getValue();
                    ObjectClassDescription objectClassDescription = schema.getObjectClassDescription( objectClass );
                    String ldifLine = SchemaUtils.getLdifLine( objectClassDescription );
                    return ldifLine;
                }
            }
            if ( filter.getFilterComponent() instanceof LdapFilterExtensibleComponent )
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.