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

Examples of org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription


     */
    public IValueEditor[] getAlternativeValueEditors( Schema schema, String attributeName )
    {
        List<IValueEditor> alternativeList = new ArrayList<IValueEditor>();

        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeName );

        if ( SchemaUtils.isBinary( atd, schema ) )
        {
            alternativeList.add( defaultBinaryValueEditor );
            alternativeList.add( defaultStringSingleLineValueEditor );
View Full Code Here


                {
                    Collection<String> mustAttrs = SchemaUtils.getMustAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mustAttr : mustAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mustAttr );
                        remainingAttributeSet.add( atd );
                    }
                    Collection<String> mayAttrs = SchemaUtils.getMayAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mayAttr : mayAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mayAttr );
                        remainingAttributeSet.add( atd );
                    }
                }
            }
View Full Code Here

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

        // create main content
        createMainContent( atd );

        // set flags
        singleValuedText.setEnabled( atd != null && atd.isSingleValued() );
        isObsoleteText.setEnabled( atd != null && atd.isObsolete() );
        collectiveText.setEnabled( atd != null && atd.isCollective() );
        noUserModificationText.setEnabled( atd != null && !atd.isUserModifiable() );
        flagSection.layout();

        // set syntax content
        String lsdOid = null;
        LdapSyntaxDescription lsd = null;
View Full Code Here

            if ( superType != null )
            {
                supertypeSection.setText( "Supertype (" + "1" + ")" );
                if ( getSchema().hasAttributeTypeDescription( superType ) )
                {
                    AttributeTypeDescription supAtd = getSchema().getAttributeTypeDescription( superType );
                    Hyperlink superLink = toolkit.createHyperlink( superClient, SchemaUtils.toString( supAtd ),
                        SWT.WRAP );
                    superLink.setHref( supAtd );
                    superLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    superLink.setUnderlined( true );
View Full Code Here

                    && fc.getAttributeToken().getOffset() <= hoverRegion.getOffset()
                    && hoverRegion.getOffset() <= fc.getAttributeToken().getOffset()
                        + fc.getAttributeToken().getLength() )
                {
                    String attributeType = fc.getAttributeToken().getValue();
                    AttributeTypeDescription attributeTypeDescription = schema
                        .getAttributeTypeDescription( attributeType );
                    String ldifLine = SchemaUtils.getLdifLine( attributeTypeDescription );
                    return ldifLine;
                }
                if ( fc.getAttributeToken() != null
                    && IAttribute.OBJECTCLASS_ATTRIBUTE.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 )
            {
                LdapFilterExtensibleComponent fc = ( LdapFilterExtensibleComponent ) filter.getFilterComponent();
                if ( fc.getAttributeToken() != null
                    && fc.getAttributeToken().getOffset() <= hoverRegion.getOffset()
                    && hoverRegion.getOffset() <= fc.getAttributeToken().getOffset()
                        + fc.getAttributeToken().getLength() )
                {
                    String attributeType = fc.getAttributeToken().getValue();
                    AttributeTypeDescription attributeTypeDescription = schema
                        .getAttributeTypeDescription( attributeType );
                    String ldifLine = SchemaUtils.getLdifLine( attributeTypeDescription );
                    return ldifLine;
                }
                if ( fc.getMatchingRuleToken() != null
View Full Code Here

    {
        if ( schema != null )
        {
            for ( String possibleAttributeType : possibleAttributeTypes.keySet() )
            {
                AttributeTypeDescription description = possibleAttributeTypes.get( possibleAttributeType );
                if ( possibleAttributeType.toUpperCase().startsWith( attributeType.toUpperCase() ) )
                {
                    String replacementString = possibleAttributeType;
                    String displayString = possibleAttributeType;
                    if ( displayString.equals( description.getNumericOid() ) )
                    {
                        displayString += " (" + SchemaUtils.toString( description ) + ")";
                    }
                    else
                    {
                        displayString += " (" + description.getNumericOid() + ")";
                    }
                    String info = SchemaUtils.getLdifLine( description );
                    ICompletionProposal proposal = new CompletionProposal( replacementString, offset, attributeType
                        .length(), replacementString.length(), getAttributeTypeImage(), displayString, null, info );
                    proposalList.add( proposal );
View Full Code Here

                {
                    Collection<String> mustAttrs = SchemaUtils.getMustAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mustAttr : mustAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mustAttr );
                        remainingAttributeSet.add( atd );
                    }
                    Collection<String> mayAttrs = SchemaUtils.getMayAttributeTypeDescriptionNamesTransitive( ocd,
                        schema );
                    for ( String mayAttr : mayAttrs )
                    {
                        AttributeTypeDescription atd = entry.getBrowserConnection().getSchema()
                            .getAttributeTypeDescription( mayAttr );
                        remainingAttributeSet.add( atd );
                    }
                }
            }
View Full Code Here

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

            attributeValuesText.setText( "" + valCount );
            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;
View Full Code Here

    private LdapSyntaxDescription getLsd()
    {
        if ( getConnection() != null )
        {
            Schema schema = getConnection().getSchema();
            AttributeTypeDescription atd = getAtd();

            if ( atd != null && SchemaUtils.getSyntaxNumericOidTransitive( atd, schema ) != null
                && schema.hasLdapSyntaxDescription( SchemaUtils.getSyntaxNumericOidTransitive( atd, schema ) ) )
            {
                return schema.getLdapSyntaxDescription( SchemaUtils.getSyntaxNumericOidTransitive( atd, schema ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription

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.