directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r759658 - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/ connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ connection-ui/src/main/java/org/apache/directo...
Date Sun, 29 Mar 2009 09:55:11 GMT
Author: seelmann
Date: Sun Mar 29 09:55:11 2009
New Revision: 759658

URL: http://svn.apache.org/viewvc?rev=759658&view=rev
Log:
Fix for DIRSTUDIO-411 (Select a new created folder in the connection view)

Modified:
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionFolderManager.java
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
    directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionFolderManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionFolderManager.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionFolderManager.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionFolderManager.java
Sun Mar 29 09:55:11 2009
@@ -106,7 +106,7 @@
         }
 
         folderList.add( connectionFolder );
-        ConnectionEventRegistry.fireConnectonFolderModified( connectionFolder, this );
+        ConnectionEventRegistry.fireConnectonFolderAdded( connectionFolder, this );
     }
 
 
@@ -119,7 +119,7 @@
     public void removeConnectionFolder( ConnectionFolder connectionFolder )
     {
         folderList.remove( connectionFolder );
-        ConnectionEventRegistry.fireConnectonFolderModified( connectionFolder, this );
+        ConnectionEventRegistry.fireConnectonFolderRemoved( connectionFolder, this );
     }
 
 
@@ -344,6 +344,24 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+        saveConnectionFolders();
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+        saveConnectionFolders();
+    }
+
+
+    /**
      * Saves the Connection Folders
      */
     private synchronized void saveConnectionFolders()

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
Sun Mar 29 09:55:11 2009
@@ -342,6 +342,22 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
      * Saves the Connections
      */
     private synchronized void saveConnections()

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
Sun Mar 29 09:55:11 2009
@@ -332,5 +332,75 @@
             }
         }
     }
+    /**
+     * Notifies each {@link ConnectionUpdateListener} about the added connection folder.
+     * Uses the {@link EventRunner}s.
+     *
+     * @param connectionFolder the added connection folder
+     * @param source the source
+     */
+    public static void fireConnectonFolderAdded( final ConnectionFolder connectionFolder,
final Object source )
+    {
+        if ( isEventFireingSuspendedInCurrentThread() )
+        {
+            return;
+        }
+        
+        Map<ConnectionUpdateListener, EventRunner> listeners = new HashMap<ConnectionUpdateListener,
EventRunner>(
+            connectionUpdateListeners );
+        Iterator<ConnectionUpdateListener> it = listeners.keySet().iterator();
+        while ( it.hasNext() )
+        {
+            final ConnectionUpdateListener listener = it.next();
+            EventRunnable runnable = new EventRunnable()
+            {
+                public void run()
+                {
+                    listener.connectionFolderAdded( connectionFolder );
+                }
+            };
+            
+            EventRunner runner = listeners.get( listener );
+            synchronized ( lock )
+            {
+                runner.execute( runnable );
+            }
+        }
+    }
+    /**
+     * Notifies each {@link ConnectionUpdateListener} about the removed connection folder.
+     * Uses the {@link EventRunner}s.
+     *
+     * @param connectionFolder the removed connection folder
+     * @param source the source
+     */
+    public static void fireConnectonFolderRemoved( final ConnectionFolder connectionFolder,
final Object source )
+    {
+        if ( isEventFireingSuspendedInCurrentThread() )
+        {
+            return;
+        }
+        
+        Map<ConnectionUpdateListener, EventRunner> listeners = new HashMap<ConnectionUpdateListener,
EventRunner>(
+            connectionUpdateListeners );
+        Iterator<ConnectionUpdateListener> it = listeners.keySet().iterator();
+        while ( it.hasNext() )
+        {
+            final ConnectionUpdateListener listener = it.next();
+            EventRunnable runnable = new EventRunnable()
+            {
+                public void run()
+                {
+                    listener.connectionFolderRemoved( connectionFolder );
+                }
+            };
+            
+            EventRunner runner = listeners.get( listener );
+            synchronized ( lock )
+            {
+                runner.execute( runnable );
+            }
+        }
+    }
 
 }

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
Sun Mar 29 09:55:11 2009
@@ -77,10 +77,26 @@
 
 
     /**
-     * Called when {@link ConnectionFolder}s were modified.
+     * Called when an {@link ConnectionFolder} was modified.
      *
      * @param connectionFolder the modified connection folder 
      */
     public void connectionFolderModified( ConnectionFolder connectionFolder );
+    
+    
+    /**
+     * Called when an {@link ConnectionFolder} was added.
+     *
+     * @param connectionFolder the added connection folder 
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder );
+    
+    
+    /**
+     * Called when an {@link ConnectionFolder} was removed.
+     *
+     * @param connectionFolder the removed connection folder 
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder );
 
 }

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
Sun Mar 29 09:55:11 2009
@@ -177,6 +177,24 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+    }
+
+
+    /**
      * Input changed.
      * 
      * @param input the input

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
Sun Mar 29 09:55:11 2009
@@ -156,4 +156,26 @@
         connectionUpdated( null );
     }
 
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+        if ( viewer != null )
+        {
+            viewer.setSelection( new StructuredSelection( connectionFolder ), true );
+        }
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+    }
+
 }

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
Sun Mar 29 09:55:11 2009
@@ -184,6 +184,24 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+        connectionUpdated( null );
+    }
+
+
     public void inputChanged( Object input )
     {
         if ( !this.isDisposed() )

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
Sun Mar 29 09:55:11 2009
@@ -207,6 +207,22 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
      * {@inheritDoc}
      *
      * This implementation refreshes the tree.

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
Sun Mar 29 09:55:11 2009
@@ -275,6 +275,22 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
      * @see org.apache.directory.studio.ldapbrowser.core.events.BrowserConnectionUpdateListener#browserConnectionUpdated(org.apache.directory.studio.ldapbrowser.core.events.BrowserConnectionUpdateEvent)
      */
     public void browserConnectionUpdated( BrowserConnectionUpdateEvent browserConnectionUpdateEvent
)

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/BrowserConnectionWidgetContributionItem.java
Sun Mar 29 09:55:11 2009
@@ -254,4 +254,23 @@
     {
         // Nothing to do
     }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+        // Nothing to do
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+        // Nothing to do
+    }
+
 }
\ No newline at end of file

Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java?rev=759658&r1=759657&r2=759658&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
(original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
Sun Mar 29 09:55:11 2009
@@ -640,6 +640,22 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderAdded( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     */
+    public void connectionFolderRemoved( ConnectionFolder connectionFolder )
+    {
+    }
+
+
+    /**
      * This implementation checks if the input is of type
      * NonExistingLdifEditorInput. In that case doSaveAs() is
      * called to prompt for a new file name and location.



Mime
View raw message