Package org.apache.directory.ldapstudio.schemas.view.views.wrappers

Examples of org.apache.directory.ldapstudio.schemas.view.views.wrappers.ITreeNode


     */
    private void aTOrOCAdded( SchemaPool p, LDAPModelEvent e )
    {
        SchemaElement element = ( SchemaElement ) e.getNewValue();

        ITreeNode parentNode = findParentElement( element );
        if ( parentNode == null )
        {
            return;
        }

        // Forcing the load of the children
        getChildren( parentNode );

        // Creating and adding the new element
        ITreeNode newElement = null;
        if ( element instanceof AttributeType )
        {
            newElement = new AttributeTypeWrapper( ( AttributeType ) element, parentNode );
        }
        else if ( element instanceof ObjectClass )
View Full Code Here


     */
    private void aTOrOCModified( SchemaPool p, LDAPModelEvent e )
    {
        SchemaElement element = ( SchemaElement ) e.getNewValue();

        ITreeNode parentNode = findParentElement( element );
        if ( parentNode == null )
        {
            return;
        }

        ITreeNode fakeNode = null;
        if ( element instanceof ObjectClass )
        {
            fakeNode = new ObjectClassWrapper( ( ObjectClass ) element, null );
        }
        else if ( element instanceof AttributeType )
        {
            fakeNode = new AttributeTypeWrapper( ( AttributeType ) element, null );
        }

        ITreeNode realNode = null;
        Object[] children = getChildren( parentNode );
        for ( Object child : children )
        {
            if ( child.equals( fakeNode ) )
            {
View Full Code Here

     */
    private void aTOrOCRemoved( SchemaPool p, LDAPModelEvent e )
    {
        SchemaElement element = ( SchemaElement ) e.getOldValue();

        ITreeNode parentNode = findParentElement( element );
        if ( parentNode == null )
        {
            return;
        }

        ITreeNode fakeNode = null;
        if ( element instanceof ObjectClass )
        {
            ( ( ObjectClass ) element ).closeAssociatedEditor();
            fakeNode = new ObjectClassWrapper( ( ObjectClass ) element, null );
        }
        else if ( element instanceof AttributeType )
        {
            ( ( AttributeType ) element ).closeAssociatedEditor();
            fakeNode = new AttributeTypeWrapper( ( AttributeType ) element, null );
        }

        ITreeNode realNode = null;
        Object[] children = getChildren( parentNode );
        for ( Object child : children )
        {
            if ( child.equals( fakeNode ) )
            {
                realNode = ( ITreeNode ) child;
                break;
            }
        }

        if ( realNode != null )
        {
            realNode.getParent().removeChild( realNode );
            viewer.refresh( realNode.getParent() );
        }
    }
View Full Code Here

    {
        int group = Activator.getDefault().getPreferenceStore().getInt( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING );

        // Finding the associated SchemaWrapper
        SchemaWrapper fakeSchemaWrapper = new SchemaWrapper( element.getOriginatingSchema(), null );
        ITreeNode realSchemaWrapper = findSchemaWrapperInTree( fakeSchemaWrapper );
        if ( realSchemaWrapper == null )
        {
            return null;
        }

        // Finding the correct node
        ITreeNode parentNode = null;
        if ( group == PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS )
        {
            Object[] children = getChildren( realSchemaWrapper );
            for ( Object child : children )
            {
View Full Code Here

        if ( element == null )
        {
            return null;
        }

        ITreeNode input = ( ITreeNode ) getViewer().getInput();

        return findElementInTree( element, input );
    }
View Full Code Here

        else
        {
            Object[] children = contentProvider.getChildren( node );
            for ( Object child : children )
            {
                ITreeNode foundElement = findElementInTree( element, ( ITreeNode ) child );
                if ( foundElement != null )
                {
                    return foundElement;
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.schemas.view.views.wrappers.ITreeNode

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.