Package org.apache.directory.studio.entryeditors

Examples of org.apache.directory.studio.entryeditors.EntryEditorExtension


        try
        {
            String type = memento.getString( "TYPE" ); //$NON-NLS-1$
            String extensionId = memento.getString( "EXTENSION" ); //$NON-NLS-1$
            EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
            EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
            if ( "IEntry".equals( type ) ) //$NON-NLS-1$
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
                LdapDN dn = new LdapDN( memento.getString( "DN" ) ); //$NON-NLS-1$
View Full Code Here


        entryEditorsTableViewer.addSelectionChangedListener( new ISelectionChangedListener()
        {
            public void selectionChanged( SelectionChangedEvent event )
            {
                // Getting the selected entry editor
                EntryEditorExtension entryEditor = ( EntryEditorExtension ) ( ( StructuredSelection ) entryEditorsTableViewer
                    .getSelection() ).getFirstElement();
                if ( entryEditor != null )
                {
                    // Updating the description text field
                    descriptionText.setText( entryEditor.getDescription() );

                    // Updating the state of the buttons
                    updateButtonsState( entryEditor );
                }
            }
View Full Code Here

    private void moveSelectedEntryEditor( MoveEntryEditorDirectionEnum direction )
    {
        StructuredSelection selection = ( StructuredSelection ) entryEditorsTableViewer.getSelection();
        if ( selection.size() == 1 )
        {
            EntryEditorExtension entryEditor = ( EntryEditorExtension ) selection.getFirstElement();
            if ( sortedEntryEditorsList.contains( entryEditor ) )
            {
                int oldIndex = sortedEntryEditorsList.indexOf( entryEditor );
                int newIndex = 0;

                // Determining the new index number
                switch ( direction )
                {
                    case UP:
                        newIndex = oldIndex - 1;
                        break;
                    case DOWN:
                        newIndex = oldIndex + 1;
                        break;
                }

                // Checking bounds
                if ( ( newIndex >= 0 ) && ( newIndex < sortedEntryEditorsList.size() ) )
                {
                    // Switching the two entry editors
                    EntryEditorExtension newIndexEntryEditorBackup = sortedEntryEditorsList.set( newIndex, entryEditor );
                    sortedEntryEditorsList.set( oldIndex, newIndexEntryEditorBackup );

                    // Reloading the viewer
                    entryEditorsTableViewer.refresh();
View Full Code Here

    private void updateButtonsState()
    {
        StructuredSelection selection = ( StructuredSelection ) entryEditorsTableViewer.getSelection();
        if ( selection.size() == 1 )
        {
            EntryEditorExtension entryEditor = ( EntryEditorExtension ) selection.getFirstElement();

            // Updating the state of the buttons
            updateButtonsState( entryEditor );
        }
    }
View Full Code Here

                    && ( editor.getEntryEditorInput().getResolvedEntry() != null )
                    && ( editor.getEntryEditorInput().getExtension() != null )
                    && ( !editor.getEntryEditorInput().getExtension().isMultiWindow() ) )
                {

                    EntryEditorExtension extension = editor.getEntryEditorInput().getExtension();
                    String editorId = extension.getEditorId();
                    EntryEditorInput input = new EntryEditorInput( ( IEntry ) null, extension );
                    try
                    {
                        view.getSite().getPage().openEditor( input, editorId, false );
                    }
View Full Code Here

        try
        {
            String type = memento.getString( "TYPE" ); //$NON-NLS-1$
            String extensionId = memento.getString( "EXTENSION" ); //$NON-NLS-1$
            EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
            EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
            if ( "IEntry".equals( type ) ) //$NON-NLS-1$
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
                Dn dn = new Dn( memento.getString( "Dn" ) ); //$NON-NLS-1$
View Full Code Here

                    && ( editor.getEntryEditorInput().getResolvedEntry() != null )
                    && ( editor.getEntryEditorInput().getExtension() != null )
                    && ( !editor.getEntryEditorInput().getExtension().isMultiWindow() ) )
                {

                    EntryEditorExtension extension = editor.getEntryEditorInput().getExtension();
                    String editorId = extension.getEditorId();
                    EntryEditorInput input = new EntryEditorInput( ( IEntry ) null, extension );
                    try
                    {
                        view.getSite().getPage().openEditor( input, editorId, false );
                    }
View Full Code Here

        entryEditorsTableViewer.addSelectionChangedListener( new ISelectionChangedListener()
        {
            public void selectionChanged( SelectionChangedEvent event )
            {
                // Getting the selected entry editor
                EntryEditorExtension entryEditor = ( EntryEditorExtension ) ( ( StructuredSelection ) entryEditorsTableViewer
                    .getSelection() ).getFirstElement();
                if ( entryEditor != null )
                {
                    // Updating the description text field
                    descriptionText.setText( entryEditor.getDescription() );

                    // Updating the state of the buttons
                    updateButtonsState( entryEditor );
                }
            }
View Full Code Here

    private void moveSelectedEntryEditor( MoveEntryEditorDirectionEnum direction )
    {
        StructuredSelection selection = ( StructuredSelection ) entryEditorsTableViewer.getSelection();
        if ( selection.size() == 1 )
        {
            EntryEditorExtension entryEditor = ( EntryEditorExtension ) selection.getFirstElement();
            if ( sortedEntryEditorsList.contains( entryEditor ) )
            {
                int oldIndex = sortedEntryEditorsList.indexOf( entryEditor );
                int newIndex = 0;

                // Determining the new index number
                switch ( direction )
                {
                    case UP:
                        newIndex = oldIndex - 1;
                        break;
                    case DOWN:
                        newIndex = oldIndex + 1;
                        break;
                }

                // Checking bounds
                if ( ( newIndex >= 0 ) && ( newIndex < sortedEntryEditorsList.size() ) )
                {
                    // Switching the two entry editors
                    EntryEditorExtension newIndexEntryEditorBackup = sortedEntryEditorsList.set( newIndex, entryEditor );
                    sortedEntryEditorsList.set( oldIndex, newIndexEntryEditorBackup );

                    // Reloading the viewer
                    entryEditorsTableViewer.refresh();
View Full Code Here

    private void updateButtonsState()
    {
        StructuredSelection selection = ( StructuredSelection ) entryEditorsTableViewer.getSelection();
        if ( selection.size() == 1 )
        {
            EntryEditorExtension entryEditor = ( EntryEditorExtension ) selection.getFirstElement();

            // Updating the state of the buttons
            updateButtonsState( entryEditor );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.entryeditors.EntryEditorExtension

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.