Examples of EntryEditor


Examples of net.sf.jabref.EntryEditor

    // construct an EntryEditor ...
    JabRef jabref = TestUtils.getInitializedJabRef();
    BibtexEntry bibtexEntry = new BibtexEntry();
    bibtexEntry.setField("author", "Brigitte Laurant");
    FieldEditor authorTextField = new FieldTextArea("author", "Hans Meiser");
    EntryEditor editor = new EntryEditor(jabref.jrf, jabref.jrf.basePanel(), bibtexEntry);
    // perform action ...
    editor.storeFieldAction.actionPerformed(new ActionEvent(authorTextField, 0, ""));
    // test content of stored words in autocompleter ...
    AbstractAutoCompleter autoCompleter = jabref.jrf.basePanel().getAutoCompleter("author");
    assertTrue(autoCompleter.indexContainsWord("Hans Meiser"));
View Full Code Here

Examples of net.sf.jabref.EntryEditor

    // construct an EntryEditor ...
    JabRef jabref = TestUtils.getInitializedJabRef();
    BibtexEntry bibtexEntry = new BibtexEntry();
    bibtexEntry.setField("journal", "Testtext");
    FieldEditor authorTextField = new FieldTextArea("journal", "New Testtext");
    EntryEditor editor = new EntryEditor(jabref.jrf, jabref.jrf.basePanel(), bibtexEntry);
    // perform action ...
    editor.storeFieldAction.actionPerformed(new ActionEvent(authorTextField, 0, ""));
    // test content of stored words in autocompleter ...
    AbstractAutoCompleter autoCompleter = jabref.jrf.basePanel().getAutoCompleter("journal");
    assertTrue(autoCompleter.indexContainsWord("New Testtext"));
View Full Code Here

Examples of net.sf.jabref.EntryEditor

            // Ok, we have a single new entry that has been selected. Now decide what to do with it:
            final BibtexEntry toShow = (BibtexEntry) newSelected;
            final int mode = panel.getMode(); // What is the panel already showing?
            if ((mode == BasePanel.WILL_SHOW_EDITOR) || (mode == BasePanel.SHOWING_EDITOR)) {
                // An entry is currently being edited.
                EntryEditor oldEditor = panel.getCurrentEditor();
                String visName = null;
                if (oldEditor != null) {
                    visName = oldEditor.getVisiblePanelName();
                }
                // Get an old or new editor for the entry to edit:
                EntryEditor newEditor = panel.getEntryEditor(toShow);

                if ((oldEditor != null))// && (oldEditor != newEditor))
                    oldEditor.setMovingToDifferentEntry();

                // Show the new editor unless it was already visible:
                if ((newEditor != oldEditor) || (mode != BasePanel.SHOWING_EDITOR)) {
                   
                    if (visName != null)
                        newEditor.setVisiblePanel(visName);
                    panel.showEntryEditor(newEditor);
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            table.ensureVisible(table.getSelectedRow());
                        }
View Full Code Here

Examples of net.sf.jabref.EntryEditor

        }
    }

    public void editSignalled(BibtexEntry entry) {
        final int mode = panel.getMode();
        EntryEditor editor = panel.getEntryEditor(entry);
        if (mode != BasePanel.SHOWING_EDITOR) {
            panel.showEntryEditor(editor);
            panel.adjustSplitter();
        }
        new FocusRequester(editor);
View Full Code Here

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

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;
                    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

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

                        }
                    }
                }
                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

Examples of org.apache.directory.studio.ldapbrowser.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.getBrowserConnection().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

Examples of org.apache.directory.studio.ldapbrowser.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;
                    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
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.