Package org.apache.directory.ldapstudio.browser.ui.editors.entry

Examples of org.apache.directory.ldapstudio.browser.ui.editors.entry.EntryEditor


        {
            Object objectToSelect = null;

            if ( part instanceof EntryEditor )
            {
                EntryEditor editor = ( EntryEditor ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    IEntry entry = eei.getResolvedEntry();
                    if ( entry != null )
                    {
                        objectToSelect = entry.getConnection();
                    }
                }
            }
            else if ( part instanceof SearchResultEditor )
            {
                SearchResultEditor editor = ( SearchResultEditor ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof SearchResultEditorInput )
                {
                    SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
                    ISearch search = srei.getSearch();
                    if ( search != null )
View Full Code Here


        {
            Object objectToSelect = null;

            if ( part instanceof EntryEditor )
            {
                EntryEditor editor = ( EntryEditor ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    objectToSelect = eei.getInput();
                }
            }
            else if ( part instanceof SearchResultEditor )
            {
                SearchResultEditor editor = ( SearchResultEditor ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof SearchResultEditorInput )
                {
                    SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
                    objectToSelect = srei.getSearch();
                }
View Full Code Here

                        }
                    }
                }
                else if ( editorPart instanceof EntryEditor )
                {
                    EntryEditor entryEditor = ( EntryEditor ) editorPart;
                    if ( !event.getSelection().isEmpty() && event.getSelection() instanceof IStructuredSelection )
                    {

                        Object o = entryEditor.getMainWidget().getViewer().getInput();
                        if ( o != null && o instanceof IEntry )
                        {
                            IEntry entry = ( IEntry ) o;
                            IAttribute[] attributes = entry.getAttributes();

                            List selectionList = new ArrayList();

                            Iterator it = ( ( IStructuredSelection ) event.getSelection() ).iterator();
                            while ( it.hasNext() )
                            {
                                Object element = it.next();

                                if ( element instanceof LdifAttrValLine )
                                {
                                    // select the value
                                    LdifAttrValLine line = ( LdifAttrValLine ) element;
                                    for ( int a = 0; a < attributes.length; a++ )
                                    {
                                        IAttribute attribute = attributes[a];
                                        if ( attribute.getDescription().equals( line.getUnfoldedAttributeDescription() ) )
                                        {
                                            IValue[] values = attribute.getValues();
                                            for ( int v = 0; v < values.length; v++ )
                                            {
                                                IValue value = values[v];
                                                if ( value.getStringValue().equals( line.getValueAsString() ) )
                                                {
                                                    selectionList.add( value );
                                                }
                                            }
                                        }
                                    }
                                }
                                else if ( element instanceof List )
                                {
                                    // select attribute and all values
                                    List list = ( List ) element;
                                    if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                                    {
                                        LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
                                        for ( int a = 0; a < attributes.length; a++ )
                                        {
                                            IAttribute attribute = attributes[a];
                                            if ( attribute.getDescription().equals(
                                                line.getUnfoldedAttributeDescription() ) )
                                            {
                                                selectionList.add( attribute );
                                                selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                            }
                                        }
                                    }
                                }
                                else if ( element instanceof LdifRecord )
                                {
                                    for ( int a = 0; a < attributes.length; a++ )
                                    {
                                        IAttribute attribute = attributes[a];
                                        selectionList.add( attribute );
                                        selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                    }
                                }
                            }

                            IStructuredSelection selection = new StructuredSelection( selectionList );
                            entryEditor.getMainWidget().getViewer().setSelection( selection );
                        }
                    }
                }
            }
        } );
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.ui.editors.entry.EntryEditor

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.