directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r514908 - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views: connection/ modificationlogs/
Date Mon, 05 Mar 2007 23:10:36 GMT
Author: seelmann
Date: Mon Mar  5 15:10:35 2007
New Revision: 514908

URL: http://svn.apache.org/viewvc?view=rev&rev=514908
Log:
Forgot the modification logs, so another patch for DIRSTUDIO-49.

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewUniversalListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsView.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewInput.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/NewerAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/OlderAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/RefreshAction.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewUniversalListener.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewUniversalListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewUniversalListener.java
Mon Mar  5 15:10:35 2007
@@ -25,6 +25,7 @@
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.actions.SelectionUtils;
 import org.apache.directory.ldapstudio.browser.ui.views.browser.BrowserView;
+import org.apache.directory.ldapstudio.browser.ui.views.modificationlogs.ModificationLogsView;
 import org.apache.directory.ldapstudio.browser.ui.widgets.connection.ConnectionUniversalListener;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -56,7 +57,7 @@
             IConnection[] connections = SelectionUtils.getConnections( event.getSelection()
);
             if ( connections.length == 1 )
             {
-                ensureBrowserViewVisible( connections[0] );
+                ensureViewVisible( connections[0] );
             }
         }
     };
@@ -78,7 +79,7 @@
     /**
      * Creates a new instance of ConnectionViewUniversalListener.
      *
-     * @param view
+     * @param view the connection view
      */
     public ConnectionViewUniversalListener( ConnectionView view )
     {
@@ -102,17 +103,30 @@
 
 
     /**
-     * Ensures that the browser view is opended and ready to show the given selection.
+     * Ensures that the browser view and modification log viewa are opended 
+     * and ready to show the given selection.
      *
      * @param selection the view's selection.
      */
-    private void ensureBrowserViewVisible( IConnection selection )
+    private void ensureViewVisible( IConnection selection )
     {
-        if ( this.view != null )
+        if ( view != null )
         {
             try
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
BrowserView.getId(),
+                    null, IWorkbenchPage.VIEW_VISIBLE );
+            }
+            catch ( PartInitException e )
+            {
+            }
+            catch ( NullPointerException e )
+            {
+            }
+            
+            try
+            {
+                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
ModificationLogsView.getId(),
                     null, IWorkbenchPage.VIEW_VISIBLE );
             }
             catch ( PartInitException e )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsView.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsView.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsView.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsView.java
Mon Mar  5 15:10:35 2007
@@ -21,66 +21,88 @@
 package org.apache.directory.ldapstudio.browser.ui.views.modificationlogs;
 
 
-import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
 import org.apache.directory.ldapstudio.browser.ui.widgets.ldifeditor.LdifEditorWidget;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
 
 
+/**
+ * The ModificationLogsView displays all modifications applied 
+ * to a connection using LDIF change format.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ModificationLogsView extends ViewPart
 {
 
+    /** The action group. */
     private ModificationLogsViewActionGroup actionGroup;
 
+    /** The main widget. */
     private LdifEditorWidget mainWidget;
 
+    /** The universal listener. */
     private ModificationLogsViewUniversalListener universalListener;
 
 
+    /**
+     * Gets the id.
+     * 
+     * @return the id
+     */
     public static String getId()
     {
         return ModificationLogsView.class.getName();
     }
 
 
