directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r987577 [8/10] - in /directory/studio/branches/studio-rap/plugins: common.ui/src/main/java/org/apache/directory/studio/common/ui/ connection.ui/src/main/java/org/apache/directory/studio/connection/ui/ connection.ui/src/main/java/org/apache/...
Date Fri, 20 Aug 2010 17:07:23 GMT
Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java Fri Aug 20 17:07:19 2010
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.ldifeditor.editor;
 
 
+import java.awt.FileDialog;
 import java.io.File;
 import java.util.ResourceBundle;
 
@@ -68,13 +69,6 @@ import org.eclipse.jface.action.ToolBarM
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.projection.ProjectionSupport;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
@@ -83,7 +77,6 @@ import org.eclipse.swt.layout.FillLayout
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.ToolBar;
 import org.eclipse.ui.IEditorInput;
@@ -97,15 +90,8 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.contexts.IContextActivation;
 import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.part.EditorPart;
 import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.texteditor.ChainedPreferenceStore;
-import org.eclipse.ui.texteditor.ContentAssistAction;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 
 
@@ -114,7 +100,7 @@ import org.eclipse.ui.views.contentoutli
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdifEditor extends TextEditor implements ILdifEditor, ConnectionUpdateListener, IPartListener2
+public class LdifEditor extends EditorPart implements ILdifEditor, ConnectionUpdateListener, IPartListener2
 {
     private ViewForm control;
 
@@ -126,7 +112,7 @@ public class LdifEditor extends TextEdit
 
     private IBrowserConnection browserConnection;
 
-    private ProjectionSupport projectionSupport;
+//    private ProjectionSupport projectionSupport;
 
     protected LdifOutlinePage outlinePage;
 
@@ -148,16 +134,16 @@ public class LdifEditor extends TextEdit
     {
         super();
 
-        setSourceViewerConfiguration( new LdifSourceViewerConfiguration( this, true ) );
-        setDocumentProvider( new LdifDocumentProvider() );
-
-        IPreferenceStore editorStore = EditorsUI.getPreferenceStore();
-        IPreferenceStore browserStore = LdifEditorActivator.getDefault().getPreferenceStore();
-        IPreferenceStore combinedStore = new ChainedPreferenceStore( new IPreferenceStore[]
-            { browserStore, editorStore } );
-        setPreferenceStore( combinedStore );
-
-        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" ); //$NON-NLS-1$ //$NON-NLS-2$
+//        setSourceViewerConfiguration( new LdifSourceViewerConfiguration( this, true ) );
+//        setDocumentProvider( new LdifDocumentProvider() );
+//
+//        IPreferenceStore editorStore = EditorsUI.getPreferenceStore();
+//        IPreferenceStore browserStore = LdifEditorActivator.getDefault().getPreferenceStore();
+//        IPreferenceStore combinedStore = new ChainedPreferenceStore( new IPreferenceStore[]
+//            { browserStore, editorStore } );
+//        setPreferenceStore( combinedStore );
+//
+//        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" ); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
 
@@ -166,24 +152,24 @@ public class LdifEditor extends TextEdit
      */
     protected void handlePreferenceStoreChanged( PropertyChangeEvent event )
     {
-        try
-        {
-
-            ISourceViewer sourceViewer = getSourceViewer();
-            if ( sourceViewer == null )
-            {
-                return;
-            }
-
-            int topIndex = getSourceViewer().getTopIndex();
-            getSourceViewer().getDocument().set( getSourceViewer().getDocument().get() );
-            getSourceViewer().setTopIndex( topIndex );
-
-        }
-        finally
-        {
-            super.handlePreferenceStoreChanged( event );
-        }
+//        try
+//        {
+//
+//            ISourceViewer sourceViewer = getSourceViewer();
+//            if ( sourceViewer == null )
+//            {
+//                return;
+//            }
+//
+//            int topIndex = getSourceViewer().getTopIndex();
+//            getSourceViewer().getDocument().set( getSourceViewer().getDocument().get() );
+//            getSourceViewer().setTopIndex( topIndex );
+//
+//        }
+//        finally
+//        {
+//            super.handlePreferenceStoreChanged( event );
+//        }
     }
 
 
@@ -192,14 +178,15 @@ public class LdifEditor extends TextEdit
      */
     protected String[] collectContextMenuPreferencePages()
     {
-        String[] ids = super.collectContextMenuPreferencePages();
-        String[] more = new String[ids.length + 4];
-        more[0] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR;
-        more[1] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_CONTENTASSIST;
-        more[2] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_SYNTAXCOLORING;
-        more[3] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_TEMPLATES;
-        System.arraycopy( ids, 0, more, 4, ids.length );
-        return more;
+//        String[] ids = super.collectContextMenuPreferencePages();
+//        String[] more = new String[ids.length + 4];
+//        more[0] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR;
+//        more[1] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_CONTENTASSIST;
+//        more[2] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_SYNTAXCOLORING;
+//        more[3] = LdifEditorConstants.PREFERENCEPAGEID_LDIFEDITOR_TEMPLATES;
+//        System.arraycopy( ids, 0, more, 4, ids.length );
+//        return more;
+    	return null;
     }
 
 
@@ -248,7 +235,7 @@ public class LdifEditor extends TextEdit
             }
         }
 
-        super.init( site, input );
+//        super.init( site, input );
 
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionUIPlugin.getDefault().getEventRunner() );
         getSite().getPage().addPartListener( this );
@@ -297,32 +284,32 @@ public class LdifEditor extends TextEdit
             }
             return outlinePage;
         }
-        if ( ISourceViewer.class.equals( required ) )
-        {
-            return getSourceViewer();
-        }
-        if ( IAnnotationHover.class.equals( required ) )
-        {
-            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
-                return getSourceViewerConfiguration().getAnnotationHover( getSourceViewer() );
-        }
-        if ( ITextHover.class.equals( required ) )
-        {
-            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
-                return getSourceViewerConfiguration().getTextHover( getSourceViewer(), null );
-        }
-        if ( IContentAssistProcessor.class.equals( required ) )
-        {
-            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
-                return getSourceViewerConfiguration().getContentAssistant( getSourceViewer() )
-                    .getContentAssistProcessor( LdifPartitionScanner.LDIF_RECORD );
-        }
-        if ( projectionSupport != null )
-        {
-            Object adapter = projectionSupport.getAdapter( getSourceViewer(), required );
-            if ( adapter != null )
-                return adapter;
-        }
+//        if ( ISourceViewer.class.equals( required ) )
+//        {
+//            return getSourceViewer();
+//        }
+//        if ( IAnnotationHover.class.equals( required ) )
+//        {
+//            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
+//                return getSourceViewerConfiguration().getAnnotationHover( getSourceViewer() );
+//        }
+//        if ( ITextHover.class.equals( required ) )
+//        {
+//            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
+//                return getSourceViewerConfiguration().getTextHover( getSourceViewer(), null );
+//        }
+//        if ( IContentAssistProcessor.class.equals( required ) )
+//        {
+//            if ( getSourceViewerConfiguration() != null && getSourceViewer() != null )
+//                return getSourceViewerConfiguration().getContentAssistant( getSourceViewer() )
+//                    .getContentAssistProcessor( LdifPartitionScanner.LDIF_RECORD );
+//        }
+//        if ( projectionSupport != null )
+//        {
+//            Object adapter = projectionSupport.getAdapter( getSourceViewer(), required );
+//            if ( adapter != null )
+//                return adapter;
+//        }
         return super.getAdapter( required );
     }
 
