directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r751470 - /directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
Date Sun, 08 Mar 2009 17:19:43 GMT
Author: seelmann
Date: Sun Mar  8 17:19:43 2009
New Revision: 751470

URL: http://svn.apache.org/viewvc?rev=751470&view=rev
Log:
simplified loop, removed casts, changed order of toolbar

Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java?rev=751470&r1=751469&r2=751470&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
Sun Mar  8 17:19:43 2009
@@ -22,7 +22,6 @@
 
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
@@ -118,19 +117,14 @@
     {
         if ( mainWidget != null )
         {
-
             openSortDialogAction.dispose();
             openSortDialogAction = null;
             collapseAllAction.dispose();
             collapseAllAction = null;
 
-            for ( Iterator<String> it = browserActionMap.keySet().iterator(); it.hasNext();
)
+            for ( BrowserViewActionProxy action : browserActionMap.values() )
             {
-                String key = ( String ) it.next();
-                BrowserViewActionProxy action = browserActionMap.get( key );
                 action.dispose();
-                action = null;
-                it.remove();
             }
             browserActionMap.clear();
             browserActionMap = null;
@@ -159,10 +153,11 @@
      */
     public void fillToolBar( IToolBarManager toolBarManager )
     {
-        toolBarManager.add( ( IAction ) browserActionMap.get( upAction ) );
+        toolBarManager.add( browserActionMap.get( upAction ) );
+        toolBarManager.add( new Separator() );
+        toolBarManager.add( browserActionMap.get( refreshAction ) );
         toolBarManager.add( new Separator() );
         toolBarManager.add( collapseAllAction );
-        toolBarManager.add( ( IAction ) browserActionMap.get( refreshAction ) );
         toolBarManager.update( true );
     }
 
@@ -200,19 +195,19 @@
     public void menuAboutToShow( IMenuManager menuManager )
     {
         // up
-        menuManager.add( ( IAction ) browserActionMap.get( upAction ) );
+        menuManager.add( browserActionMap.get( upAction ) );
         menuManager.add( new Separator() );
 
         // filter
-        menuManager.add( ( IAction ) browserActionMap.get( filterChildrenAction ) );
-        if ( ( ( IAction ) browserActionMap.get( unfilterChildrenAction ) ).isEnabled() )
+        menuManager.add( browserActionMap.get( filterChildrenAction ) );
+        if ( ( browserActionMap.get( unfilterChildrenAction ) ).isEnabled() )
         {
-            menuManager.add( ( IAction ) browserActionMap.get( unfilterChildrenAction ) );
+            menuManager.add( browserActionMap.get( unfilterChildrenAction ) );
         }
         menuManager.add( new Separator() );
 
         // refresh
-        menuManager.add( ( IAction ) browserActionMap.get( refreshAction ) );
+        menuManager.add( browserActionMap.get( refreshAction ) );
         menuManager.add( new Separator() );
 
         // additions
@@ -220,7 +215,7 @@
         menuManager.add( new Separator() );
 
         // properties
-        menuManager.add( ( IAction ) browserActionMap.get( propertyDialogAction ) );
+        menuManager.add( browserActionMap.get( propertyDialogAction ) );
     }
 
 
@@ -239,15 +234,15 @@
         }
         else
         {
-            IAction pda = ( IAction ) browserActionMap.get( propertyDialogAction );
+            IAction pda = browserActionMap.get( propertyDialogAction );
             pda.setActionDefinitionId( BrowserCommonConstants.CMD_PROPERTIES );
             ActionUtils.activateActionHandler( pda );
 
-            IAction ra = ( IAction ) browserActionMap.get( refreshAction );
+            IAction ra = browserActionMap.get( refreshAction );
             ActionUtils.activateActionHandler( ra );
         }
 
-        IAction ua = ( IAction ) browserActionMap.get( upAction );
+        IAction ua = browserActionMap.get( upAction );
         ActionUtils.activateActionHandler( ua );
     }
 
@@ -265,14 +260,14 @@
         }
         else
         {
-            IAction ra = ( IAction ) browserActionMap.get( refreshAction );
+            IAction ra = browserActionMap.get( refreshAction );
             ActionUtils.deactivateActionHandler( ra );
 
-            IAction pda = ( IAction ) browserActionMap.get( propertyDialogAction );
+            IAction pda = browserActionMap.get( propertyDialogAction );
             ActionUtils.deactivateActionHandler( pda );
         }
 
-        IAction ua = ( IAction ) browserActionMap.get( upAction );
+        IAction ua = browserActionMap.get( upAction );
         ActionUtils.deactivateActionHandler( ua );
     }
 



Mime
View raw message