Examples of AttributeTypeImpl


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

        String[] optionalATNames = oc.getMayNamesList();
        if ( ( mandatoryATNames != null ) && ( optionalATNames != null ) )
        {
            for ( String mandatoryATName : mandatoryATNames )
            {
                AttributeTypeImpl mandatoryAT = Activator.getDefault().getSchemaHandler().getAttributeType(
                    mandatoryATName );
                if ( mandatoryAT == null )
                {
                    SchemaError error = new NonExistingMandatoryATError( oc, mandatoryATName );
                    errorsList.add( error );
                    errorsMap.put( oc, error );
                    dependenciesMap.put( mandatoryATName, oc );
                    dependsOnMap.put( oc, mandatoryATName );
                }
                else
                {
                    dependenciesMap.put( mandatoryAT, oc );
                    dependsOnMap.put( oc, mandatoryAT );
                }
            }

            for ( String optionalATName : optionalATNames )
            {
                AttributeTypeImpl optionalAT = Activator.getDefault().getSchemaHandler().getAttributeType(
                    optionalATName );
                if ( optionalAT == null )
                {
                    SchemaError error = new NonExistingOptionalATError( oc, optionalATName );
                    errorsList.add( error );
View Full Code Here

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

                    }
                    for ( String attributeName : attributeNames )
                    {
                        if ( attributeName != null )
                        {
                            AttributeTypeImpl attributeType = sourceObjectClass.getSchemaObject().getProject()
                                .getSchemaHandler().getAttributeType( attributeName );
                            if ( attributeType != null )
                            {
                                mergeAttributeType( attributeType, targetProject, targetSchema, processedObjects,
                                    errorMessages, replaceUnknownSyntax, mergeDependencies, pullUpAttributes );
View Full Code Here

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

            public String getText( Object element )
            {
                if ( element instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl at = ( AttributeTypeImpl ) element;

                    String[] names = at.getNamesRef();
                    if ( ( names != null ) && ( names.length > 0 ) )
                    {
                        return NLS
                            .bind(
                                Messages.getString( "NewObjectClassMandatoryAttributesPage.AliasOID" ), new String[] { ViewUtils.concateAliases( names ), at.getOid() } ); //$NON-NLS-1$
                    }
                    else
                    {
                        return NLS
                            .bind(
                                Messages.getString( "NewObjectClassMandatoryAttributesPage.NoneOID" ), new String[] { at.getOid() } ); //$NON-NLS-1$
                    }
                }
                // Default
                return super.getText( element );
            }
View Full Code Here

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

                    Messages.getString( "SchemaEditorTableViewerLabelProvider.None" ), new String[] { oc.getOid() } ); //$NON-NLS-1$
            }
        }
        else if ( element instanceof AttributeTypeImpl )
        {
            AttributeTypeImpl at = ( AttributeTypeImpl ) element;

            String[] names = at.getNamesRef();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return ViewUtils.concateAliases( names ) + "  -  (" + at.getOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
            }
            else
            {
                return NLS.bind(
                    Messages.getString( "SchemaEditorTableViewerLabelProvider.None" ), new String[] { at.getOid() } ); //$NON-NLS-1$
            }
        }

        // Default
        return null;
View Full Code Here

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

     * @see org.eclipse.jface.wizard.Wizard#performFinish()
     */
    public boolean performFinish()
    {
        // Creating the new attribute type
        AttributeTypeImpl newAT = new AttributeTypeImpl( generalPage.getOidValue() );
        newAT.setSchema( generalPage.getSchemaValue() );
        newAT.setSchemaObject( Activator.getDefault().getSchemaHandler().getSchema( generalPage.getSchemaValue() ) );
        newAT.setNames( generalPage.getAliasesValue() );
        newAT.setDescription( generalPage.getDescriptionValue() );
        newAT.setSuperiorName( contentPage.getSuperiorValue() );
        newAT.setUsage( contentPage.getUsageValue() );
        newAT.setSyntaxOid( contentPage.getSyntax() );
        newAT.setLength( contentPage.getSyntaxLengthValue() );
        newAT.setObsolete( contentPage.getObsoleteValue() );
        newAT.setSingleValue( contentPage.getSingleValueValue() );
        newAT.setCollective( contentPage.getCollectiveValue() );
        newAT.setCanUserModify( !contentPage.getNoUserModificationValue() );
        newAT.setEqualityName( matchingRulesPage.getEqualityMatchingRuleValue() );
        newAT.setOrderingName( matchingRulesPage.getOrderingMatchingRuleValue() );
        newAT.setSubstrName( matchingRulesPage.getSubstringMatchingRuleValue() );

        // Adding the new attribute type
        Activator.getDefault().getSchemaHandler().addAttributeType( newAT );

        // Saving the Dialog Settings OID History
        PluginUtils.saveDialogSettingsHistory( PluginConstants.DIALOG_SETTINGS_OID_HISTORY, newAT.getOid() );

        return true;
    }
View Full Code Here

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

            public String getText( Object element )
            {
                if ( element instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl at = ( AttributeTypeImpl ) element;

                    String[] names = at.getNames();
                    if ( ( names != null ) && ( names.length > 0 ) )
                    {
                        return ViewUtils.concateAliases( names ) + "  -  (" + at.getOid() + ")";
                    }
                    else
                    {
                        return "(None)  -  (" + at.getOid() + ")";
                    }
                }
                // Default
                return super.getText( element );
            }
View Full Code Here

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

            public void widgetSelected( SelectionEvent arg0 )
            {
                AttributeTypeSelectionDialog dialog = new AttributeTypeSelectionDialog();
                if ( dialog.open() == Dialog.OK )
                {
                    AttributeTypeImpl selectedAT = dialog.getSelectedAttributeType();
                    String[] aliases = selectedAT.getNames();
                    if ( ( aliases != null ) && ( aliases.length > 0 ) )
                    {
                        superiorText.setText( aliases[0] );
                    }
                    else
                    {
                        superiorText.setText( selectedAT.getOid() );
                    }
                }
            }
        } );