@@ -332,29 +319,29 @@ public class LdifEditor extends TextEdit
      */
     protected void editorContextMenuAboutToShow( IMenuManager menu )
     {
-        super.editorContextMenuAboutToShow( menu );
+//        super.editorContextMenuAboutToShow( menu );
 
         IContributionItem[] items = menu.getItems();
         for ( int i = 0; i < items.length; i++ )
         {
             if ( items[i] instanceof ActionContributionItem )
             {
-                ActionContributionItem aci = ( ActionContributionItem ) items[i];
-                if ( aci.getAction() == getAction( ITextEditorActionConstants.SHIFT_LEFT ) )
-                {
-                    menu.remove( items[i] );
-                }
-                if ( aci.getAction() == getAction( ITextEditorActionConstants.SHIFT_RIGHT ) )
-                {
-                    menu.remove( items[i] );
-                }
+//                ActionContributionItem aci = ( ActionContributionItem ) items[i];
+//                if ( aci.getAction() == getAction( ITextEditorActionConstants.SHIFT_LEFT ) )
+//                {
+//                    menu.remove( items[i] );
+//                }
+//                if ( aci.getAction() == getAction( ITextEditorActionConstants.SHIFT_RIGHT ) )
+//                {
+//                    menu.remove( items[i] );
+//                }
             }
         }
 
         // add Edit actions
-        addAction( menu, ITextEditorActionConstants.GROUP_EDIT,
-            LdifEditorConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
-        addAction( menu, ITextEditorActionConstants.GROUP_EDIT, BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
+//        addAction( menu, ITextEditorActionConstants.GROUP_EDIT,
+//            LdifEditorConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
+//        addAction( menu, ITextEditorActionConstants.GROUP_EDIT, BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
 
         MenuManager valueEditorMenuManager = new MenuManager( Messages.getString( "LdifEditor.EditValueWith" ) ); //$NON-NLS-1$
         if ( this.openBestValueEditorAction.isEnabled() )
@@ -375,15 +362,15 @@ public class LdifEditor extends TextEdit
         }
         valueEditorMenuManager.add( new Separator() );
         valueEditorMenuManager.add( this.valueEditorPreferencesAction );
-        menu.appendToGroup( ITextEditorActionConstants.GROUP_EDIT, valueEditorMenuManager );
-
-        addAction( menu, ITextEditorActionConstants.GROUP_EDIT, LdifEditorConstants.ACTION_ID_EDIT_RECORD );
+//        menu.appendToGroup( ITextEditorActionConstants.GROUP_EDIT, valueEditorMenuManager );
+//
+//        addAction( menu, ITextEditorActionConstants.GROUP_EDIT, LdifEditorConstants.ACTION_ID_EDIT_RECORD );
 
         // add Format actions
         MenuManager formatMenuManager = new MenuManager( Messages.getString( "LdifEditor.Format" ) ); //$NON-NLS-1$
-        addAction( formatMenuManager, LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT );
-        addAction( formatMenuManager, LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD );
-        menu.appendToGroup( ITextEditorActionConstants.GROUP_EDIT, formatMenuManager );
+//        addAction( formatMenuManager, LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT );
+//        addAction( formatMenuManager, LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD );
+//        menu.appendToGroup( ITextEditorActionConstants.GROUP_EDIT, formatMenuManager );
     }
 
 
@@ -392,26 +379,26 @@ public class LdifEditor extends TextEdit
      */
     protected void createActions()
     {
-        super.createActions();
+//        super.createActions();
 
         // add content assistant
         ResourceBundle bundle = LdifEditorActivator.getDefault().getResourceBundle();
-        IAction action = new ContentAssistAction( bundle, "ldifeditor__contentassistproposal_", this ); //$NON-NLS-1$
-        action.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
-        setAction( "ContentAssistProposal", action ); //$NON-NLS-1$
+//        IAction action = new ContentAssistAction( bundle, "ldifeditor__contentassistproposal_", this ); //$NON-NLS-1$
+//        action.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
+//        setAction( "ContentAssistProposal", action ); //$NON-NLS-1$
 
         // add execute action (for tool bar)
         if ( actionToolBarManager != null )
         {
             ExecuteLdifAction executeLdifAction = new ExecuteLdifAction( this );
             actionToolBarManager.add( executeLdifAction );
-            setAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF, executeLdifAction );
+//            setAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF, executeLdifAction );
             actionToolBarManager.update( true );
         }
 
         // add context menu edit actions
         EditLdifAttributeAction editLdifAttributeAction = new EditLdifAttributeAction( this );
-        setAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION, editLdifAttributeAction );
+//        setAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION, editLdifAttributeAction );
 
         openBestValueEditorAction = new OpenBestValueEditorAction( this );
         IValueEditor[] valueEditors = valueEditorManager.getAllValueEditors();
@@ -424,38 +411,38 @@ public class LdifEditor extends TextEdit
 
         OpenDefaultValueEditorAction openDefaultValueEditorAction = new OpenDefaultValueEditorAction( this,
             openBestValueEditorAction );
-        setAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE, openDefaultValueEditorAction );
+//        setAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE, openDefaultValueEditorAction );
 
         EditLdifRecordAction editRecordAction = new EditLdifRecordAction( this );
-        setAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD, editRecordAction );
+//        setAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD, editRecordAction );
 
         // add context menu format actions
         FormatLdifDocumentAction formatDocumentAction = new FormatLdifDocumentAction( this );
-        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT, formatDocumentAction );
+//        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT, formatDocumentAction );
         FormatLdifRecordAction formatRecordAction = new FormatLdifRecordAction( this );
-        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD, formatRecordAction );
+//        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD, formatRecordAction );
 
         // update cut, copy, paste
-        IAction cutAction = getAction( ITextEditorActionConstants.CUT );
-        if ( cutAction != null )
-        {
-            cutAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
-                ISharedImages.IMG_TOOL_CUT ) );
-        }
-        IAction copyAction = getAction( ITextEditorActionConstants.COPY );
-        if ( copyAction != null )
-        {
-            copyAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
-                ISharedImages.IMG_TOOL_COPY ) );
-        }
-        IAction pasteAction = getAction( ITextEditorActionConstants.PASTE );
-        if ( pasteAction != null )
-        {
-            pasteAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
-                ISharedImages.IMG_TOOL_PASTE ) );
-        }
+//        IAction cutAction = getAction( ITextEditorActionConstants.CUT );
+//        if ( cutAction != null )
+//        {
+//            cutAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+//                ISharedImages.IMG_TOOL_CUT ) );
+//        }
+////        IAction copyAction = getAction( ITextEditorActionConstants.COPY );
+//        if ( copyAction != null )
+//        {
+//            copyAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+//                ISharedImages.IMG_TOOL_COPY ) );
+//        }
+//        IAction pasteAction = getAction( ITextEditorActionConstants.PASTE );
+//        if ( pasteAction != null )
+//        {
+//            pasteAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+//                ISharedImages.IMG_TOOL_PASTE ) );
+//        }
 
