Examples of MatchingRuleImpl


Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

                            oc.setSchema( name );
                            oc.setSchemaObject( schema );
                            schema.addObjectClass( oc );
                            break;
                        case MATCHING_RULE:
                            MatchingRuleImpl mr = createMatchingRule( searchResult );
                            mr.setSchema( name );
                            mr.setSchemaObject( schema );
                            schema.addMatchingRule( mr );
                            break;
                        case SYNTAX:
                            SyntaxImpl syntax = createSyntax( searchResult );
                            syntax.setSchema( name );
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

     * ObjectClass could be created
     * @throws NamingException
     */
    private static MatchingRuleImpl createMatchingRule( SearchResult sr ) throws NamingException
    {
        MatchingRuleImpl mr = new MatchingRuleImpl( getOid( sr ) );
        mr.setNames( getNames( sr ) );
        mr.setDescription( getDescription( sr ) );
        mr.setObsolete( isObsolete( sr ) );
        mr.setSyntaxOid( getSyntax( sr ) );
        return mr;
    }
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

            equalityComboViewer.setSelection( new StructuredSelection( new NonExistingMatchingRule(
                NonExistingMatchingRule.NONE ) ), true );
        }
        else
        {
            MatchingRuleImpl matchingRule = schemaHandler.getMatchingRule( equalityName );
            if ( matchingRule != null )
            {
                equalityComboViewer.setSelection( new StructuredSelection( matchingRule ), true );
            }
            else
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

            orderingComboViewer.setSelection( new StructuredSelection( new NonExistingMatchingRule(
                NonExistingMatchingRule.NONE ) ), true );
        }
        else
        {
            MatchingRuleImpl matchingRule = schemaHandler.getMatchingRule( orderingName );
            if ( matchingRule != null )
            {
                orderingComboViewer.setSelection( new StructuredSelection( matchingRule ), true );
            }
            else
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

            substringComboViewer.setSelection( new StructuredSelection( new NonExistingMatchingRule(
                NonExistingMatchingRule.NONE ) ), true );
        }
        else
        {
            MatchingRuleImpl matchingRule = schemaHandler.getMatchingRule( substringName );
            if ( matchingRule != null )
            {
                substringComboViewer.setSelection( new StructuredSelection( matchingRule ), true );
            }
            else
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

     *      the schema
     * @throws XMLSchemaFileImportException
     */
    private static void readMatchingRule( Element element, Schema schema ) throws XMLSchemaFileImportException
    {
        MatchingRuleImpl mr = null;

        // OID
        Attribute oidAttribute = element.attribute( OID_TAG );
        if ( ( oidAttribute != null ) && ( !oidAttribute.getValue().equals( "" ) ) ) //$NON-NLS-1$
        {
            mr = new MatchingRuleImpl( oidAttribute.getValue() );
        }
        else
        {
            throw new XMLSchemaFileImportException( Messages.getString( "XMLSchemaFileImporter.NoMatchingRuleForOID" ) ); //$NON-NLS-1$
        }

        // Schema
        mr.setSchema( schema.getName() );
        mr.setSchemaObject( schema );

        // Aliases
        Element aliasesElement = element.element( ALIASES_TAG );
        if ( aliasesElement != null )
        {
            List<String> aliases = new ArrayList<String>();
            for ( Iterator<?> i = aliasesElement.elementIterator( ALIAS_TAG ); i.hasNext(); )
            {
                Element aliasElement = ( Element ) i.next();
                aliases.add( aliasElement.getText() );
            }
            if ( aliases.size() >= 1 )
            {
                mr.setNames( aliases.toArray( new String[0] ) );
            }
        }

        // Description
        Element descriptionElement = element.element( DESCRIPTION_TAG );
        if ( ( descriptionElement != null ) && ( !descriptionElement.getText().equals( "" ) ) ) //$NON-NLS-1$
        {
            mr.setDescription( descriptionElement.getText() );
        }

        // Obsolete
        Attribute obsoleteAttribute = element.attribute( OBSOLETE_TAG );
        if ( ( obsoleteAttribute != null ) && ( !obsoleteAttribute.getValue().equals( "" ) ) ) //$NON-NLS-1$
        {
            mr.setObsolete( readBoolean( obsoleteAttribute.getValue() ) );
        }

        // Syntax OID
        Element syntaxOidElement = element.element( SYNTAX_OID_TAG );
        if ( ( syntaxOidElement != null ) && ( !syntaxOidElement.getText().equals( "" ) ) ) //$NON-NLS-1$
        {
            mr.setSyntaxOid( syntaxOidElement.getText() );
        }

        // Adding the matching rule to the schema
        schema.addMatchingRule( mr );
    }
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

     */
    public String getText( Object obj )
    {
        if ( obj instanceof MatchingRuleImpl )
        {
            MatchingRuleImpl mr = ( MatchingRuleImpl ) obj;

            String name = mr.getName();
            if ( name != null )
            {
                return name + "  -  (" + mr.getOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
            }
            else
            {
                return NLS.bind(
                    Messages.getString( "ATEMatchingRulesComboLabelProvider.None" ), new String[] { mr.getOid() } ); //$NON-NLS-1$
            }
        }
        else if ( obj instanceof NonExistingMatchingRule )
        {
            return ( ( NonExistingMatchingRule ) obj ).getDisplayName();
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

    {
        Object selection = ( ( StructuredSelection ) equalityComboViewer.getSelection() ).getFirstElement();

        if ( selection instanceof MatchingRuleImpl )
        {
            MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );

            String[] names = mr.getNamesRef();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return mr.getName();
            }
            else
            {
                return mr.getOid();
            }
        }

        return null;
    }
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

    {
        Object selection = ( ( StructuredSelection ) orderingComboViewer.getSelection() ).getFirstElement();

        if ( selection instanceof MatchingRuleImpl )
        {
            MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );

            String[] names = mr.getNamesRef();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return mr.getName();
            }
            else
            {
                return mr.getOid();
            }
        }

        return null;
    }
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl

    {
        Object selection = ( ( StructuredSelection ) substringComboViewer.getSelection() ).getFirstElement();

        if ( selection instanceof MatchingRuleImpl )
        {
            MatchingRuleImpl mr = ( ( MatchingRuleImpl ) selection );

            String[] names = mr.getNamesRef();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return mr.getName();
            }
            else
            {
                return mr.getOid();
            }
        }

        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.