+    /**
+     * Creates a new instance of ModificationLogsView.
+     */
     public ModificationLogsView()
     {
         super();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setFocus()
     {
         mainWidget.getSourceViewer().getTextWidget().setFocus();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
-        if ( this.mainWidget != null )
+        if ( mainWidget != null )
         {
-            this.actionGroup.dispose();
-            this.actionGroup = null;
-            this.universalListener.dispose();
-            this.universalListener = null;
-            this.mainWidget.dispose();
-            this.mainWidget = null;
+            actionGroup.dispose();
+            actionGroup = null;
+            universalListener.dispose();
+            universalListener = null;
+            mainWidget.dispose();
+            mainWidget = null;
         }
         super.dispose();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void createPartControl( Composite parent )
     {
-
         Composite composite = new Composite( parent, SWT.NONE );
         composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
         GridLayout layout = new GridLayout();
@@ -94,12 +116,12 @@
         mainWidget.getSourceViewer().setEditable( false );
 
         // create actions and context menu (and register global actions)
-        this.actionGroup = new ModificationLogsViewActionGroup( this );
-        this.actionGroup.fillActionBars( getViewSite().getActionBars() );
+        actionGroup = new ModificationLogsViewActionGroup( this );
+        actionGroup.fillActionBars( getViewSite().getActionBars() );
         // this.actionGroup.fillContextMenu(this.configuration.getContextMenuManager(this.mainWidget.getViewer()));
 
         // create the listener
-        this.universalListener = new ModificationLogsViewUniversalListener( this );
+        universalListener = new ModificationLogsViewUniversalListener( this );
 
         // set help context
         PlatformUI.getWorkbench().getHelpSystem().setHelp( mainWidget.getSourceViewer().getTextWidget(),
@@ -107,61 +129,33 @@
     }
 
 
+    /**
+     * Gets the main widget.
+     * 
+     * @return the main widget
+     */
     public LdifEditorWidget getMainWidget()
     {
         return mainWidget;
     }
 
 
-    public static void setInput( IConnection connection )
-    {
-        try
-        {
-            String targetId = ModificationLogsView.getId();
-            IViewPart targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(
-                targetId );
-
-            if ( targetView == null && connection != null )
-            {
-                try
-                {
-                    targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
-                        targetId, null, IWorkbenchPage.VIEW_VISIBLE );
-                }
-                catch ( PartInitException e )
-                {
-                }
-            }
-
-            try
-            {
-                targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
targetId,
-                    null, IWorkbenchPage.VIEW_VISIBLE );
-            }
-            catch ( PartInitException e )
-            {
-            }
-
-            // set input
-            if ( targetView != null && targetView instanceof ModificationLogsView
)
-            {
-                ModificationLogsViewInput input = new ModificationLogsViewInput( connection,
0 );
-                ( ( ModificationLogsView ) targetView ).universalListener.setInput( input
);
-                ( ( ModificationLogsView ) targetView ).universalListener.scrollToNewest();
-            }
-        }
-        catch ( NullPointerException npe )
-        {
-        }
-    }
-
-
+    /**
+     * Gets the universal listener.
+     * 
+     * @return the universal listener
+     */
     public ModificationLogsViewUniversalListener getUniversalListener()
     {
         return universalListener;
     }
 
 
+    /**
+     * Gets the action group.
+     * 
+     * @return the action group
+     */
     public ModificationLogsViewActionGroup getActionGroup()
     {
         return actionGroup;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
Mon Mar  5 15:10:35 2007
@@ -34,76 +34,106 @@
 import org.eclipse.ui.IActionBars;
 
 
+/**
+ * The ModificationLogsViewActionGroup manages all the actions of the modification logs view.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ModificationLogsViewActionGroup implements IMenuListener
 {
 
+    /** The view. */
     private ModificationLogsView view;
 
+    /** The Constant olderAction. */
     private static final String olderAction = "olderAction";
 
+    /** The Constant newerAction. */
     private static final String newerAction = "newerAction";
 
+    /** The Constant refreshAction. */
     private static final String refreshAction = "refreshAction";
 
-    private Map modificationLogsViewActionMap;
+    /** The modification logs view action map. */
+    private Map<String, ModificationLogsViewActionProxy> modificationLogsViewActionMap;
 
 
+    /**
+     * Creates a new instance of ModificationLogsViewActionGroup.
+     *
+     * @param view the modification logs view
+     */
     public ModificationLogsViewActionGroup( ModificationLogsView view )
     {
         this.view = view;
         SourceViewer viewer = this.view.getMainWidget().getSourceViewer();
 
-        this.modificationLogsViewActionMap = new HashMap();
-        this.modificationLogsViewActionMap.put( olderAction, new ModificationLogsViewActionProxy(
viewer,
-            new OlderAction( view ) ) );
-        this.modificationLogsViewActionMap.put( newerAction, new ModificationLogsViewActionProxy(
viewer,
-            new NewerAction( view ) ) );
-        this.modificationLogsViewActionMap.put( refreshAction, new ModificationLogsViewActionProxy(
viewer,
+        modificationLogsViewActionMap = new HashMap<String, ModificationLogsViewActionProxy>();
+        modificationLogsViewActionMap.put( olderAction, new ModificationLogsViewActionProxy(
viewer, new OlderAction(
+            view ) ) );
+        modificationLogsViewActionMap.put( newerAction, new ModificationLogsViewActionProxy(
viewer, new NewerAction(
+            view ) ) );
+        modificationLogsViewActionMap.put( refreshAction, new ModificationLogsViewActionProxy(
viewer,
             new RefreshAction( view ) ) );
     }
 
 
+    /**
+     * Disposes thes action group.
+     */
     public void dispose()
     {
-        if ( this.view != null )
+        if ( view != null )
         {
-
-            for ( Iterator it = this.modificationLogsViewActionMap.keySet().iterator(); it.hasNext();
)
+            for ( Iterator it = modificationLogsViewActionMap.keySet().iterator(); it.hasNext();
)
             {
                 String key = ( String ) it.next();
-                ModificationLogsViewActionProxy action = ( ModificationLogsViewActionProxy
) this.modificationLogsViewActionMap
+                ModificationLogsViewActionProxy action = ( ModificationLogsViewActionProxy
) modificationLogsViewActionMap
                     .get( key );
                 action.dispose();
                 action = null;
                 it.remove();
             }
-            this.modificationLogsViewActionMap.clear();
-            this.modificationLogsViewActionMap = null;
+            modificationLogsViewActionMap.clear();
+            modificationLogsViewActionMap = null;
 
-            this.view = null;
+            view = null;
         }
     }
 
 
+    /**
+     * Fill the action bars.
+     * 
+     * @param actionBars the action bars
+     */
     public void fillActionBars( IActionBars actionBars )
     {
         // Tool Bar
-        actionBars.getToolBarManager().add( ( IAction ) this.modificationLogsViewActionMap.get(
refreshAction ) );
+        actionBars.getToolBarManager().add( ( IAction ) modificationLogsViewActionMap.get(
refreshAction ) );
         actionBars.getToolBarManager().add( new Separator() );
-        actionBars.getToolBarManager().add( ( IAction ) this.modificationLogsViewActionMap.get(
olderAction ) );
-        actionBars.getToolBarManager().add( ( IAction ) this.modificationLogsViewActionMap.get(
newerAction ) );
+        actionBars.getToolBarManager().add( ( IAction ) modificationLogsViewActionMap.get(
olderAction ) );
+        actionBars.getToolBarManager().add( ( IAction ) modificationLogsViewActionMap.get(
newerAction ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void menuAboutToShow( IMenuManager menuManager )
     {
-
     }
 
 
+    /**
+     * Propagates the input to all actions.
+     * 
+     * @param input the input
+     */
     public void setInput( ModificationLogsViewInput input )
     {
-        for ( Iterator it = this.modificationLogsViewActionMap.values().iterator(); it.hasNext();
)
+        for ( Iterator it = modificationLogsViewActionMap.values().iterator(); it.hasNext();
)
         {
             ModificationLogsViewActionProxy action = ( ModificationLogsViewActionProxy )
it.next();
             action.inputChanged( input );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewInput.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewInput.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewInput.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewInput.java
Mon Mar  5 15:10:35 2007
@@ -24,18 +24,55 @@
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 
 
+/**
+ * A ModificationLogsViewInput represents the input of the modification logs view.
+ * It consists of a connection and the index of the displayed log file.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ModificationLogsViewInput
 {
 
-    IConnection connection;
+    /** The connection. */
+    private IConnection connection;
 
-    int index;
+    /** The index of the displayed log file */
+    private int index;
 
 
+    /**
+     * Creates a new instance of ModificationLogsViewInput.
+     * 
+     * @param connection the connection
+     * @param index the index of the displayed log file
+     */
     public ModificationLogsViewInput( IConnection connection, int index )
     {
         this.connection = connection;
         this.index = index;
+    }
+
+
+    /**
+     * Gets the connection.
+     * 
+     * @return the connection
+     */
+    public IConnection getConnection()
+    {
+        return connection;
+    }
+
+
+    /**
+     * Gets the index of the displayed log file.
+     * 
+     * @return the index
+     */
+    public int getIndex()
+    {
+        return index;
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
Mon Mar  5 15:10:35 2007
@@ -29,57 +29,116 @@
 import org.apache.directory.ldapstudio.browser.core.events.EntryModificationEvent;
 import org.apache.directory.ldapstudio.browser.core.events.EntryUpdateListener;
 import org.apache.directory.ldapstudio.browser.core.events.EventRegistry;
+import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContainer;
+import org.apache.directory.ldapstudio.browser.ui.actions.SelectionUtils;
+import org.apache.directory.ldapstudio.browser.ui.views.connection.ConnectionView;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.INullSelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
 
 
+/**
+ * The ModificationLogsViewUniversalListener manages all events for the modification logs
view.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ModificationLogsViewUniversalListener implements EntryUpdateListener
 {
 
+    /** The modification log view. */
     private ModificationLogsView view;
 
-    ModificationLogsViewInput input;
+    /** The current input */
+    private ModificationLogsViewInput input;
 
+    /** Listener that listens for selections of connections */
+    private INullSelectionListener connectionSelectionListener = new INullSelectionListener()
+    {
+        /**
+         * {@inheritDoc}
+         * 
+         * This implementation sets the input when another connection was selected.
+         */
+        public void selectionChanged( IWorkbenchPart part, ISelection selection )
+        {
+            if ( view != null && part != null )
+            {
+                if ( view.getSite().getWorkbenchWindow() == part.getSite().getWorkbenchWindow()
)
+                {
+                    IConnection[] connections = SelectionUtils.getConnections( selection
);
+                    if ( connections.length == 1 )
+                    {
+                        ModificationLogsViewInput input = new ModificationLogsViewInput(
connections[0], 0 );
+                        setInput( input );
+                        scrollToNewest();
+                    }
+                }
+            }
+        }
+    };
 
+
+    /**
+     * Creates a new instance of ModificationLogsViewUniversalListener.
+     *
+     * @param view the modification logs view
+     */
     public ModificationLogsViewUniversalListener( ModificationLogsView view )
     {
         this.view = view;
-
         this.input = null;
+
         EventRegistry.addEntryUpdateListener( this );
+        view.getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(
ConnectionView.getId(),
+            connectionSelectionListener );
     }
 
 
+    /**
+     * Disposed this listener
+     */
     public void dispose()
     {
-        if ( this.view != null )
+        if ( view != null )
         {
+            view.getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(
+                ConnectionView.getId(), connectionSelectionListener );
+
             EventRegistry.removeEntryUpdateListener( this );
-            this.view = null;
+            view = null;
         }
     }
 
 
+    /**
+     * Refreshes the input.
+     */
     void refreshInput()
     {
-        ModificationLogsViewInput input = this.input;
-        this.input = null;
-        setInput( input );
+        ModificationLogsViewInput newInput = input;
+        input = null;
+        setInput( newInput );
     }
 
 
+    /**
+     * Sets the input.
+     * 
+     * @param input the input
+     */
     void setInput( ModificationLogsViewInput input )
     {
-
         // only if another connection is selected
         if ( this.input != input )
         {
-
             this.input = input;
 
             // load file %u %g
             StringBuffer sb = new StringBuffer();
-            File[] files = input.connection.getModificationLogger().getFiles();
-            int i = input.index;
+            File[] files = input.getConnection().getModificationLogger().getFiles();
+            int i = input.getIndex();
             if ( 0 <= i && i < files.length && files[i] != null &&
files[i].exists() && files[i].canRead() )
             {
                 try
@@ -98,13 +157,17 @@
             }
 
             // change input
-            this.view.getMainWidget().getSourceViewer().getDocument().set( sb.toString()
);
-            this.view.getActionGroup().setInput( input );
-
+            view.getMainWidget().getSourceViewer().getDocument().set( sb.toString() );
+            view.getActionGroup().setInput( input );
         }
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation refreshes the input.
+     */
     public void entryUpdated( EntryModificationEvent event )
     {
         if ( !( event instanceof AttributesInitializedEvent ) && !( event instanceof
ChildrenInitializedEvent ) )
@@ -115,22 +178,28 @@
     }
 
 
+    /**
+     * Scroll to oldest log entry.
+     */
     public void scrollToOldest()
     {
-        this.view.getMainWidget().getSourceViewer().setTopIndex( 0 );
+        view.getMainWidget().getSourceViewer().setTopIndex( 0 );
     }
 
 
+    /**
+     * Scroll to newest log entry.
+     */
     public void scrollToNewest()
     {
         try
         {
-            LdifContainer record = this.view.getMainWidget().getLdifModel().getLastContainer();
+            LdifContainer record = view.getMainWidget().getLdifModel().getLastContainer();
             int offset = record.getOffset();
-            int line = this.view.getMainWidget().getSourceViewer().getDocument().getLineOfOffset(
offset );
+            int line = view.getMainWidget().getSourceViewer().getDocument().getLineOfOffset(
offset );
             if ( line > 3 )
                 line -= 3;
-            this.view.getMainWidget().getSourceViewer().setTopIndex( line );
+            view.getMainWidget().getSourceViewer().setTopIndex( line );
         }
         catch ( Exception e )
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/NewerAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/NewerAction.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/NewerAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/NewerAction.java
Mon Mar  5 15:10:35 2007
@@ -27,29 +27,46 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 
 
+/**
+ * Action to switch to a newer logfile.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class NewerAction extends BrowserAction
 {
-
-    ModificationLogsView view;
+    
+    /** The modification logs view. */
+    private ModificationLogsView view;
 
 
+    /**
+     * Creates a new instance of NewerAction.
+     *
+     * @param view the modification logs view
+     */
     public NewerAction( ModificationLogsView view )
     {
-        super();
         this.view = view;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
         super.dispose();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         ModificationLogsViewInput oldInput = ( ModificationLogsViewInput ) getInput();
-        ModificationLogsViewInput newInput = new ModificationLogsViewInput( oldInput.connection,
oldInput.index - 1 );
+        ModificationLogsViewInput newInput = new ModificationLogsViewInput( oldInput.getConnection(),
oldInput.getIndex() - 1 );
         view.getUniversalListener().setInput( newInput );
         view.getUniversalListener().scrollToOldest();
 
@@ -58,28 +75,40 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getText()
     {
         return "Newer";
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ImageDescriptor getImageDescriptor()
     {
         return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_NEXT
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getCommandId()
     {
         return null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isEnabled()
     {
         return getInput() != null && ( getInput() instanceof ModificationLogsViewInput
)
-            && ( ( ModificationLogsViewInput ) getInput() ).index > 0;
+            && ( ( ModificationLogsViewInput ) getInput() ).getIndex() > 0;
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/OlderAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/OlderAction.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/OlderAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/OlderAction.java
Mon Mar  5 15:10:35 2007
@@ -29,62 +29,89 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 
 
+/**
+ * Action to switch to an older logfile.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class OlderAction extends BrowserAction
 {
 
+    /** The modification logs view. */
     private ModificationLogsView view;
 
 
+    /**
+     * Creates a new instance of OlderAction.
+     *
+     * @param view the modification logs view
+     */
     public OlderAction( ModificationLogsView view )
     {
-        super();
         this.view = view;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
         super.dispose();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         ModificationLogsViewInput oldInput = ( ModificationLogsViewInput ) getInput();
-        ModificationLogsViewInput newInput = new ModificationLogsViewInput( oldInput.connection,
oldInput.index + 1 );
+        ModificationLogsViewInput newInput = new ModificationLogsViewInput( oldInput.getConnection(),
oldInput
+            .getIndex() + 1 );
         view.getUniversalListener().setInput( newInput );
         view.getUniversalListener().scrollToNewest();
-
-        // go to bottom
-        // view.getMainWidget().getSourceViewer().setTopIndex(Integer.MAX_VALUE);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getText()
     {
         return "Older";
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ImageDescriptor getImageDescriptor()
     {
         return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_PREVIOUS
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getCommandId()
     {
         return null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isEnabled()
     {
         if ( getInput() != null && ( getInput() instanceof ModificationLogsViewInput
) )
         {
             ModificationLogsViewInput input = ( ModificationLogsViewInput ) getInput();
-            File[] files = input.connection.getModificationLogger().getFiles();
-            int i = input.index + 1;
+            File[] files = input.getConnection().getModificationLogger().getFiles();
+            int i = input.getIndex() + 1;
             if ( 0 <= i && i < files.length && files[i] != null &&
files[i].exists() && files[i].canRead() )
             {
                 return true;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/RefreshAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/RefreshAction.java?view=diff&rev=514908&r1=514907&r2=514908
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/RefreshAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/modificationlogs/RefreshAction.java
Mon Mar  5 15:10:35 2007
@@ -27,25 +27,42 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 
 
+/**
+ * Action to refresh the view from logfile.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class RefreshAction extends BrowserAction
 {
 
+    /** The modification logs view. */
     private ModificationLogsView view;
 
 
+    /**
+     * Creates a new instance of RefreshAction.
+     *
+     * @param view the modification logs view
+     */
     public RefreshAction( ModificationLogsView view )
     {
-        super();
         this.view = view;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
         super.dispose();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         // int topIndex = view.getMainWidget().getSourceViewer().getTopIndex();
@@ -55,24 +72,36 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getText()
     {
         return "Refresh";
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ImageDescriptor getImageDescriptor()
     {
         return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_REFRESH
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getCommandId()
     {
         return null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isEnabled()
     {
         return getInput() != null && ( getInput() instanceof ModificationLogsViewInput
);



Mime
View raw message