-        activateGlobalActionHandlers();
+//        activateGlobalActionHandlers();
     }
 
 
@@ -464,7 +451,7 @@ public class LdifEditor extends TextEdit
      */
     public void createPartControl( Composite parent )
     {
-        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" ); //$NON-NLS-1$ //$NON-NLS-2$
+//        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" ); //$NON-NLS-1$ //$NON-NLS-2$
 
         if ( showToolBar )
         {
@@ -510,58 +497,58 @@ public class LdifEditor extends TextEdit
             data.widthHint = 450;
             data.heightHint = 250;
             editorComposite.setLayoutData( data );
-            super.createPartControl( editorComposite );
+//            super.createPartControl( editorComposite );
             control.setContent( editorComposite );
         }
         else
         {
-            super.createPartControl( parent );
+//            super.createPartControl( parent );
         }
 
-        ProjectionViewer projectionViewer = ( ProjectionViewer ) getSourceViewer();
-        projectionSupport = new ProjectionSupport( projectionViewer, getAnnotationAccess(), getSharedColors() );
-        projectionSupport.install();
-        projectionViewer.doOperation( ProjectionViewer.TOGGLE );
-    }
-
-
-    /**
-     * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
-     */
-    protected ISourceViewer createSourceViewer( Composite parent, IVerticalRuler ruler, int styles )
-    {
-        getAnnotationAccess();
-        getOverviewRuler();
-        ISourceViewer viewer = new ProjectionViewer( parent, ruler, getOverviewRuler(), true, styles );
-        getSourceViewerDecorationSupport( viewer );
-
-        return viewer;
-    }
-
-
-    /**
-     * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#configureSourceViewerDecorationSupport(org.eclipse.ui.texteditor.SourceViewerDecorationSupport)
-     */
-    protected void configureSourceViewerDecorationSupport( SourceViewerDecorationSupport support )
-    {
-        super.configureSourceViewerDecorationSupport( support );
+//        ProjectionViewer projectionViewer = ( ProjectionViewer ) getSourceViewer();
+//        projectionSupport = new ProjectionSupport( projectionViewer, getAnnotationAccess(), getSharedColors() );
+//        projectionSupport.install();
+//        projectionViewer.doOperation( ProjectionViewer.TOGGLE );
     }
 
 
+//    /**
+//     * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
+//     */
+//    protected ISourceViewer createSourceViewer( Composite parent, IVerticalRuler ruler, int styles )
+//    {
+//        getAnnotationAccess();
+//        getOverviewRuler();
+//        ISourceViewer viewer = new ProjectionViewer( parent, ruler, getOverviewRuler(), true, styles );
+//        getSourceViewerDecorationSupport( viewer );
+//
+//        return viewer;
+//    }
+
+
+//    /**
+//     * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#configureSourceViewerDecorationSupport(org.eclipse.ui.texteditor.SourceViewerDecorationSupport)
+//     */
+//    protected void configureSourceViewerDecorationSupport( SourceViewerDecorationSupport support )
+//    {
+//        super.configureSourceViewerDecorationSupport( support );
+//    }
+//
+//
     /**
      * @see org.apache.directory.studio.ldifeditor.editor.ILdifEditor#getLdifModel()
      */
     public LdifFile getLdifModel()
     {
-        IDocumentProvider provider = getDocumentProvider();
-        if ( provider instanceof LdifDocumentProvider )
-        {
-            return ( ( LdifDocumentProvider ) provider ).getLdifModel();
-        }
-        else
-        {
+////        IDocumentProvider provider = getDocumentProvider();
+//        if ( provider instanceof LdifDocumentProvider )
+//        {
+//            return ( ( LdifDocumentProvider ) provider ).getLdifModel();
+//        }
+//        else
+//        {
             return null;
-        }
+//        }
     }
 
 
@@ -570,7 +557,7 @@ public class LdifEditor extends TextEdit
      */
     public void outlinePageClosed()
     {
-        projectionSupport.dispose();
+//        projectionSupport.dispose();
         outlinePage = null;
     }
 
@@ -599,12 +586,12 @@ public class LdifEditor extends TextEdit
                     .getConnection().getName() ) );
         // getStatusField("ldapconnection").setText();
 
-        IAction action = getAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF );
-        if ( action != null )
-        {
-            action.setEnabled( browserConnection == null );
-            action.setEnabled( browserConnection != null );
-        }
+//        IAction action = getAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF );
+//        if ( action != null )
+//        {
+//            action.setEnabled( browserConnection == null );
+//            action.setEnabled( browserConnection != null );
+//        }
     }
 
 
@@ -694,11 +681,11 @@ public class LdifEditor extends TextEdit
         final IEditorInput input = getEditorInput();
         if ( input instanceof NonExistingLdifEditorInput )
         {
-            super.doSaveAs();
+//            super.doSaveAs();
             return;
         }
 
-        super.doSave( progressMonitor );
+//        super.doSave( progressMonitor );
     }
 
 
@@ -724,84 +711,84 @@ public class LdifEditor extends TextEdit
         if ( isIDE )
         {
             // Just call super implementation for now
-            IPreferenceStore store = EditorsUI.getPreferenceStore();
-            String key = getEditorSite().getId() + ".internal.delegateSaveAs"; // $NON-NLS-1$ //$NON-NLS-1$
-            store.setValue( key, true );
-            super.performSaveAs( progressMonitor );
+//            IPreferenceStore store = EditorsUI.getPreferenceStore();
+//            String key = getEditorSite().getId() + ".internal.delegateSaveAs"; // $NON-NLS-1$ //$NON-NLS-1$
+//            store.setValue( key, true );
+//            super.performSaveAs( progressMonitor );
         }