View Full Code Here

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

        }
        else if ( element instanceof AttributeTypeDifference )
        {
            AttributeTypeDifference atd = ( AttributeTypeDifference ) element;

            AttributeTypeImpl at = null;

            switch ( atd.getType() )
            {
                case ADDED:
                    at = ( ( AttributeTypeImpl ) atd.getDestination() );
                    break;
                case MODIFIED:
                    at = ( ( AttributeTypeImpl ) atd.getDestination() );
                    break;
                case REMOVED:
                    at = ( ( AttributeTypeImpl ) atd.getSource() );
                    break;
                case IDENTICAL:
                    at = ( ( AttributeTypeImpl ) atd.getDestination() );
                    break;
            }

            // Label
            if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
            {
                String[] names = at.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = names[0];
                }
                else
                {
                    label = NONE;
                }
            }
            else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
            {
                String[] names = at.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = ViewUtils.concateAliases( names );
                }
                else
                {
                    label = NONE;
                }
            }
            else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_OID )
            {
                label = at.getOid();
            }
            else
            // Default
            {
                String[] names = at.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = names[0];
                }
                else
                {
                    label = NONE;
                }
            }

            // Abbreviate
            if ( abbreviate && ( abbreviateMaxLength < label.length() ) )
            {
                label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
            }
        }
        else if ( element instanceof ObjectClassDifference )
        {
            ObjectClassDifference ocd = ( ObjectClassDifference ) element;

            ObjectClassImpl oc = null;

            switch ( ocd.getType() )
            {
                case ADDED:
                    oc = ( ( ObjectClassImpl ) ocd.getDestination() );
                    break;
                case MODIFIED:
                    oc = ( ( ObjectClassImpl ) ocd.getDestination() );
                    break;
                case REMOVED:
                    oc = ( ( ObjectClassImpl ) ocd.getSource() );
                    break;
                case IDENTICAL:
                    oc = ( ( ObjectClassImpl ) ocd.getDestination() );
                    break;
            }

            // Label
            if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
            {
                String[] names = oc.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = names[0];
                }
                else
                {
                    label = NONE;
                }
            }
            else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
            {
                String[] names = oc.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = ViewUtils.concateAliases( names );
                }
                else
                {
                    label = NONE;
                }
            }
            else if ( labelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_OID )
            {
                label = oc.getOid();
            }
            else
            // Default
            {
                String[] names = oc.getNames();
                if ( ( names != null ) && ( names.length > 0 ) )
                {
                    label = names[0];
                }
                else
                {
                    label = NONE;
                }
            }

            // Abbreviate
            if ( abbreviate && ( abbreviateMaxLength < label.length() ) )
            {
                label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
            }
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;

            return folder.getName() + " (" + folder.getChildren().size() + ")";
        }

        // Secondary Label
        if ( secondaryLabelDisplay )
        {
            String secondaryLabel = ""; //$NON-NLS-1$
            if ( element instanceof AttributeTypeDifference )
            {
                AttributeTypeDifference atd = ( AttributeTypeDifference ) element;

                AttributeTypeImpl at = null;

                switch ( atd.getType() )
                {
                    case ADDED:
                        at = ( ( AttributeTypeImpl ) atd.getDestination() );
                        break;
                    case MODIFIED:
                        at = ( ( AttributeTypeImpl ) atd.getDestination() );
                        break;
                    case REMOVED:
                        at = ( ( AttributeTypeImpl ) atd.getSource() );
                        break;
                    case IDENTICAL:
                        at = ( ( AttributeTypeImpl ) atd.getDestination() );
                        break;
                }

                if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_FIRST_NAME )
                {
                    String[] names = at.getNames();
                    if ( ( names != null ) && ( names.length > 0 ) )
                    {
                        secondaryLabel = names[0];
                    }
                    else
                    {
                        secondaryLabel = NONE;
                    }
                }
                else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_ALL_ALIASES )
                {
                    String[] names = at.getNames();
                    if ( ( names != null ) && ( names.length > 0 ) )
                    {
                        secondaryLabel = ViewUtils.concateAliases( names );
                    }
                    else
                    {
                        secondaryLabel = NONE;
                    }
                }
                else if ( secondaryLabelValue == PluginConstants.PREFS_SCHEMA_VIEW_LABEL_OID )
                {
                    secondaryLabel = at.getOid();
                }
            }
            else if ( element instanceof ObjectClassDifference )
            {
                ObjectClassDifference ocd = ( ObjectClassDifference ) element;
View Full Code Here

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

     */
    public String getText( Object element )
    {
        if ( element instanceof AttributeTypeImpl )
        {
            AttributeTypeImpl at = ( AttributeTypeImpl ) element;

            String[] names = at.getNames();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return ViewUtils.concateAliases( names ) + "  -  (" + at.getOid() + ")";
            }
            else
            {
                return "(None)  -  (" + at.getOid() + ")";
            }
        }

        // Default
        return null;
View Full Code Here

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

     */
    public String getColumnText( Object element, int columnIndex )
    {
        if ( element instanceof AttributeTypeImpl )
        {
            AttributeTypeImpl at = ( AttributeTypeImpl ) element;

            String[] names = at.getNames();
            if ( ( names != null ) && ( names.length > 0 ) )
            {
                return ViewUtils.concateAliases( names ) + "  -  (" + at.getOid() + ")";
            }
            else
            {
                return "(None)  -  (" + at.getOid() + ")";
            }
        }
        else if ( element instanceof NonExistingAttributeType )
        {
            return ( ( NonExistingAttributeType ) element ).getDisplayName();
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.