Package org.apache.directory.ldapstudio.browser.core.model.schema

Examples of org.apache.directory.ldapstudio.browser.core.model.schema.AttributeTypeDescription


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

        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeName );

        if ( atd.getSyntaxDescription().isBinary() )
        {
            alternativeList.add( this.defaultBinaryValueEditor );
            alternativeList.add( this.defaultStringSingleLineValueEditor );
            alternativeList.add( this.defaultStringMultiLineValueEditor );
        }
        else if ( atd.getSyntaxDescription().isString() )
        {
            alternativeList.add( this.defaultStringSingleLineValueEditor );
            alternativeList.add( this.defaultStringMultiLineValueEditor );
            alternativeList.add( this.defaultBinaryValueEditor );
        }
View Full Code Here


        {
            return this.userSelectedValueEditor;
        }

        // check attribute preferences
        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeType );
        Map attributeValueEditorMap = BrowserUIPlugin.getDefault().getUIPreferences().getAttributeValueEditorMap();
        if ( atd.getNumericOID() != null && attributeValueEditorMap.containsKey( atd.getNumericOID().toLowerCase() ) )
        {
            return ( IValueEditor ) this.class2ValueEditors.get( attributeValueEditorMap.get( atd.getNumericOID()
                .toLowerCase() ) );
        }
        String[] names = atd.getNames();
        for ( int i = 0; i < names.length; i++ )
        {
            if ( attributeValueEditorMap.containsKey( names[i].toLowerCase() ) )
            {
                return ( IValueEditor ) this.class2ValueEditors.get( attributeValueEditorMap.get( names[i]
                    .toLowerCase() ) );
            }
        }

        // check syntax preferences
        LdapSyntaxDescription lsd = atd.getSyntaxDescription();
        Map syntaxValueEditorMap = BrowserUIPlugin.getDefault().getUIPreferences().getSyntaxValueEditorMap();
        if ( lsd.getNumericOID() != null && syntaxValueEditorMap.containsKey( lsd.getNumericOID().toLowerCase() ) )
        {
            return ( IValueEditor ) this.class2ValueEditors.get( syntaxValueEditorMap.get( lsd.getNumericOID()
                .toLowerCase() ) );
View Full Code Here

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

        AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeName );

        if ( atd.getSyntaxDescription().isBinary() )
        {
            alternativeList.add( this.defaultBinaryValueEditor );
            alternativeList.add( this.defaultStringSingleLineValueEditor );
            alternativeList.add( this.defaultStringMultiLineValueEditor );
        }
        else if ( atd.getSyntaxDescription().isString() )
        {
            alternativeList.add( this.defaultStringSingleLineValueEditor );
            alternativeList.add( this.defaultStringMultiLineValueEditor );
            alternativeList.add( this.defaultBinaryValueEditor );
        }
View Full Code Here

        else
        {
            Object obj = ( ( StructuredSelection ) selection ).getFirstElement();
            if ( obj instanceof AttributeTypeDescription )
            {
                AttributeTypeDescription atd = ( AttributeTypeDescription ) obj;
                EventRegistry.fireAttributeTypeDescriptionSelected( atd, this );
            }
        }
    }
View Full Code Here

    {
        public boolean select( Viewer viewer, Object parentElement, Object element )
        {
            if ( element instanceof AttributeTypeDescription )
            {
                AttributeTypeDescription atd = ( AttributeTypeDescription ) element;
                boolean matched = false;

                if ( !matched )
                    matched = atd.toString().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;
                if ( !matched )
                    matched = atd.getNumericOID().toLowerCase().indexOf( filterText.getText().toLowerCase() ) != -1;

                return matched;
            }
            return false;
        }
View Full Code Here

     * @return
     *      the LDAP Syntax Description
     */
    private LdapSyntaxDescription getLsd()
    {
        AttributeTypeDescription atd = getAtd();

        if ( atd != null && atd.getSyntaxDescriptionNumericOIDTransitive() != null
            && atd.getSchema().hasLdapSyntaxDescription( atd.getSyntaxDescriptionNumericOIDTransitive() ) )
        {
            return atd.getSchema().getLdapSyntaxDescription( atd.getSyntaxDescriptionNumericOIDTransitive() );
        }

        return null;
    }
View Full Code Here

     */
    private AttributeTypeDescription getAtd()
    {
        if ( ( getSelectedValues().length + getSelectedAttributes().length ) + getSelectedAttributeHierarchies().length == 1 )
        {
            AttributeTypeDescription atd = null;
            if ( getSelectedValues().length == 1 )
            {
                atd = getSelectedValues()[0].getAttribute().getAttributeTypeDescription();
            }
            else if ( getSelectedAttributes().length == 1 )
View Full Code Here

     * @return
     *      the Equality Matching Rule Description
     */
    private MatchingRuleDescription getEmrd()
    {
        AttributeTypeDescription atd = getAtd();

        if ( atd != null && atd.getEqualityMatchingRuleDescriptionOIDTransitive() != null
            && atd.getSchema().hasMatchingRuleDescription( atd.getEqualityMatchingRuleDescriptionOIDTransitive() ) )
        {
            return atd.getSchema().getMatchingRuleDescription( atd.getEqualityMatchingRuleDescriptionOIDTransitive() );
        }

        return null;
    }
View Full Code Here

     * @return
     *      the Substring Matching Rule Description
     */
    private MatchingRuleDescription getSmrd()
    {
        AttributeTypeDescription atd = getAtd();

        if ( atd != null && atd.getSubstringMatchingRuleDescriptionOIDTransitive() != null
            && atd.getSchema().hasMatchingRuleDescription( atd.getSubstringMatchingRuleDescriptionOIDTransitive() ) )
        {
            return atd.getSchema().getMatchingRuleDescription( atd.getSubstringMatchingRuleDescriptionOIDTransitive() );
        }

        return null;
    }
View Full Code Here

     * @return
     *      the Ordering Matching Rule Description
     */
    private MatchingRuleDescription getOmrd()
    {
        AttributeTypeDescription atd = getAtd();

        if ( atd != null && atd.getOrderingMatchingRuleDescriptionOIDTransitive() != null
            && atd.getSchema().hasMatchingRuleDescription( atd.getOrderingMatchingRuleDescriptionOIDTransitive() ) )
        {
            return atd.getSchema().getMatchingRuleDescription( atd.getOrderingMatchingRuleDescriptionOIDTransitive() );
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.schema.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.