-        else
-        {
+//        else
+//        {
             // Open FileDialog
-            Shell shell = getSite().getShell();
-            final IEditorInput input = getEditorInput();
-
-            IDocumentProvider provider = getDocumentProvider();
-            final IEditorInput newInput;
-
-            FileDialog dialog = new FileDialog( shell, SWT.SAVE );
+//            Shell shell = getSite().getShell();
+//            final IEditorInput input = getEditorInput();
 
-            String path = dialog.open();
-            if ( path == null )
-            {
-                if ( progressMonitor != null )
-                {
-                    progressMonitor.setCanceled( true );
-                }
-                return;
-            }
-
-            // Check whether file exists and if so, confirm overwrite
-            final File externalFile = new File( path );
-            if ( externalFile.exists() )
-            {
-                MessageDialog overwriteDialog = new MessageDialog( shell,
-                    Messages.getString( "LdifEditor.Overwrite" ), null, Messages.getString( "OverwriteQuestion" ), //$NON-NLS-1$ //$NON-NLS-2$
-                    MessageDialog.WARNING, new String[]
-                        { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1 ); // 'No' is the default
-                if ( overwriteDialog.open() != Window.OK )
-                {
-                    if ( progressMonitor != null )
-                    {
-                        progressMonitor.setCanceled( true );
-                        return;
-                    }
-                }
-            }
-
-            IPath iPath = new Path( path );
-            newInput = new PathEditorInput( iPath );
-
-            boolean success = false;
-            try
-            {
-                provider.aboutToChange( newInput );
-                provider.saveDocument( progressMonitor, newInput, provider.getDocument( input ), true );
-                success = true;
-            }
-            catch ( CoreException x )
-            {
-                final IStatus status = x.getStatus();
-                if ( status == null || status.getSeverity() != IStatus.CANCEL )
-                {
-                    String title = Messages.getString( "LdifEditor.ErrorInSaveAs" ); //$NON-NLS-1$
-                    String msg = Messages.getString( "LdifEditor.ErrorInSaveAs" ) + x.getMessage(); //$NON-NLS-1$
-                    MessageDialog.openError( shell, title, msg );
-                }
-            }
-            finally
-            {
-                provider.changed( newInput );
-                if ( success )
-                {
-                    setInput( newInput );
-                }
-            }
-
-            if ( progressMonitor != null )
-            {
-                progressMonitor.setCanceled( !success );
-            }
-        }
+////            IDocumentProvider provider = getDocumentProvider();
+////            final IEditorInput newInput;
+////
+////            FileDialog dialog = new FileDialog( shell, SWT.SAVE );
+////
+////            String path = dialog.open();
+//            if ( path == null )
+//            {
+//                if ( progressMonitor != null )
+//                {
+//                    progressMonitor.setCanceled( true );
+//                }
+//                return;
+//            }
+//
+//            // Check whether file exists and if so, confirm overwrite
+//            final File externalFile = new File( path );
+//            if ( externalFile.exists() )
+//            {
+//                MessageDialog overwriteDialog = new MessageDialog( shell,
+//                    Messages.getString( "LdifEditor.Overwrite" ), null, Messages.getString( "OverwriteQuestion" ), //$NON-NLS-1$ //$NON-NLS-2$
+//                    MessageDialog.WARNING, new String[]
+//                        { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1 ); // 'No' is the default
+//                if ( overwriteDialog.open() != Window.OK )
+//                {
+//                    if ( progressMonitor != null )
+//                    {
+//                        progressMonitor.setCanceled( true );
+//                        return;
+//                    }
+//                }
+//            }
+//
+//            IPath iPath = new Path( path );
+//            newInput = new PathEditorInput( iPath );
+//
+//            boolean success = false;
+//            try
+//            {
+//                provider.aboutToChange( newInput );
+//                provider.saveDocument( progressMonitor, newInput, provider.getDocument( input ), true );
+//                success = true;
+//            }
+//            catch ( CoreException x )
+//            {
+//                final IStatus status = x.getStatus();
+//                if ( status == null || status.getSeverity() != IStatus.CANCEL )
+//                {
+//                    String title = Messages.getString( "LdifEditor.ErrorInSaveAs" ); //$NON-NLS-1$
+//                    String msg = Messages.getString( "LdifEditor.ErrorInSaveAs" ) + x.getMessage(); //$NON-NLS-1$
+//                    MessageDialog.openError( shell, title, msg );
+//                }
+//            }
+//            finally
+//            {
+//                provider.changed( newInput );
+//                if ( success )
+//                {
+//                    setInput( newInput );
+//                }
+//            }
+//
+//            if ( progressMonitor != null )
+//            {
+//                progressMonitor.setCanceled( !success );
+//            }
+//        }
 
     }
 
@@ -894,12 +881,12 @@ public class LdifEditor extends TextEdit
      */
     public void activateGlobalActionHandlers()
     {
-        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
-        ActionUtils.activateActionHandler( elaa );
-        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
-        ActionUtils.activateActionHandler( elva );
-        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
-        ActionUtils.activateActionHandler( elra );
+//        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
+//        ActionUtils.activateActionHandler( elaa );
+//        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
+//        ActionUtils.activateActionHandler( elva );
+//        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
+//        ActionUtils.activateActionHandler( elra );
     }
 
 
@@ -908,12 +895,12 @@ public class LdifEditor extends TextEdit
      */
     public void deactivateGlobalActionHandlers()
     {
-        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
-        ActionUtils.deactivateActionHandler( elaa );
-        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
-        ActionUtils.deactivateActionHandler( elva );
-        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
-        ActionUtils.deactivateActionHandler( elra );
+//        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
+//        ActionUtils.deactivateActionHandler( elaa );
+//        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
+//        ActionUtils.deactivateActionHandler( elva );
+//        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
+//        ActionUtils.deactivateActionHandler( elra );
     }
 
 
@@ -928,4 +915,32 @@ public class LdifEditor extends TextEdit
         return valueEditorManager;
     }
 
+
+	@Override
+	public void doSaveAs() {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+	@Override
+	public boolean isDirty() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+
+	@Override
+	public boolean isSaveAsAllowed() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+
+	@Override
+	public void setFocus() {
+		// TODO Auto-generated method stub
+		
+	}
+
 }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditorContributor.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditorContributor.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditorContributor.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditorContributor.java Fri Aug 20 17:07:19 2010
@@ -21,15 +21,6 @@
 package org.apache.directory.studio.ldifeditor.editor;
 
 
