Package org.apache.directory.ldapstudio.schemas.model

Examples of org.apache.directory.ldapstudio.schemas.model.ObjectClass


    {
        hiddenObjectClasses = new ArrayList<ObjectClass>();

        for ( String name : names )
        {
            ObjectClass oc = schemaPool.getObjectClass( name );
            if ( oc != null )
            {
                hiddenObjectClasses.add( oc );
            }
        }
View Full Code Here


        int mode = Activator.getDefault().getDialogSettings().getInt( PluginConstants.PREFS_HIERARCHY_VIEW_MODE );
        List<ITreeNode> children = null;

        if ( parentElement instanceof ObjectClass )
        {
            ObjectClass oc = ( ObjectClass ) parentElement;

            ObjectClassWrapper ocw = new ObjectClassWrapper( oc, null );
            children = new ArrayList<ITreeNode>();
            children.add( ocw );
        }
        else if ( parentElement instanceof AttributeType )
        {
            AttributeType at = ( AttributeType ) parentElement;

            AttributeTypeWrapper atw = new AttributeTypeWrapper( at, null );
            children = new ArrayList<ITreeNode>();
            children.add( atw );
        }
        else if ( parentElement instanceof ObjectClassWrapper )
        {
            ObjectClassWrapper ocw = ( ObjectClassWrapper ) parentElement;
            ObjectClass oc = ocw.getMyObjectClass();

            if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE )
            {
                String[] superiors = oc.getSuperiors();
                for ( String superior : superiors )
                {
                    if ( superior != null || "".equals( superior ) ) //$NON-NLS-1$
                    {
                        ObjectClass supOC = schemaPool.getObjectClass( superior );
                        if ( supOC != null )
                        {
                            ObjectClassWrapper supOCW = new ObjectClassWrapper( supOC, ocw );
                            ocw.addChild( supOCW );
                        }
                    }
                }
            }
            else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUBTYPE )
            {
                for ( ObjectClass objectClass : objectClasses )
                {
                    String[] superiors = objectClass.getSuperiors();
                    for ( String superior : superiors )
                    {
                        if ( superior != null || "".equals( superior ) ) //$NON-NLS-1$
                        {
                            ObjectClass supOC = schemaPool.getObjectClass( superior );
                            if ( supOC != null && oc.equals( supOC ) )
                            {
                                ObjectClassWrapper supOCW = new ObjectClassWrapper( objectClass, ocw );
                                ocw.addChild( supOCW );
                            }
View Full Code Here

            return at1.getNames()[0].compareToIgnoreCase( at2.getNames()[0] );
        }
        else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
        {
            ObjectClass oc1 = ( ( ObjectClassWrapper ) o1 ).getMyObjectClass();
            ObjectClass oc2 = ( ( ObjectClassWrapper ) o2 ).getMyObjectClass();

            return oc1.getNames()[0].compareToIgnoreCase( oc2.getNames()[0] );
        }

        // Default
        return o1.toString().compareToIgnoreCase( o2.toString() );
    }
View Full Code Here

            return at1.getOid().compareToIgnoreCase( at2.getOid() );
        }
        else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
        {
            ObjectClass oc1 = ( ( ObjectClassWrapper ) o1 ).getMyObjectClass();
            ObjectClass oc2 = ( ( ObjectClassWrapper ) o2 ).getMyObjectClass();

            return oc1.getOid().compareToIgnoreCase( oc2.getOid() );
        }

        // Default
        return o1.toString().compareToIgnoreCase( o2.toString() );
    }
View Full Code Here

        ObjectClassLiteral objectClassLiteral = new ObjectClassLiteral( this.page.getOidField() );
        objectClassLiteral.setNames( new String[]
            { this.page.getNameField() } );
        objectClassLiteral.setSuperiors( new String[]
            { "top" } ); //$NON-NLS-1$
        ObjectClass objectClass = new ObjectClass( objectClassLiteral, schema );
        schema.addObjectClass( objectClass );

        // Opening the associated editor
        ObjectClassEditorInput input = new ObjectClassEditorInput( objectClass );
        String editorId = ObjectClassEditor.ID;
View Full Code Here

     */
    public String getColumnText( Object element, int columnIndex )
    {
        if ( element instanceof ObjectClassWrapper )
        {
            ObjectClass oc = ( ( ObjectClassWrapper ) element ).getMyObjectClass();
            return ViewUtils.concateAliases( oc.getNames() ) + "   [" + oc.getOid() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
        }

        // Default
        return null;
    }
View Full Code Here

            List<Object> results = new ArrayList<Object>();

            String[] superiors = ( String[] ) inputElement;
            for ( String superior : superiors )
            {
                ObjectClass oc = schemaPool.getObjectClass( superior );
                if ( oc != null )
                {
                    results.add( oc );
                }
                else
View Full Code Here

                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_OPERATION ), IDecoration.BOTTOM_RIGHT );
            }
        }
        else if ( element instanceof ObjectClass )
        {
            ObjectClass oc = ( ObjectClass ) element;

            ObjectClassTypeEnum classType = oc.getClassType();

            if ( classType == ObjectClassTypeEnum.ABSTRACT )
            {
                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_ABSTRACT ), IDecoration.BOTTOM_RIGHT );
View Full Code Here

                    schema.removeAttributeType( attributeType );
                }
            }
            else if ( item == DeleteAction.ItemType.objectClass )
            {
                ObjectClass objectClass = ( ( ObjectClassWrapper ) selection ).getMyObjectClass();
                MessageBox messageBox = new MessageBox(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.CANCEL
                        | SWT.ICON_QUESTION );
                messageBox
                    .setMessage( Messages.getString( "DeleteAction.Are_you_sure_you_want_to_delete_the_object_class" ) + objectClass.getNames()[0] + Messages.getString( "DeleteAction.Interrogation" ) ); //$NON-NLS-1$ //$NON-NLS-2$
                if ( messageBox.open() == SWT.OK )
                {
                    schema.removeObjectClass( objectClass );
                }
            }
View Full Code Here

        for ( ObjectClass oc : schema.getObjectClassesAsArray() )
        {
            // Superiors
            for ( String supName : oc.getSuperiors() )
            {
                ObjectClass sup = schemaPool.getObjectClass( supName );
                if ( sup != null )
                {
                    if ( !schema.equals( sup.getOriginatingSchema() ) )
                    {
                        schemaNames.add( sup.getOriginatingSchema().getName() );
                    }
                }
            }

            // Mays
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.schemas.model.ObjectClass

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.