directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r660950 - in /directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views: ServerTableViewer.java ServersView.java
Date Wed, 28 May 2008 13:46:10 GMT
Author: pamarcelot
Date: Wed May 28 06:46:10 2008
New Revision: 660950

URL: http://svn.apache.org/viewvc?rev=660950&view=rev
Log:
o Internal reorganization.
o Added Javadoc.

Modified:
    directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServerTableViewer.java
    directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServersView.java

Modified: directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServerTableViewer.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServerTableViewer.java?rev=660950&r1=660949&r2=660950&view=diff
==============================================================================
--- directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServerTableViewer.java
(original)
+++ directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServerTableViewer.java
Wed May 28 06:46:10 2008
@@ -59,27 +59,28 @@
  */
 public class ServerTableViewer extends TreeViewer
 {
+    /** The root element */
     protected static final String ROOT = "root";
 
-    private ServersView view;
-
-    private boolean stopAnimation;
-
+    /** The label provider */
     private ServersViewLabelProvider labelProvider;
 
-    private List<ServerInstance> serversNeedingAnimation = new ArrayList<ServerInstance>();
-
     /** The server handler listener */
     private ServersHandlerListener serversHandlerListener;
 
     /** The server listener */
     private ServerListener serverListener;
 
+    /** A flag to stop the animation */
+    private boolean stopAnimation;
+
+    /** The list of server needing animation */
+    private List<ServerInstance> serversNeedingAnimation = new ArrayList<ServerInstance>();
+
 
-    public ServerTableViewer( ServersView view, Tree tree )
+    public ServerTableViewer( Tree tree )
     {
         super( tree );
-        this.view = view;
 
         labelProvider = new ServersViewLabelProvider();
         setLabelProvider( labelProvider );

Modified: directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServersView.java?rev=660950&r1=660949&r2=660950&view=diff
==============================================================================
--- directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServersView.java
(original)
+++ directory/studio/branches/apacheds-plugin-branch/apacheds/src/main/java/org/apache/directory/studio/apacheds/views/ServersView.java
Wed May 28 06:46:10 2008
@@ -110,20 +110,6 @@
             tableViewer.refresh();
         }
     };
-    
-    private SelectionListener getHeaderListener(final int col) {
-        return new SelectionAdapter() {
-            /**
-             * Handles the case of user selecting the header area.
-             */
-            public void widgetSelected(SelectionEvent e) {
-                if (tableViewer == null)
-                    return;
-                TreeColumn column = (TreeColumn) e.widget;
-                tableViewer.resortTable(column, col);
-            }
-        };
-    }
 
     private Tree tree;
 
@@ -151,7 +137,7 @@
         stateColumn.addSelectionListener( getHeaderListener( 1 ) );
 
         // Creating the viewer
-        tableViewer = new ServerTableViewer( this, tree );
+        tableViewer = new ServerTableViewer( tree );
 
         initActions();
         initToolbar();
@@ -160,21 +146,49 @@
     }
 
 
+    /**
+     * Gets a header listener for the given column.
+     * 
+     * @param col
+     *      the column
+     * @return
+     *      a header listener for the given column
+     */
+    private SelectionListener getHeaderListener( final int col )
+    {
+        return new SelectionAdapter()
+        {
+            /**
+             * Handles the case of user selecting the header area.
+             */
+            public void widgetSelected( SelectionEvent e )
+            {
+                if ( tableViewer == null )
+                    return;
+                TreeColumn column = ( TreeColumn ) e.widget;
+                tableViewer.resortTable( column, col );
+            }
+        };
+    }
+
+
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
      */
     public void init( IViewSite site, IMemento memento ) throws PartInitException
     {
         super.init( site, memento );
-        cols = new int[2];
+        cols = new int[]
+            { 200, 60 };
         for ( int i = 0; i < 2; i++ )
         {
-            cols[i] = 200;
             if ( memento != null )
             {
                 Integer in = memento.getInteger( TAG_COLUMN_WIDTH + i );
                 if ( in != null && in.intValue() > 5 )
+                {
                     cols[i] = in.intValue();
+                }
             }
         }
     }
@@ -190,7 +204,9 @@
         {
             int width = tc[i].getWidth();
             if ( width != 0 )
+            {
                 memento.putInteger( TAG_COLUMN_WIDTH + i, width );
+            }
         }
     }
 



Mime
View raw message