-import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
-import org.apache.directory.studio.ldifeditor.LdifEditorConstants;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
 
 
 /**
@@ -37,54 +28,4 @@ import org.eclipse.ui.texteditor.Retarge
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdifEditorContributor extends BasicTextEditorActionContributor
-{
-
-    private static final String CONTENTASSIST_ACTION = LdifEditorConstants.CONTENTASSIST_ACTION;
-
-    private RetargetTextEditorAction contentAssist;
-
-
-    /**
-     * Creates a new instance of LdifEditorContributor.
-     */
-    public LdifEditorContributor()
-    {
-        super();
-
-        contentAssist = new RetargetTextEditorAction( LdifEditorActivator.getDefault().getResourceBundle(),
-            "ContentAssistProposal." ); //$NON-NLS-1$
-        contentAssist.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void setActiveEditor( IEditorPart part )
-    {
-        super.setActiveEditor( part );
-        ITextEditor editor = ( part instanceof ITextEditor ) ? ( ITextEditor ) part : null;
-        contentAssist.setAction( getAction( editor, CONTENTASSIST_ACTION ) );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void init( IActionBars bars, IWorkbenchPage page )
-    {
-        super.init( bars, page );
-        bars.setGlobalActionHandler( CONTENTASSIST_ACTION, contentAssist );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void dispose()
-    {
-        setActiveEditor( null );
-        super.dispose();
-    }
-}
+public class LdifEditorContributor {}

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifOutlinePage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifOutlinePage.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifOutlinePage.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifOutlinePage.java Fri Aug 20 17:07:19 2010
@@ -126,8 +126,8 @@ public class LdifOutlinePage extends Con
                     if ( element instanceof LdifRecord )
                     {
                         LdifRecord ldifRecord = ( LdifRecord ) element;
-                        ldifEditor.selectAndReveal( ldifRecord.getDnLine().getOffset(), ldifRecord.getDnLine()
-                            .getLength() );
+//                        ldifEditor.selectAndReveal( ldifRecord.getDnLine().getOffset(), ldifRecord.getDnLine()
+//                            .getLength() );
                     }
                     else if ( element instanceof List )
                     {
@@ -135,19 +135,19 @@ public class LdifOutlinePage extends Con
                         if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                         {
                             LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
-                            ldifEditor.selectAndReveal( line.getOffset(), line.getRawAttributeDescription().length() );
+//                            ldifEditor.selectAndReveal( line.getOffset(), line.getRawAttributeDescription().length() );
                         }
                     }
                     else if ( element instanceof LdifAttrValLine )
                     {
                         LdifAttrValLine line = ( LdifAttrValLine ) element;
-                        ldifEditor.selectAndReveal( line.getOffset() + line.getRawAttributeDescription().length()
-                            + line.getRawValueType().length(), line.getRawValue().length() );
+//                        ldifEditor.selectAndReveal( line.getOffset() + line.getRawAttributeDescription().length()
+//                            + line.getRawValueType().length(), line.getRawValue().length() );
                     }
                     else if ( element instanceof LdifModSpec )
                     {
                         LdifModSpec modSpec = ( LdifModSpec ) element;
-                        ldifEditor.selectAndReveal( modSpec.getOffset(), modSpec.getModSpecType().getLength() );
+//                        ldifEditor.selectAndReveal( modSpec.getOffset(), modSpec.getModSpecType().getLength() );
                     }
                 }
             }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifSourceViewerConfiguration.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifSourceViewerConfiguration.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifSourceViewerConfiguration.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifSourceViewerConfiguration.java Fri Aug 20 17:07:19 2010
@@ -21,35 +21,6 @@
 package org.apache.directory.studio.ldifeditor.editor;
 
 
