Package org.apache.directory.studio.ldapbrowser.core.model.schema

Examples of org.apache.directory.studio.ldapbrowser.core.model.schema.Schema


     */
    private MatchingRuleDescription getSmrd()
    {
        if ( getConnection() != null )
        {
            Schema schema = getConnection().getSchema();
            AttributeTypeDescription atd = getAtd();
            if ( atd != null
                && SchemaUtils.getSubstringMatchingRuleNameOrNumericOidTransitive( atd, schema ) != null
                && schema.hasLdapSyntaxDescription( SchemaUtils.getSubstringMatchingRuleNameOrNumericOidTransitive(
                    atd, schema ) ) )
            {
                return schema.getMatchingRuleDescription( SchemaUtils
                    .getSubstringMatchingRuleNameOrNumericOidTransitive( atd, schema ) );
            }
        }
        return null;
    }
View Full Code Here


         */
        public Object[] getElements( Object inputElement )
        {
            if ( inputElement instanceof Schema )
            {
                Schema schema = ( Schema ) inputElement;
                if ( schema != null )
                {
                    return schema.getObjectClassDescriptions().toArray();
                }
            }
            return new Object[0];
        }
View Full Code Here

     */
    private MatchingRuleDescription getOmrd()
    {
        if ( getConnection() != null )
        {
            Schema schema = getConnection().getSchema();
            AttributeTypeDescription atd = getAtd();
            if ( atd != null
                && SchemaUtils.getOrderingMatchingRuleNameOrNumericOidTransitive( atd, schema ) != null
                && schema.hasLdapSyntaxDescription( SchemaUtils.getOrderingMatchingRuleNameOrNumericOidTransitive( atd,
                    schema ) ) )
            {
                return schema.getMatchingRuleDescription( SchemaUtils
                    .getOrderingMatchingRuleNameOrNumericOidTransitive( atd, schema ) );
            }
        }
        return null;
    }
View Full Code Here

        orderingMatchingRuleText.setLayoutData( orderingMatchingRuleTextGridData );

        IAttribute attribute = getAttribute( getElement() );
        if ( attribute != null )
        {
            Schema schema = attribute.getEntry().getBrowserConnection().getSchema();

            int bytes = 0;
            int valCount = 0;
            IValue[] allValues = attribute.getValues();
            for ( int valIndex = 0; valIndex < allValues.length; valIndex++ )
            {
                if ( !allValues[valIndex].isEmpty() )
                {
                    valCount++;
                    bytes += allValues[valIndex].getBinaryValue().length;
                }
            }

            this.setMessage( NLS.bind(
                Messages.getString( "AttributePropertyPage.Attribute" ), new String[] { attribute.getDescription() } ) ); //$NON-NLS-1$
            attributeNameText.setText( attribute.getDescription() );
            attributeTypeText.setText( attribute.isString() ? "String" : "Binary" ); //$NON-NLS-1$ //$NON-NLS-2$
            attributeValuesText.setText( "" + valCount ); //$NON-NLS-1$
            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;
                syntaxOidText.setText( Utils.getNonNullString( syntaxNumericOid ) );
                syntaxDescText.setText( Utils.getNonNullString( syntaxDescription ) );
                syntaxLengthText.setText( Utils.getNonNullString( syntaxLength > 0 ? Integer.toString( syntaxLength )
                    : null ) );
View Full Code Here

         */
        public Object[] getElements( Object inputElement )
        {
            if ( inputElement instanceof Schema )
            {
                Schema schema = ( Schema ) inputElement;
                if ( schema != null && schema.getMatchingRuleDescriptions() != null )
                {
                    return schema.getMatchingRuleDescriptions().toArray();
                }
            }
            return new Object[0];
        }
View Full Code Here

     */
    private void update( IBrowserConnection browserConnection )
    {
        if ( !dnText.isDisposed() )
        {
            Schema schema = null;
            if ( browserConnection != null )
            {
                schema = browserConnection.getSchema();
            }

            if ( schema != null && schema.getDn() != null )
            {
                dnText.setText( schema.getDn().toString() );
            }
            else
            {
                dnText.setText( "-" ); //$NON-NLS-1$
            }

            if ( schema != null && schema.getCreateTimestamp() != null )
            {
                ctText.setText( schema.getCreateTimestamp() );
            }
            else
            {
                ctText.setText( "-" ); //$NON-NLS-1$
            }

            if ( schema != null && schema.getModifyTimestamp() != null )
            {
                mtText.setText( schema.getModifyTimestamp() );
            }
            else
            {
                mtText.setText( "-" ); //$NON-NLS-1$
            }
View Full Code Here

         */
        public Object[] getElements( Object inputElement )
        {
            if ( inputElement instanceof Schema )
            {
                Schema schema = ( Schema ) inputElement;
                if ( schema != null && schema.getLdapSyntaxDescriptions() != null )
                {
                    return schema.getLdapSyntaxDescriptions().toArray();
                }
            }
            return new Object[0];
        }
View Full Code Here

    /**
     * Refreshes this schema page.
     */
    public void refresh()
    {
        Schema schema = null;
        if ( showDefaultSchemaAction.isChecked() )
        {
            schema = Schema.DEFAULT_SCHEMA;
        }
        else if ( getConnection() != null )
View Full Code Here

                Messages.getString( "MatchingRuleUseDescriptionDetailsPage.MatchingRules" ), SWT.NONE ); //$NON-NLS-1$
            nameLink = toolkit.createHyperlink( mainClient, "", SWT.WRAP ); //$NON-NLS-1$
            nameLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
            nameLink.addHyperlinkListener( this );

            Schema schema = getSchema();
            MatchingRuleDescription mrd = schema.hasMatchingRuleDescription( mrud.getNumericOid() ) ? schema
                .getMatchingRuleDescription( mrud.getNumericOid() ) : null;
            nameLink
                .setText( getNonNullString( mrd != null ? SchemaUtils.toString( mrd ) : SchemaUtils.toString( mrud ) ) );
            nameLink.setHref( mrd );
            nameLink.setUnderlined( mrd != null );
View Full Code Here

            {
                appliesSection
                    .setText( NLS
                        .bind(
                            Messages.getString( "MatchingRuleUseDescriptionDetailsPage.AppliesCount" ), new Object[] { names.size() } ) ); //$NON-NLS-1$
                Schema schema = getSchema();
                for ( String name : names )
                {
                    if ( schema.hasAttributeTypeDescription( name ) )
                    {
                        AttributeTypeDescription appliesAtd = schema.getAttributeTypeDescription( name );
                        Hyperlink appliesLink = toolkit.createHyperlink( appliesClient, SchemaUtils
                            .toString( appliesAtd ), SWT.WRAP );
                        appliesLink.setHref( appliesAtd );
                        appliesLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        appliesLink.setUnderlined( true );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.schema.Schema

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.