directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r609215 - in /directory/studio/trunk: studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/ studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/
Date Sat, 05 Jan 2008 21:05:13 GMT
Author: seelmann
Date: Sat Jan  5 13:05:11 2008
New Revision: 609215

URL: http://svn.apache.org/viewvc?rev=609215&view=rev
Log:
Usage of foreach loop

Modified:
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java?rev=609215&r1=609214&r2=609215&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
Sat Jan  5 13:05:11 2008
@@ -22,7 +22,6 @@
 
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
@@ -171,20 +170,15 @@
             openDefaultValueEditorActionProxy = null;
             openBestValueEditorActionProxy.dispose();
             openBestValueEditorActionProxy = null;
-            for ( int i = 0; i < openValueEditorActionProxies.length; i++ )
+            for ( EntryEditorActionProxy action : openValueEditorActionProxies )
             {
-                openValueEditorActionProxies[i].dispose();
-                openValueEditorActionProxies[i] = null;
+                action.dispose();
             }
             openValueEditorPreferencesAction = null;
 
-            for ( Iterator it = entryEditorActionMap.keySet().iterator(); it.hasNext(); )
+            for ( EntryEditorActionProxy action : entryEditorActionMap.values() )
             {
-                String key = ( String ) it.next();
-                EntryEditorActionProxy action = ( EntryEditorActionProxy ) entryEditorActionMap.get(
key );
                 action.dispose();
-                action = null;
-                it.remove();
             }
             entryEditorActionMap.clear();
             entryEditorActionMap = null;
@@ -303,13 +297,13 @@
             editorMenuManager.add( openBestValueEditorActionProxy );
             editorMenuManager.add( new Separator() );
         }
-        for ( int i = 0; i < openValueEditorActionProxies.length; i++ )
+        for ( EntryEditorActionProxy action : openValueEditorActionProxies )
         {
-            if ( openValueEditorActionProxies[i].isEnabled()
-                && ( ( OpenEditorAction ) openValueEditorActionProxies[i].getAction()
).getValueEditor().getClass() != ( ( OpenBestEditorAction ) openBestValueEditorActionProxy
+            if ( action.isEnabled()
+                && ( ( OpenEditorAction ) action.getAction() ).getValueEditor().getClass()
!= ( ( OpenBestEditorAction ) openBestValueEditorActionProxy
                     .getAction() ).getBestValueEditor().getClass() )
             {
-                editorMenuManager.add( openValueEditorActionProxies[i] );
+                editorMenuManager.add( action );
             }
         }
         editorMenuManager.add( new Separator() );

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java?rev=609215&r1=609214&r2=609215&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
Sat Jan  5 13:05:11 2008
@@ -21,8 +21,6 @@
 package org.apache.directory.studio.ldapbrowser.ui.editors.entry;
 
 
-import java.util.Iterator;
-
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.actions.CollapseAllAction;
@@ -427,9 +425,8 @@
      */
     public void setInput( IEntry entry )
     {
-        for ( Iterator it = entryEditorActionMap.values().iterator(); it.hasNext(); )
+        for ( EntryEditorActionProxy action : entryEditorActionMap.values() )
         {
-            EntryEditorActionProxy action = ( EntryEditorActionProxy ) it.next();
             action.inputChanged( entry );
         }
     }



Mime
View raw message