-import org.apache.directory.studio.ldapbrowser.common.widgets.DialogContentAssistant;
-import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
-import org.apache.directory.studio.ldifeditor.LdifEditorConstants;
-import org.apache.directory.studio.ldifeditor.editor.reconciler.LdifReconcilingStrategy;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifAnnotationHover;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifAutoEditStrategy;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifCompletionProcessor;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifDamagerRepairer;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifDoubleClickStrategy;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifPartitionScanner;
-import org.apache.directory.studio.ldifeditor.editor.text.LdifTextHover;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.MonoReconciler;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.graphics.RGB;
 
 
 /**
@@ -57,232 +28,4 @@ import org.eclipse.swt.graphics.RGB;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdifSourceViewerConfiguration extends SourceViewerConfiguration
-{
-    private ILdifEditor editor;
-
-    // Error hover and annotations
-    private LdifAnnotationHover annotationHover;
-
-    private LdifTextHover textHover;
-
-    // Presentation Reconciler (syntax highlight)
-    private PresentationReconciler presentationReconciler;
-
-    private LdifDamagerRepairer damagerRepairer;
-
-    // Content Assistent
-    private boolean contentAssistEnabled;
-
-    private ContentAssistant contentAssistant;
-
-    private IContentAssistProcessor contentAssistProcessor;
-
-    private LdifDoubleClickStrategy doubleClickStrategy;
-
-    // Asynchronous Reconciler (annotations)
-    private MonoReconciler reconciler;
-
-    private LdifReconcilingStrategy reconcilingStrategy;
-
-    private IAutoEditStrategy[] autoEditStrategies;
-
-
-    /**
-     * Creates a new instance of LdifSourceViewerConfiguration.
-     *
-     * @param editor
-     * @param contentAssistEnabled
-     */
-    public LdifSourceViewerConfiguration( ILdifEditor editor, boolean contentAssistEnabled )
-    {
-        super();
-        this.editor = editor;
-
-        this.contentAssistEnabled = contentAssistEnabled;
-    }
-
-
-    /**
-     * Overwrites the style set in preference store
-     *
-     * @param key
-     *      the key
-     * @param rgb
-     *      the color
-     * @param style
-     *      the stule
-     */
-    public void setTextAttribute( String key, RGB rgb, int style )
-    {
-        damagerRepairer.setTextAttribute( key, rgb, style );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getConfiguredDocumentPartitioning( ISourceViewer sourceViewer )
-    {
-        return LdifDocumentSetupParticipant.LDIF_PARTITIONING;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public String[] getConfiguredContentTypes( ISourceViewer sourceViewer )
-    {
-        return new String[]
-            { IDocument.DEFAULT_CONTENT_TYPE, LdifPartitionScanner.LDIF_RECORD };
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public ITextDoubleClickStrategy getDoubleClickStrategy( ISourceViewer sourceViewer, String contentType )
-    {
-        if ( this.doubleClickStrategy == null )
-        {
-            this.doubleClickStrategy = new LdifDoubleClickStrategy();
-        }
-        return this.doubleClickStrategy;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer )
-    {
-
-        if ( this.presentationReconciler == null )
-        {
-            this.presentationReconciler = new PresentationReconciler();
-            this.presentationReconciler.setDocumentPartitioning( getConfiguredDocumentPartitioning( sourceViewer ) );
-
-            damagerRepairer = new LdifDamagerRepairer( this.editor );
-
-            this.presentationReconciler.setDamager( damagerRepairer, IDocument.DEFAULT_CONTENT_TYPE );
-            this.presentationReconciler.setRepairer( damagerRepairer, IDocument.DEFAULT_CONTENT_TYPE );
-
-            this.presentationReconciler.setDamager( damagerRepairer, LdifPartitionScanner.LDIF_RECORD );
-            this.presentationReconciler.setRepairer( damagerRepairer, LdifPartitionScanner.LDIF_RECORD );
-        }
-
-        return this.presentationReconciler;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public IReconciler getReconciler( ISourceViewer sourceViewer )
-    {
-        if ( this.reconciler == null )
-        {
-            this.reconcilingStrategy = new LdifReconcilingStrategy( editor );
-
-            // Reconciler reconciler = new Reconciler();
-            // reconciler.setIsIncrementalReconciler(true);
-            // reconciler.setReconcilingStrategy(strategy,
-            // LdifPartitionScanner.LDIF_RECORD);
-            // reconciler.setReconcilingStrategy(strategy,
-            // IDocument.DEFAULT_CONTENT_TYPE);
-            // reconciler.setProgressMonitor(new NullProgressMonitor());
-            // reconciler.setDelay(500);
-            // return reconciler;
-
-            this.reconciler = new MonoReconciler( this.reconcilingStrategy, true );
-            this.reconciler.setProgressMonitor( new NullProgressMonitor() );
-            this.reconciler.setDelay( 500 );
-        }
-
-        return this.reconciler;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public IContentAssistant getContentAssistant( ISourceViewer sourceViewer )
-    {
-        if ( this.contentAssistEnabled )
-        {
-            if ( this.contentAssistant == null )
-            {
-                // this.contentAssistant = new ContentAssistant();
-                this.contentAssistant = new DialogContentAssistant();
-
-                this.contentAssistProcessor = new LdifCompletionProcessor( editor, contentAssistant );
-                this.contentAssistant.setContentAssistProcessor( this.contentAssistProcessor,
-                    LdifPartitionScanner.LDIF_RECORD );
-                this.contentAssistant.setContentAssistProcessor( this.contentAssistProcessor,
-                    IDocument.DEFAULT_CONTENT_TYPE );
-                this.contentAssistant.setDocumentPartitioning( LdifDocumentSetupParticipant.LDIF_PARTITIONING );
-
-                this.contentAssistant.setContextInformationPopupOrientation( IContentAssistant.CONTEXT_INFO_ABOVE );
-                this.contentAssistant.setInformationControlCreator( getInformationControlCreator( sourceViewer ) );
-
-                IPreferenceStore store = LdifEditorActivator.getDefault().getPreferenceStore();
-                this.contentAssistant.enableAutoInsert( store
-                    .getBoolean( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO ) );
-                this.contentAssistant.enableAutoActivation( store
-                    .getBoolean( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION ) );
-                this.contentAssistant.setAutoActivationDelay( store
-                    .getInt( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY ) );
-                // this.contentAssistant.enableAutoInsert(true);
-                // this.contentAssistant.enableAutoActivation(true);
-                // this.contentAssistant.setAutoActivationDelay(100);
-            }
-            return this.contentAssistant;
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public IAnnotationHover getAnnotationHover( ISourceViewer sourceViewer )
-    {
-        if ( this.annotationHover == null )
-        {
-            this.annotationHover = new LdifAnnotationHover( this.editor );
-        }
-        return this.annotationHover;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public ITextHover getTextHover( ISourceViewer sourceViewer, String contentType )
-    {
-        if ( this.textHover == null )
-        {
-            this.textHover = new LdifTextHover( this.editor );
-        }
-        return this.textHover;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public IAutoEditStrategy[] getAutoEditStrategies( ISourceViewer sourceViewer, String contentType )
-    {
-        if ( autoEditStrategies == null )
-        {
-            this.autoEditStrategies = new IAutoEditStrategy[2];
-            this.autoEditStrategies[0] = new DefaultIndentLineAutoEditStrategy();
-            this.autoEditStrategies[1] = new LdifAutoEditStrategy( this.editor );
-        }
-
-        return autoEditStrategies;
-    }
-}
+public class LdifSourceViewerConfiguration {}

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/NonExistingLdifEditorInput.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/NonExistingLdifEditorInput.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/NonExistingLdifEditorInput.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/NonExistingLdifEditorInput.java Fri Aug 20 17:07:19 2010
@@ -28,7 +28,6 @@ import org.eclipse.core.runtime.Platform
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IPathEditorInput;
 import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
 
 
 /**
@@ -40,7 +39,7 @@ import org.eclipse.ui.editors.text.ILoca
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NonExistingLdifEditorInput implements IPathEditorInput, ILocationProvider
+public class NonExistingLdifEditorInput implements IPathEditorInput
 {
     /** The counter to create unique names */
     private static int counter = 0;
@@ -110,10 +109,6 @@ public class NonExistingLdifEditorInput 
      */
     public Object getAdapter( Class adapter )
     {
-        if ( ILocationProvider.class.equals( adapter ) )
-        {
-            return this;
-        }
 
         return Platform.getAdapterManager().getAdapter( this, adapter );
     }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java Fri Aug 20 17:07:19 2010
@@ -17,7 +17,6 @@ import org.eclipse.jface.resource.ImageD
 import org.eclipse.ui.IPathEditorInput;
 import org.eclipse.ui.IPersistableElement;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.editors.text.ILocationProvider;
 
 
 /**
@@ -31,7 +30,7 @@ import org.eclipse.ui.editors.text.ILoca
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PathEditorInput implements IPathEditorInput, ILocationProvider
+public class PathEditorInput implements IPathEditorInput
 {
 
     /** The absolute path in local file system */
@@ -136,10 +135,10 @@ public class PathEditorInput implements 
      */
     public Object getAdapter( Class adapter )
     {
-        if ( ILocationProvider.class.equals( adapter ) )
-        {
-            return this;
-        }
+//        if ( ILocationProvider.class.equals( adapter ) )
+//        {
+//            return this;
+//        }
 
         return Platform.getAdapterManager().getAdapter( this, adapter );
     }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractLdifAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractLdifAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractLdifAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractLdifAction.java Fri Aug 20 17:07:19 2010
@@ -26,14 +26,11 @@ import org.apache.directory.studio.ldifp
 import org.apache.directory.studio.ldifparser.model.LdifPart;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
 import org.apache.directory.studio.ldifparser.model.container.LdifModSpec;
-
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.texteditor.IUpdate;
 
 
-public abstract class AbstractLdifAction extends Action implements IUpdate
+public abstract class AbstractLdifAction extends Action 
 {
 
     protected LdifEditor editor;
@@ -60,7 +57,7 @@ public abstract class AbstractLdifAction
 
     public boolean isEnabled()
     {
-        update();
+//        update();
         return super.isEnabled();
     }
 
@@ -77,13 +74,13 @@ public abstract class AbstractLdifAction
 
         LdifContainer[] containers = null;
 
-        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-        if ( sourceViewer != null )
-        {
-            LdifFile model = editor.getLdifModel();
-            Point selection = sourceViewer.getSelectedRange();
-            containers = LdifFile.getContainers( model, selection.x, selection.y );
-        }
+//        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//        if ( sourceViewer != null )
+//        {
+//            LdifFile model = editor.getLdifModel();
+//            Point selection = sourceViewer.getSelectedRange();
+//            containers = LdifFile.getContainers( model, selection.x, selection.y );
+//        }
 
         return containers != null ? containers : new LdifContainer[0];
 
@@ -95,14 +92,14 @@ public abstract class AbstractLdifAction
 
         LdifPart[] parts = null;
 
-        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-        if ( sourceViewer != null )
-        {
-            LdifFile model = editor.getLdifModel();
-            Point selection = sourceViewer.getSelectedRange();
-            parts = LdifFile.getParts( model, selection.x, selection.y );
-
-        }
+//        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//        if ( sourceViewer != null )
+//        {
+//            LdifFile model = editor.getLdifModel();
+//            Point selection = sourceViewer.getSelectedRange();
+//            parts = LdifFile.getParts( model, selection.x, selection.y );
+//
+//        }
 
         return parts != null ? parts : new LdifPart[0];
 
@@ -115,15 +112,15 @@ public abstract class AbstractLdifAction
         LdifModSpec modSpec = null;
 
         LdifContainer[] containers = getSelectedLdifContainers();
-        if ( containers.length == 1 )
-        {
-            ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-            if ( sourceViewer != null )
-            {
-                Point selection = sourceViewer.getSelectedRange();
-                modSpec = LdifFile.getInnerContainer( containers[0], selection.x );
-            }
-        }
+//        if ( containers.length == 1 )
+//        {
+//            ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//            if ( sourceViewer != null )
+//            {
+//                Point selection = sourceViewer.getSelectedRange();
+//                modSpec = LdifFile.getInnerContainer( containers[0], selection.x );
+//            }
+//        }
 
         return modSpec;
 

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java Fri Aug 20 17:07:19 2010
@@ -30,7 +30,6 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
-import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
 import org.apache.directory.studio.ldifparser.model.LdifPart;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
@@ -45,8 +44,6 @@ import org.apache.directory.studio.ldifp
 import org.apache.directory.studio.valueeditors.AbstractDialogValueEditor;
 import org.apache.directory.studio.valueeditors.IValueEditor;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
 
 
 public abstract class AbstractOpenValueEditorAction extends AbstractLdifAction
@@ -90,7 +87,7 @@ public abstract class AbstractOpenValueE
 
                 if ( newValue != null && newValue instanceof String || newValue instanceof byte[] )
                 {
-                    IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
+//                    IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
 
                     LdifValueLineBase newLine;
                     if ( line instanceof LdifControlLine )
@@ -119,15 +116,15 @@ public abstract class AbstractOpenValueE
                         }
                     }
 
-                    try
-                    {
-                        document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
-                            .getLdifFormatParameters() ) );
-                    }
-                    catch ( BadLocationException e )
-                    {
-                        e.printStackTrace();
-                    }
+//                    try
+//                    {
+//                        document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
+//                            .getLdifFormatParameters() ) );
+//                    }
+//                    catch ( BadLocationException e )
+//                    {
+//                        e.printStackTrace();
+//                    }
 
                 }
             }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java Fri Aug 20 17:07:19 2010
@@ -45,8 +45,6 @@ import org.apache.directory.studio.ldifp
 import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecTypeLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifValueLineBase;
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Display;
 
@@ -136,7 +134,7 @@ public class EditLdifAttributeAction ext
 
                     if ( newAttributeDescription != null )
                     {
-                        IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
+//                        IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
 
                         if ( modSpec != null )
                         {
@@ -173,29 +171,29 @@ public class EditLdifAttributeAction ext
                                 text += newAttrValLines[j].toFormattedString( Utils.getLdifFormatParameters() );
                             }
                             text += newSepLine.toFormattedString( Utils.getLdifFormatParameters() );
-                            try
-                            {
-                                document.replace( modSpec.getOffset(), modSpec.getLength(), text );
-                            }
-                            catch ( BadLocationException e )
-                            {
-                                e.printStackTrace();
-                            }
+//                            try
+//                            {
+//                                document.replace( modSpec.getOffset(), modSpec.getLength(), text );
+//                            }
+//                            catch ( BadLocationException e )
+//                            {
+//                                e.printStackTrace();
+//                            }
 
                         }
                         else
                         { // LdifContentRecord ||
                             // LdifChangeAddRecord
                             LdifAttrValLine newLine = LdifAttrValLine.create( newAttributeDescription, oldValue );
-                            try
-                            {
-                                document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
-                                    .getLdifFormatParameters() ) );
-                            }
-                            catch ( BadLocationException e )
-                            {
-                                e.printStackTrace();
-                            }
+//                            try
+//                            {
+//                                document.replace( line.getOffset(), line.getLength(), newLine.toFormattedString( Utils
+//                                    .getLdifFormatParameters() ) );
+//                            }
+//                            catch ( BadLocationException e )
+//                            {
+//                                e.printStackTrace();
+//                            }
                         }
                     }
 

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifRecordAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifRecordAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifRecordAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifRecordAction.java Fri Aug 20 17:07:19 2010
@@ -29,7 +29,6 @@ import org.apache.directory.studio.ldifp
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
 import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifRecord;
-import org.eclipse.jface.text.IDocument;
 
 
 public class EditLdifRecordAction extends AbstractLdifAction
@@ -68,13 +67,13 @@ public class EditLdifRecordAction extend
             {
                 LdifRecord record = dialog.getLdifRecord();
 
-                IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
-                String old = document.get();
-                StringBuffer sb = new StringBuffer();
-                sb.append( old.substring( 0, container.getOffset() ) );
-                sb.append( record.toFormattedString( Utils.getLdifFormatParameters() ) );
-                sb.append( old.substring( container.getOffset() + container.getLength(), old.length() ) );
-                document.set( sb.toString() );
+//                IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
+//                String old = document.get();
+//                StringBuffer sb = new StringBuffer();
+//                sb.append( old.substring( 0, container.getOffset() ) );
+//                sb.append( record.toFormattedString( Utils.getLdifFormatParameters() ) );
+//                sb.append( old.substring( container.getOffset() + container.getLength(), old.length() ) );
+//                document.set( sb.toString() );
             }
             editor.activateGlobalActionHandlers();
         }

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifDocumentAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifDocumentAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifDocumentAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifDocumentAction.java Fri Aug 20 17:07:19 2010
@@ -23,8 +23,6 @@ package org.apache.directory.studio.ldif
 
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
 
 
 public class FormatLdifDocumentAction extends AbstractLdifAction
@@ -38,11 +36,11 @@ public class FormatLdifDocumentAction ex
 
     protected void doRun()
     {
-        IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
-        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-        int topIndex = sourceViewer.getTopIndex();
-        document.set( super.getLdifModel().toFormattedString( Utils.getLdifFormatParameters() ) );
-        sourceViewer.setTopIndex( topIndex );
+//        IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
+//        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//        int topIndex = sourceViewer.getTopIndex();
+//        document.set( super.getLdifModel().toFormattedString( Utils.getLdifFormatParameters() ) );
+//        sourceViewer.setTopIndex( topIndex );
     }
 
 

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifRecordAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifRecordAction.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifRecordAction.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifRecordAction.java Fri Aug 20 17:07:19 2010
@@ -21,12 +21,9 @@
 package org.apache.directory.studio.ldifeditor.editor.actions;
 
 
-import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
 import org.apache.directory.studio.ldifparser.model.container.LdifRecord;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
 
 
 public class FormatLdifRecordAction extends AbstractLdifAction
@@ -44,24 +41,24 @@ public class FormatLdifRecordAction exte
         LdifContainer[] containers = super.getSelectedLdifContainers();
         if ( containers.length > 0 )
         {
-            IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
-            String old = document.get();
-            StringBuffer sb = new StringBuffer();
-            sb.append( old.substring( 0, containers[0].getOffset() ) );
-
-            for ( int i = 0; i < containers.length; i++ )
-            {
-                LdifContainer container = containers[i];
-                sb.append( container.toFormattedString( Utils.getLdifFormatParameters() ) );
-            }
-
-            sb.append( old.substring( containers[containers.length - 1].getOffset()
-                + containers[containers.length - 1].getLength(), old.length() ) );
-
-            ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-            int topIndex = sourceViewer.getTopIndex();
-            document.set( sb.toString() );
-            sourceViewer.setTopIndex( topIndex );
+//            IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
+//            String old = document.get();
+//            StringBuffer sb = new StringBuffer();
+//            sb.append( old.substring( 0, containers[0].getOffset() ) );
+//
+//            for ( int i = 0; i < containers.length; i++ )
+//            {
+//                LdifContainer container = containers[i];
+//                sb.append( container.toFormattedString( Utils.getLdifFormatParameters() ) );
+//            }
+//
+//            sb.append( old.substring( containers[containers.length - 1].getOffset()
+//                + containers[containers.length - 1].getLength(), old.length() ) );
+//
+//            ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//            int topIndex = sourceViewer.getTopIndex();
+//            document.set( sb.toString() );
+//            sourceViewer.setTopIndex( topIndex );
         }
     }
 

Modified: directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java?rev=987577&r1=987576&r2=987577&view=diff
==============================================================================
--- directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java (original)
+++ directory/studio/branches/studio-rap/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java Fri Aug 20 17:07:19 2010
@@ -21,21 +21,10 @@
 package org.apache.directory.studio.ldifeditor.editor.reconciler;
 
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.directory.studio.ldifeditor.editor.ILdifEditor;
 import org.apache.directory.studio.ldifparser.model.LdifFile;
-import org.apache.directory.studio.ldifparser.model.LdifPart;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
 
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.ISourceViewer;
-
 
 class LdifAnnotationUpdater
 {
@@ -66,79 +55,79 @@ class LdifAnnotationUpdater
     {
 
         LdifFile model = editor.getLdifModel();
-        ISourceViewer viewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
-        if ( viewer == null )
-            return;
-
-        IDocument document = viewer.getDocument();
-        IAnnotationModel annotationModel = viewer.getAnnotationModel();
-        if ( document == null || annotationModel == null || model == null )
-            return;
-
-        if ( annotationModel instanceof IAnnotationModelExtension )
-        {
-            ( ( IAnnotationModelExtension ) annotationModel ).removeAllAnnotations();
-
-            List positionList = new ArrayList();
-
-            LdifContainer[] containers = model.getContainers();
-            for ( int i = 0; i < containers.length; i++ )
-            {
-                LdifContainer container = containers[i];
-
-                // LdifPart errorPart = null;
-                int errorOffset = -1;
-                int errorLength = -1;
-                StringBuffer errorText = null;
-
-                LdifPart[] parts = container.getParts();
-                for ( int k = 0; k < parts.length; k++ )
-                {
-                    LdifPart part = parts[k];
-                    if ( !part.isValid() )
-                    {
-                        if ( errorOffset == -1 )
-                        {
-                            // errorPart = part;
-                            errorOffset = part.getOffset();
-                            errorLength = part.getLength();
-                            errorText = new StringBuffer();
-                            errorText.append( part.toRawString() );
-                        }
-                        else
-                        {
-                            errorLength += part.getLength();
-                            errorText.append( part.toRawString() );
-                        }
-                    }
-                }
-
-                if ( errorOffset == -1 && !container.isValid() )
-                {
-                    errorOffset = container.getOffset();
-                    errorLength = container.getLength();
-                    errorText = new StringBuffer();
-                    errorText.append( container.toRawString() );
-                }
-
-                if ( errorOffset > -1 )
-                {
-                    // Annotation annotation = new Annotation("DEFAULT",
-                    // true,
-                    // invalidFilters[i].toString());
-                    // if(errorPart instanceof LdifUnknownPart) {
-                    // errorOffset = container.getOffset();
-                    // errorLength = container.getLength();
-                    // errorText = new StringBuffer(container.toString());
-                    // }
-                    Annotation annotation = new Annotation( ERROR_ANNOTATION_TYPE, true, errorText.toString() );
-                    Position position = new Position( errorOffset, errorLength );
-                    positionList.add( position );
-                    viewer.getAnnotationModel().addAnnotation( annotation, position );
-                }
-
-            }
-        }
+//        ISourceViewer viewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
+//        if ( viewer == null )
+//            return;
+//
+//        IDocument document = viewer.getDocument();
+//        IAnnotationModel annotationModel = viewer.getAnnotationModel();
+//        if ( document == null || annotationModel == null || model == null )
+//            return;
+//
+//        if ( annotationModel instanceof IAnnotationModelExtension )
+//        {
+//            ( ( IAnnotationModelExtension ) annotationModel ).removeAllAnnotations();
+//
+//            List positionList = new ArrayList();
+//
+//            LdifContainer[] containers = model.getContainers();
+//            for ( int i = 0; i < containers.length; i++ )
+//            {
+//                LdifContainer container = containers[i];
+//
+//                // LdifPart errorPart = null;
+//                int errorOffset = -1;
+//                int errorLength = -1;
+//                StringBuffer errorText = null;
+//
+//                LdifPart[] parts = container.getParts();
+//                for ( int k = 0; k < parts.length; k++ )
+//                {
+//                    LdifPart part = parts[k];
+//                    if ( !part.isValid() )
+//                    {
+//                        if ( errorOffset == -1 )
+//                        {
+//                            // errorPart = part;
+//                            errorOffset = part.getOffset();
+//                            errorLength = part.getLength();
+//                            errorText = new StringBuffer();
+//                            errorText.append( part.toRawString() );
+//                        }
+//                        else
+//                        {
+//                            errorLength += part.getLength();
+//                            errorText.append( part.toRawString() );
+//                        }
+//                    }
+//                }
+//
+//                if ( errorOffset == -1 && !container.isValid() )
+//                {
+//                    errorOffset = container.getOffset();
+//                    errorLength = container.getLength();
+//                    errorText = new StringBuffer();
+//                    errorText.append( container.toRawString() );
+//                }
+//
+//                if ( errorOffset > -1 )
+//                {
+//                    // Annotation annotation = new Annotation("DEFAULT",
+//                    // true,
+//                    // invalidFilters[i].toString());
+//                    // if(errorPart instanceof LdifUnknownPart) {
+//                    // errorOffset = container.getOffset();
+//                    // errorLength = container.getLength();
+//                    // errorText = new StringBuffer(container.toString());
+//                    // }
+//                    Annotation annotation = new Annotation( ERROR_ANNOTATION_TYPE, true, errorText.toString() );
+//                    Position position = new Position( errorOffset, errorLength );
+//                    positionList.add( position );
+//                    viewer.getAnnotationModel().addAnnotation( annotation, position );
+//                }
+//
+//            }
+//        }
     }
 
 }
\ No newline at end of file



Mime
View raw message