directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r550291 [1/2] - in /directory/studio/trunk: studio-ldapbrowser-common/ studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapb...
Date Sun, 24 Jun 2007 21:49:26 GMT
Author: seelmann
Date: Sun Jun 24 14:49:23 2007
New Revision: 550291

URL: http://svn.apache.org/viewvc?view=rev&rev=550291
Log:
DIRSTUDIO-117: Fixed problems with key bindings in modal dialogs.
- Introduced ActionHandlerManager interface to deactivate and activate action handlers and key bindings
- Deactivation of action handlers and key bindings whenever an action is invoked
- Refactored actions of search result editor

Added:
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ActionHandlerManager.java
Removed:
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractSearchResultListenerAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenMultiValuedEditorAction.java
Modified:
    directory/studio/trunk/studio-ldapbrowser-common/plugin.xml
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserViewActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ConnectionViewActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/EntryEditorActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/AbstractOpenEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EditAttributeDescriptionAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroupWithAttribute.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenBestEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenDefaultEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractOpenEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenBestEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenDefaultEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEditorAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewActionGroup.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java

Modified: directory/studio/trunk/studio-ldapbrowser-common/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/plugin.xml?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/plugin.xml (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/plugin.xml Sun Jun 24 14:49:23 2007
@@ -264,8 +264,8 @@
  <extension
        point="org.eclipse.ui.contexts">
        <context
-		name="Browser context"
-		description="Browser context"
+		name="LDAP Browser"
+		description="LDAP Browser"
 		id="org.apache.directory.studio.ldapbrowser.action.context"
 		parentId="org.eclipse.ui.contexts.window">
 	</context>

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserAction.java Sun Jun 24 14:49:23 2007
@@ -99,6 +99,9 @@
     /** The selected LDIF Parts */
     private LdifPart[] selectedLdifParts;
 
+    /** The selected properties. */
+    protected String[] selectedProperties;
+    
     /** The input */
     private Object input;
 
@@ -164,7 +167,6 @@
      * </p>
      *
      * @return the text, or <code>null</code> if none
-     * @see #TEXT
      */
     public abstract String getText();
 
@@ -177,7 +179,6 @@
      * </p>
      *
      * @return the image, or <code>null</code> if this action has no image
-     * @see #IMAGE
      */
     public abstract ImageDescriptor getImageDescriptor();
 
@@ -200,7 +201,6 @@
      *
      * @return <code>true</code> if enabled, and
      *   <code>false</code> if disabled
-     * @see #ENABLED
      */
     public abstract boolean isEnabled();
 
@@ -234,6 +234,8 @@
         this.selectedLdifModel = null;
         this.selectedLdifContainers = new LdifContainer[0];
         this.selectedLdifParts = new LdifPart[0];
+        
+        this.selectedProperties = new String[0];
 
         this.input = null;
     }
@@ -259,6 +261,8 @@
         this.selectedLdifModel = null;
         this.selectedLdifContainers = new LdifContainer[0];
         this.selectedLdifParts = new LdifPart[0];
+        
+        this.selectedProperties = new String[0];
 
         this.input = null;
     }
@@ -418,8 +422,8 @@
 
     /**
      * Get the selected Entries.
-     *
-     * @return
+     * 
+     * @return the selected entries
      */
     public IEntry[] getSelectedEntries()
     {
@@ -676,5 +680,27 @@
     public void setSelectedAttributeHierarchies( AttributeHierarchy[] ahs )
     {
         this.selectedAttributeHierarchies = ahs;
+    }
+
+
+    /**
+     * Gets the selected properties.
+     * 
+     * @return the selected properties
+     */
+    public String[] getSelectedProperties()
+    {
+        return selectedProperties;
+    }
+
+
+    /**
+     * Sets the selected properties.
+     * 
+     * @param selectedProperties the selected properties
+     */
+    public void setSelectedProperties( String[] selectedProperties )
+    {
+        this.selectedProperties = selectedProperties;
     }
 }

Added: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ActionHandlerManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ActionHandlerManager.java?view=auto&rev=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ActionHandlerManager.java (added)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ActionHandlerManager.java Sun Jun 24 14:49:23 2007
@@ -0,0 +1,24 @@
+
+package org.apache.directory.studio.ldapbrowser.common.actions.proxy;
+
+/**
+ * A ActionHandlerManager activates and deactives the action handlers.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface ActionHandlerManager
+{
+
+    /**
+     * Deactivates global action handlers.
+     */
+    public void deactivateGlobalActionHandlers();
+
+    
+    /**
+     * Activates global action handlers.
+     */
+    public void activateGlobalActionHandlers();
+
+}

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java Sun Jun 24 14:49:23 2007
@@ -45,21 +45,25 @@
     SearchUpdateListener, BookmarkUpdateListener, ConnectionUpdateListener
 {
 
+    /** The action handler manager, used to deactivate and activate the action handlers and key bindings. */
+    private ActionHandlerManager actionHandlerManager;
+    
     protected BrowserAction action;
 
     protected ISelectionProvider selectionProvider;
 
 
-    protected BrowserActionProxy( ISelectionProvider selectionProvider, BrowserAction action, int style )
+    protected BrowserActionProxy( ISelectionProvider selectionProvider, ActionHandlerManager actionHandlerManager, BrowserAction action, int style )
     {
         super( action.getText(), style );
         this.selectionProvider = selectionProvider;
+        this.actionHandlerManager = actionHandlerManager;
         this.action = action;
 
         super.setImageDescriptor( action.getImageDescriptor() );
         super.setActionDefinitionId( action.getCommandId() );
 
-        this.selectionProvider.addSelectionChangedListener( this );
+        selectionProvider.addSelectionChangedListener( this );
         // PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().addSelectionListener(this);
 
         EventRegistry.addConnectionUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
@@ -67,14 +71,13 @@
         EventRegistry.addSearchUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
         EventRegistry.addBookmarkUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
 
-        this.updateAction();
-
+        updateAction();
     }
 
 
-    protected BrowserActionProxy( ISelectionProvider selectionProvider, BrowserAction action )
+    protected BrowserActionProxy( ISelectionProvider selectionProvider, ActionHandlerManager actionHandlerManager, BrowserAction action )
     {
-        this( selectionProvider, action, Action.AS_PUSH_BUTTON );
+        this( selectionProvider, actionHandlerManager, action, Action.AS_PUSH_BUTTON );
     }
 
 
@@ -169,6 +172,9 @@
             this.action.setSelectedAttributes( SelectionUtils.getAttributes( selection ) );
             this.action.setSelectedAttributeHierarchies( SelectionUtils.getAttributeHierarchie( selection ) );
             this.action.setSelectedValues( SelectionUtils.getValues( selection ) );
+            
+            this.action.setSelectedProperties( SelectionUtils.getProperties( selection ) );
+            
             this.updateAction();
         }
     }
@@ -188,9 +194,21 @@
 
     public void run()
     {
-        if ( !this.isDisposed() )
+        if ( !isDisposed() )
         {
-            this.action.run();
+            // deactivate global actions
+            if ( actionHandlerManager != null )
+            {
+                actionHandlerManager.deactivateGlobalActionHandlers();
+            }
+            
+            action.run();
+
+            // activate global actions
+            if ( actionHandlerManager != null )
+            {
+                actionHandlerManager.activateGlobalActionHandlers();
+            }
         }
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserViewActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserViewActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserViewActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserViewActionProxy.java Sun Jun 24 14:49:23 2007
@@ -25,18 +25,26 @@
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * The BrowserViewActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class BrowserViewActionProxy extends BrowserActionProxy
 {
 
-    public BrowserViewActionProxy( Viewer viewer, BrowserAction action, int style )
+    /**
+     * Creates a new instance of BrowserViewActionProxy.
+     * 
+     * @param viewer the viewer
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public BrowserViewActionProxy( Viewer viewer, ActionHandlerManager actionHandlerManager, BrowserAction action )
     {
-        super( viewer, action, style );
-    }
-
-
-    public BrowserViewActionProxy( Viewer viewer, BrowserAction action )
-    {
-        super( viewer, action );
+        super( viewer, actionHandlerManager, action );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ConnectionViewActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ConnectionViewActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ConnectionViewActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/ConnectionViewActionProxy.java Sun Jun 24 14:49:23 2007
@@ -25,18 +25,26 @@
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * The ConnectionViewActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ConnectionViewActionProxy extends BrowserActionProxy
 {
 
-    public ConnectionViewActionProxy( Viewer viewer, BrowserAction action, int style )
+    /**
+     * Creates a new instance of ConnectionViewActionProxy.
+     * 
+     * @param viewer the viewer
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public ConnectionViewActionProxy( Viewer viewer, ActionHandlerManager actionHandlerManager, BrowserAction action )
     {
-        super( viewer, action, style );
-    }
-
-
-    public ConnectionViewActionProxy( Viewer viewer, BrowserAction action )
-    {
-        super( viewer, action );
+        super( viewer, actionHandlerManager, action );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/EntryEditorActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/EntryEditorActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/EntryEditorActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/EntryEditorActionProxy.java Sun Jun 24 14:49:23 2007
@@ -26,18 +26,26 @@
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * The EntryEditorActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorActionProxy extends BrowserActionProxy implements ISelectionChangedListener
 {
 
-    public EntryEditorActionProxy( Viewer viewer, BrowserAction action, int style )
+    /**
+     * Creates a new instance of EntryEditorActionProxy.
+     * 
+     * @param viewer the viewer
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public EntryEditorActionProxy( Viewer viewer, ActionHandlerManager actionHandlerManager, BrowserAction action )
     {
-        super( viewer, action, style );
-    }
-
-
-    public EntryEditorActionProxy( Viewer viewer, BrowserAction action )
-    {
-        super( viewer, action );
+        super( viewer, actionHandlerManager, action );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserActionGroup.java Sun Jun 24 14:49:23 2007
@@ -31,6 +31,7 @@
 import org.apache.directory.studio.ldapbrowser.common.actions.RefreshAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.UnfilterChildrenAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.UpAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserViewActionProxy;
 import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
 import org.eclipse.jface.action.IAction;
@@ -52,7 +53,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BrowserActionGroup implements IMenuListener
+public class BrowserActionGroup implements ActionHandlerManager, IMenuListener
 {
 
     /** The open sort dialog action. */
@@ -101,12 +102,13 @@
         openSortDialogAction = new OpenSortDialogAction( ( BrowserPreferences ) configuration.getPreferences() );
         collapseAllAction = new CollapseAllAction( viewer );
 
-        browserActionMap.put( upAction, new BrowserViewActionProxy( viewer, new UpAction( viewer ) ) );
-        browserActionMap.put( refreshAction, new BrowserViewActionProxy( viewer, new RefreshAction() ) );
-        browserActionMap.put( filterChildrenAction, new BrowserViewActionProxy( viewer, new FilterChildrenAction() ) );
-        browserActionMap
-            .put( unfilterChildrenAction, new BrowserViewActionProxy( viewer, new UnfilterChildrenAction() ) );
-        browserActionMap.put( propertyDialogAction, new BrowserViewActionProxy( viewer, new PropertiesAction() ) );
+        browserActionMap.put( upAction, new BrowserViewActionProxy( viewer, this, new UpAction( viewer ) ) );
+        browserActionMap.put( refreshAction, new BrowserViewActionProxy( viewer, this, new RefreshAction() ) );
+        browserActionMap.put( filterChildrenAction, new BrowserViewActionProxy( viewer, this,
+            new FilterChildrenAction() ) );
+        browserActionMap.put( unfilterChildrenAction, new BrowserViewActionProxy( viewer, this,
+            new UnfilterChildrenAction() ) );
+        browserActionMap.put( propertyDialogAction, new BrowserViewActionProxy( viewer, this, new PropertiesAction() ) );
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionActionGroup.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionActionGroup.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionActionGroup.java Sun Jun 24 14:49:23 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.studio.ldapbrowser.common.actions.PasteAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.PropertiesAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.RenameAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ConnectionViewActionProxy;
 import org.eclipse.jface.action.IAction;
@@ -55,7 +56,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ConnectionActionGroup implements IMenuListener
+public class ConnectionActionGroup implements ActionHandlerManager, IMenuListener
 {
 
     /** The Constant newConnectionAction. */
@@ -104,18 +105,22 @@
         this.connectionActionMap = new HashMap<String, ConnectionViewActionProxy>();
 
         TableViewer viewer = mainWidget.getViewer();
-        connectionActionMap
-            .put( newConnectionAction, new ConnectionViewActionProxy( viewer, new NewConnectionAction() ) );
-        connectionActionMap.put( openConnectionAction, new ConnectionViewActionProxy( viewer,
+        connectionActionMap.put( newConnectionAction, new ConnectionViewActionProxy( viewer, this,
+            new NewConnectionAction() ) );
+        connectionActionMap.put( openConnectionAction, new ConnectionViewActionProxy( viewer, this,
             new OpenConnectionAction() ) );
-        connectionActionMap.put( closeConnectionAction, new ConnectionViewActionProxy( viewer,
+        connectionActionMap.put( closeConnectionAction, new ConnectionViewActionProxy( viewer, this,
             new CloseConnectionAction() ) );
-        connectionActionMap.put( pasteConnectionAction, new ConnectionViewActionProxy( viewer, new PasteAction() ) );
-        connectionActionMap.put( copyConnectionAction, new ConnectionViewActionProxy( viewer, new CopyAction(
+        connectionActionMap
+            .put( pasteConnectionAction, new ConnectionViewActionProxy( viewer, this, new PasteAction() ) );
+        connectionActionMap.put( copyConnectionAction, new ConnectionViewActionProxy( viewer, this, new CopyAction(
             ( BrowserActionProxy ) connectionActionMap.get( pasteConnectionAction ) ) ) );
-        connectionActionMap.put( deleteConnectionAction, new ConnectionViewActionProxy( viewer, new DeleteAction() ) );
-        connectionActionMap.put( renameConnectionAction, new ConnectionViewActionProxy( viewer, new RenameAction() ) );
-        connectionActionMap.put( propertyDialogAction, new ConnectionViewActionProxy( viewer, new PropertiesAction() ) );
+        connectionActionMap.put( deleteConnectionAction, new ConnectionViewActionProxy( viewer, this,
+            new DeleteAction() ) );
+        connectionActionMap.put( renameConnectionAction, new ConnectionViewActionProxy( viewer, this,
+            new RenameAction() ) );
+        connectionActionMap.put( propertyDialogAction, new ConnectionViewActionProxy( viewer, this,
+            new PropertiesAction() ) );
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/AbstractOpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/AbstractOpenEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/AbstractOpenEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/AbstractOpenEditorAction.java Sun Jun 24 14:49:23 2007
@@ -42,9 +42,6 @@
 public abstract class AbstractOpenEditorAction extends BrowserAction implements FocusListener, KeyListener
 {
 
-    /** The action group. */
-    protected EntryEditorWidgetActionGroup actionGroup;
-
     /** The value editor manager. */
     protected ValueEditorManager valueEditorManager;
 
@@ -59,14 +56,11 @@
      * Creates a new instance of AbstractOpenEditorAction.
      * 
      * @param viewer the viewer
-     * @param actionGroup the action group
      * @param valueEditorManager the value editor manager
      */
-    protected AbstractOpenEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueEditorManager valueEditorManager )
+    protected AbstractOpenEditorAction( TreeViewer viewer, ValueEditorManager valueEditorManager )
     {
         this.viewer = viewer;
-        this.actionGroup = actionGroup;
         this.valueEditorManager = valueEditorManager;
     }
 
@@ -77,7 +71,6 @@
     public void dispose()
     {
         valueEditorManager = null;
-        actionGroup = null;
         viewer = null;
         cellEditor = null;
         super.dispose();
@@ -127,12 +120,6 @@
                 cellEditor.getControl().addKeyListener( this );
             }
 
-            // deactivate global actions
-            if ( actionGroup != null )
-            {
-                actionGroup.deactivateGlobalActionHandlers();
-            }
-
             // start editing
             viewer.editElement( getSelectedValues()[0], EntryEditorWidgetTableMetadata.VALUE_COLUMN_INDEX );
 
@@ -165,12 +152,6 @@
         {
             cellEditor.getControl().removeFocusListener( this );
             cellEditor.getControl().removeKeyListener( this );
-        }
-
-        // activate global actions
-        if ( actionGroup != null )
-        {
-            actionGroup.activateGlobalActionHandlers();
         }
 
         // reset custom value editor and set selection to notify all

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EditAttributeDescriptionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EditAttributeDescriptionAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EditAttributeDescriptionAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EditAttributeDescriptionAction.java Sun Jun 24 14:49:23 2007
@@ -55,7 +55,7 @@
      */
     public EditAttributeDescriptionAction( Viewer viewer )
     {
-        deleteActionProxy = new EntryEditorActionProxy( viewer, new DeleteAction() );
+        deleteActionProxy = new EntryEditorActionProxy( viewer, null, new DeleteAction() );
     }
 
 

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?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- 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 Sun Jun 24 14:49:23 2007
@@ -35,6 +35,7 @@
 import org.apache.directory.studio.ldapbrowser.common.actions.SelectAllAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.ShowRawValuesAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.ValueEditorPreferencesAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.EntryEditorActionProxy;
 import org.apache.directory.studio.valueeditors.IValueEditor;
@@ -58,7 +59,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class EntryEditorWidgetActionGroup
+public class EntryEditorWidgetActionGroup implements ActionHandlerManager
 {
 
     /** The open sort dialog action. */
@@ -127,28 +128,30 @@
         showRawValuesAction = new ShowRawValuesAction();
         showQuickFilterAction = new ShowQuickFilterAction( mainWidget.getQuickFilterWidget() );
 
-        openBestValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenBestEditorAction( viewer, this,
+        openBestValueEditorActionProxy = new EntryEditorActionProxy( viewer, this, new OpenBestEditorAction( viewer,
             configuration.getValueEditorManager( viewer ) ) );
-        openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenDefaultEditorAction( viewer,
-            openBestValueEditorActionProxy, false ) );
+        openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, this, new OpenDefaultEditorAction(
+            viewer, openBestValueEditorActionProxy, false ) );
         IValueEditor[] valueEditors = configuration.getValueEditorManager( viewer ).getAllValueEditors();
         openValueEditorActionProxies = new EntryEditorActionProxy[valueEditors.length];
         for ( int i = 0; i < openValueEditorActionProxies.length; i++ )
         {
-            openValueEditorActionProxies[i] = new EntryEditorActionProxy( viewer, new OpenEditorAction( viewer, this,
+            openValueEditorActionProxies[i] = new EntryEditorActionProxy( viewer, this, new OpenEditorAction( viewer,
                 configuration.getValueEditorManager( viewer ), valueEditors[i] ) );
         }
         openValueEditorPreferencesAction = new ValueEditorPreferencesAction();
 
-        entryEditorActionMap.put( newValueAction, new EntryEditorActionProxy( viewer, new NewValueAction() ) );
+        entryEditorActionMap.put( newValueAction, new EntryEditorActionProxy( viewer, this, new NewValueAction() ) );
 
-        entryEditorActionMap.put( pasteAction, new EntryEditorActionProxy( viewer, new PasteAction() ) );
-        entryEditorActionMap.put( copyAction, new EntryEditorActionProxy( viewer, new CopyAction(
+        entryEditorActionMap.put( pasteAction, new EntryEditorActionProxy( viewer, this, new PasteAction() ) );
+        entryEditorActionMap.put( copyAction, new EntryEditorActionProxy( viewer, this, new CopyAction(
             ( BrowserActionProxy ) entryEditorActionMap.get( pasteAction ) ) ) );
-        entryEditorActionMap.put( deleteAction, new EntryEditorActionProxy( viewer, new DeleteAction() ) );
-        entryEditorActionMap.put( selectAllAction, new EntryEditorActionProxy( viewer, new SelectAllAction( viewer ) ) );
+        entryEditorActionMap.put( deleteAction, new EntryEditorActionProxy( viewer, this, new DeleteAction() ) );
+        entryEditorActionMap.put( selectAllAction, new EntryEditorActionProxy( viewer, this, new SelectAllAction(
+            viewer ) ) );
 
-        entryEditorActionMap.put( propertyDialogAction, new EntryEditorActionProxy( viewer, new PropertiesAction() ) );
+        entryEditorActionMap.put( propertyDialogAction, new EntryEditorActionProxy( viewer, this,
+            new PropertiesAction() ) );
     }
 
 
@@ -211,14 +214,12 @@
      */
     public void fillToolBar( IToolBarManager toolBarManager )
     {
-
         toolBarManager.add( ( IAction ) entryEditorActionMap.get( newValueAction ) );
         toolBarManager.add( new Separator() );
         toolBarManager.add( ( IAction ) entryEditorActionMap.get( deleteAction ) );
         toolBarManager.add( new Separator() );
         toolBarManager.add( showQuickFilterAction );
         toolBarManager.update( true );
-
     }
 
 
@@ -322,7 +323,6 @@
      */
     public void activateGlobalActionHandlers()
     {
-
         ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
             ICommandService.class );
 
@@ -375,7 +375,6 @@
             commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler(
                 new ActionHandler( openDefaultValueEditorActionProxy ) );
         }
-
     }
 
 
@@ -384,7 +383,6 @@
      */
     public void deactivateGlobalActionHandlers()
     {
-
         ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
             ICommandService.class );
 
@@ -425,7 +423,6 @@
             commandService.getCommand( nva.getActionDefinitionId() ).setHandler( null );
             commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler( null );
         }
-
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroupWithAttribute.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroupWithAttribute.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroupWithAttribute.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroupWithAttribute.java Sun Jun 24 14:49:23 2007
@@ -67,12 +67,12 @@
         super( mainWidget, configuration );
         TreeViewer viewer = mainWidget.getViewer();
 
-        entryEditorActionMap.put( editAttributeDescriptionAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( editAttributeDescriptionAction, new EntryEditorActionProxy( viewer, this,
             new EditAttributeDescriptionAction( viewer ) ) );
-        entryEditorActionMap.put( newAttributeAction, new EntryEditorActionProxy( viewer, new NewAttributeAction() ) );
-        entryEditorActionMap.put( deleteAllValuesAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( newAttributeAction, new EntryEditorActionProxy( viewer, this,
+            new NewAttributeAction() ) );
+        entryEditorActionMap.put( deleteAllValuesAction, new EntryEditorActionProxy( viewer, this,
             new DeleteAllValuesAction() ) );
-
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenBestEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenBestEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenBestEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenBestEditorAction.java Sun Jun 24 14:49:23 2007
@@ -28,7 +28,6 @@
 
 
 /**
- * 
  * The OpenBestEditorAction is used to edit a value with the best value editor.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -45,13 +44,11 @@
      * Creates a new instance of OpenBestEditorAction.
      * 
      * @param viewer the viewer
-     * @param actionGroup the action group
      * @param valueEditorManager the value editor manager
      */
-    public OpenBestEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueEditorManager valueEditorManager )
+    public OpenBestEditorAction( TreeViewer viewer, ValueEditorManager valueEditorManager )
     {
-        super( viewer, actionGroup, valueEditorManager );
+        super( viewer, valueEditorManager );
     }
 
 
@@ -67,7 +64,7 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.AbstractOpenEditorAction#dispose()
      */
     public void dispose()
     {
@@ -77,9 +74,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
      */
-    @Override
     public String getCommandId()
     {
         return null;
@@ -87,9 +83,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
      */
-    @Override
     public ImageDescriptor getImageDescriptor()
     {
         return isEnabled() ? bestValueEditor.getValueEditorImageDescriptor() : null;
@@ -97,9 +92,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
      */
-    @Override
     public String getText()
     {
         return isEnabled() ? bestValueEditor.getValueEditorName() : null;
@@ -107,9 +101,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
      */
-    @Override
     public boolean isEnabled()
     {
         if ( getSelectedValues().length == 1

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenDefaultEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenDefaultEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenDefaultEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenDefaultEditorAction.java Sun Jun 24 14:49:23 2007
@@ -30,7 +30,6 @@
 
 
 /**
- * 
  * The OpenBestEditorAction is used to edit a value with the default value editor.
  * This is either the best value editor or in case of an RDN attribute the rename
  * action is invoked.
@@ -46,7 +45,7 @@
 
     /** The rename proxy. */
     private EntryEditorActionProxy renameProxy;
-    
+
 
     /**
      * Creates a new instance of OpenDefaultEditorAction.
@@ -55,15 +54,16 @@
      * @param bestValueEditorProxy the best value editor proxy
      * @param enableRenameAction true to enable rename action
      */
-    public OpenDefaultEditorAction( TreeViewer viewer, EntryEditorActionProxy bestValueEditorProxy, boolean enableRenameAction )
+    public OpenDefaultEditorAction( TreeViewer viewer, EntryEditorActionProxy bestValueEditorProxy,
+        boolean enableRenameAction )
     {
         this.bestValueEditorProxy = bestValueEditorProxy;
-        this.renameProxy = enableRenameAction ? new EntryEditorActionProxy( viewer, new RenameAction() ) : null;
+        this.renameProxy = enableRenameAction ? new EntryEditorActionProxy( viewer, null, new RenameAction() ) : null;
     }
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#dispose()
      */
     public void dispose()
     {
@@ -72,22 +72,20 @@
 
         super.dispose();
     }
-    
-    
+
+
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
      */
-    @Override
     public String getCommandId()
     {
         return BrowserCommonConstants.ACTION_ID_EDIT_VALUE;
     }
-    
-    
+
+
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
      */
-    @Override
     public ImageDescriptor getImageDescriptor()
     {
         if ( bestValueEditorProxy != null )
@@ -103,76 +101,54 @@
             return null;
         }
     }
-    
-    
+
+
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
      */
-    @Override
     public String getText()
     {
         return "Edit Value";
     }
-    
-    
+
+
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
      */
-    @Override
     public boolean isEnabled()
     {
-//      // update proxy selections
-//      if ( bestValueEditorProxy != null )
-//      {
-//          if ( this.currentSelectionChangedEvent != null )
-//          {
-//              this.valueEditorProxy.selectionChanged( currentSelectionChangedEvent );
-//          }
-//          this.valueEditorProxy.updateEnabledState();
-//      }
-//      if ( this.renameProxy != null )
-//      {
-//          if ( this.currentSelectionChangedEvent != null )
-//          {
-//              this.renameProxy.selectionChanged( currentSelectionChangedEvent );
-//          }
-//          this.renameProxy.updateAction();
-//      }
-
-      if ( bestValueEditorProxy != null && renameProxy != null )
-      {
-          return bestValueEditorProxy.isEnabled() || renameProxy.isEnabled();
-      }
-      else if ( renameProxy != null )
-      {
-          return renameProxy.isEnabled();
-      }
-      else if ( bestValueEditorProxy != null )
-      {
-          return bestValueEditorProxy.isEnabled();
-      }
-      else
-      {
-          return false;
-      }
+        if ( bestValueEditorProxy != null && renameProxy != null )
+        {
+            return bestValueEditorProxy.isEnabled() || renameProxy.isEnabled();
+        }
+        else if ( renameProxy != null )
+        {
+            return renameProxy.isEnabled();
+        }
+        else if ( bestValueEditorProxy != null )
+        {
+            return bestValueEditorProxy.isEnabled();
+        }
+        else
+        {
+            return false;
+        }
     }
-    
-    
+
+
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#run()
      */
-    @Override
     public void run()
     {
-      if ( bestValueEditorProxy != null && bestValueEditorProxy.isEnabled() )
-      {
-          bestValueEditorProxy.run();
-      }
-      else if ( renameProxy != null && renameProxy.isEnabled() )
-      {
-          renameProxy.run();
-      }
-        
+        if ( bestValueEditorProxy != null && bestValueEditorProxy.isEnabled() )
+        {
+            bestValueEditorProxy.run();
+        }
+        else if ( renameProxy != null && renameProxy.isEnabled() )
+        {
+            renameProxy.run();
+        }
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/OpenEditorAction.java Sun Jun 24 14:49:23 2007
@@ -46,14 +46,12 @@
      * Creates a new instance of OpenEditorAction.
      * 
      * @param viewer the viewer
-     * @param actionGroup the action group
      * @param valueEditorManager the value editor manager
      * @param valueEditor the specific value editor
      */
-    public OpenEditorAction( TreeViewer viewer, EntryEditorWidgetActionGroup actionGroup,
-        ValueEditorManager valueEditorManager, IValueEditor valueEditor )
+    public OpenEditorAction( TreeViewer viewer, ValueEditorManager valueEditorManager, IValueEditor valueEditor )
     {
-        super( viewer, actionGroup, valueEditorManager );
+        super( viewer, valueEditorManager );
         super.cellEditor = valueEditor.getCellEditor();
         this.valueEditor = valueEditor;
     }
@@ -71,7 +69,7 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.AbstractOpenEditorAction#run()
      */
     public void run()
     {
@@ -83,7 +81,7 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.AbstractOpenEditorAction#dispose()
      */
     public void dispose()
     {
@@ -93,9 +91,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
      */
-    @Override
     public String getCommandId()
     {
         return null;
@@ -103,9 +100,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
      */
-    @Override
     public ImageDescriptor getImageDescriptor()
     {
         return valueEditor.getValueEditorImageDescriptor();
@@ -113,9 +109,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
      */
-    @Override
     public String getText()
     {
         return valueEditor.getValueEditorName();
@@ -123,9 +118,8 @@
 
 
     /**
-     * {@inheritDoc}
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
      */
-    @Override
     public boolean isEnabled()
     {
         if ( getSelectedValues().length == 1

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java Sun Jun 24 14:49:23 2007
@@ -412,7 +412,10 @@
         {
             return this.getAlternativeValueEditors( ah.getAttribute().getEntry(), ah.getAttribute().getDescription() );
         }
-        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 1 )
+        else if ( ah.size() == 1
+            && ah.getAttribute().getValueSize() == 1
+            && ah.getAttributeDescription().equalsIgnoreCase(
+                ah.getAttribute().getValues()[0].getAttribute().getDescription() ) )
         {
 
             // special case objectClass and RDN: no alternative to the MV-Editor

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java Sun Jun 24 14:49:23 2007
@@ -22,22 +22,32 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * The ModificationLogsViewActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ModificationLogsViewActionProxy extends BrowserActionProxy
 {
 
-    public ModificationLogsViewActionProxy( Viewer viewer, BrowserAction action, int style )
+    /**
+     * Creates a new instance of ModificationLogsViewActionProxy.
+     * 
+     * @param viewer the viewer
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public ModificationLogsViewActionProxy( Viewer viewer, ActionHandlerManager actionHandlerManager,
+        BrowserAction action )
     {
-        super( viewer, action, style );
-    }
-
-
-    public ModificationLogsViewActionProxy( Viewer viewer, BrowserAction action )
-    {
-        super( viewer, action );
+        super( viewer, actionHandlerManager, action );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java Sun Jun 24 14:49:23 2007
@@ -22,22 +22,32 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
 import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorCursor;
 
 
+/**
+ * The SearchResultEditorActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class SearchResultEditorActionProxy extends BrowserActionProxy
 {
 
-    public SearchResultEditorActionProxy( SearchResultEditorCursor cursor, BrowserAction action, int style )
+    /**
+     * Creates a new instance of SearchResultEditorActionProxy.
+     * 
+     * @param cursor the cursor
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public SearchResultEditorActionProxy( SearchResultEditorCursor cursor, ActionHandlerManager actionHandlerManager,
+        BrowserAction action )
     {
-        super( cursor, action, style );
-    }
-
-
-    public SearchResultEditorActionProxy( SearchResultEditorCursor cursor, BrowserAction action )
-    {
-        super( cursor, action );
+        super( cursor, actionHandlerManager, action );
     }
 
 }

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?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- 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 Sun Jun 24 14:49:23 2007
@@ -165,63 +165,65 @@
 
         // create OpenDefaultEditorAction with enabled rename action flag
         openDefaultValueEditorActionProxy.dispose();
-        openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenDefaultEditorAction( viewer,
-            openBestValueEditorActionProxy, true ) );
+        openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, this, new OpenDefaultEditorAction(
+            viewer, openBestValueEditorActionProxy, true ) );
 
         showOperationalAttributesAction = new ShowOperationalAttributesAction();
         openEntryEditorPreferencePage = new OpenEntryEditorPreferencePageAction();
         collapseAllAction = new CollapseAllAction( viewer );
         expandAllAction = new ExpandAllAction( viewer );
 
-        entryEditorActionMap.put( editAttributeDescriptionAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( editAttributeDescriptionAction, new EntryEditorActionProxy( viewer, this,
             new EditAttributeDescriptionAction( viewer ) ) );
 
-        entryEditorActionMap.put( refreshAttributesAction, new EntryEditorActionProxy( viewer, new RefreshAction() ) );
+        entryEditorActionMap.put( refreshAttributesAction, new EntryEditorActionProxy( viewer, this,
+            new RefreshAction() ) );
 
-        entryEditorActionMap.put( newAttributeAction, new EntryEditorActionProxy( viewer, new NewAttributeAction() ) );
-        entryEditorActionMap.put( newSearchAction, new EntryEditorActionProxy( viewer, new NewSearchAction() ) );
-        entryEditorActionMap.put( newBatchOperationAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( newAttributeAction, new EntryEditorActionProxy( viewer, this,
+            new NewAttributeAction() ) );
+        entryEditorActionMap.put( newSearchAction, new EntryEditorActionProxy( viewer, this, new NewSearchAction() ) );
+        entryEditorActionMap.put( newBatchOperationAction, new EntryEditorActionProxy( viewer, this,
             new NewBatchOperationAction() ) );
 
-        entryEditorActionMap.put( locateDnInDitAction, new EntryEditorActionProxy( viewer, new LocateDnInDitAction() ) );
-        entryEditorActionMap.put( showOcdAction, new EntryEditorActionProxy( viewer, new OpenSchemaBrowserAction(
+        entryEditorActionMap.put( locateDnInDitAction, new EntryEditorActionProxy( viewer, this,
+            new LocateDnInDitAction() ) );
+        entryEditorActionMap.put( showOcdAction, new EntryEditorActionProxy( viewer, this, new OpenSchemaBrowserAction(
             OpenSchemaBrowserAction.MODE_OBJECTCLASS ) ) );
-        entryEditorActionMap.put( showAtdAction, new EntryEditorActionProxy( viewer, new OpenSchemaBrowserAction(
+        entryEditorActionMap.put( showAtdAction, new EntryEditorActionProxy( viewer, this, new OpenSchemaBrowserAction(
             OpenSchemaBrowserAction.MODE_ATTRIBUTETYPE ) ) );
-        entryEditorActionMap.put( showEqualityMrdAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( showEqualityMrdAction, new EntryEditorActionProxy( viewer, this,
             new OpenSchemaBrowserAction( OpenSchemaBrowserAction.MODE_EQUALITYMATCHINGRULE ) ) );
-        entryEditorActionMap.put( showSubstringMrdAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( showSubstringMrdAction, new EntryEditorActionProxy( viewer, this,
             new OpenSchemaBrowserAction( OpenSchemaBrowserAction.MODE_SUBSTRINGMATCHINGRULE ) ) );
-        entryEditorActionMap.put( showOrderingMrdAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( showOrderingMrdAction, new EntryEditorActionProxy( viewer, this,
             new OpenSchemaBrowserAction( OpenSchemaBrowserAction.MODE_ORDERINGMATCHINGRULE ) ) );
-        entryEditorActionMap.put( showLsdAction, new EntryEditorActionProxy( viewer, new OpenSchemaBrowserAction(
+        entryEditorActionMap.put( showLsdAction, new EntryEditorActionProxy( viewer, this, new OpenSchemaBrowserAction(
             OpenSchemaBrowserAction.MODE_SYNTAX ) ) );
 
-        entryEditorActionMap.put( copyDnAction, new EntryEditorActionProxy( viewer, new CopyDnAction() ) );
-        entryEditorActionMap.put( copyUrlAction, new EntryEditorActionProxy( viewer, new CopyUrlAction() ) );
-        entryEditorActionMap.put( copyAttriuteDescriptionAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( copyDnAction, new EntryEditorActionProxy( viewer, this, new CopyDnAction() ) );
+        entryEditorActionMap.put( copyUrlAction, new EntryEditorActionProxy( viewer, this, new CopyUrlAction() ) );
+        entryEditorActionMap.put( copyAttriuteDescriptionAction, new EntryEditorActionProxy( viewer, this,
             new CopyAttributeDescriptionAction() ) );
-        entryEditorActionMap.put( copyValueUtf8Action, new EntryEditorActionProxy( viewer, new CopyValueAction(
+        entryEditorActionMap.put( copyValueUtf8Action, new EntryEditorActionProxy( viewer, this, new CopyValueAction(
             CopyValueAction.MODE_UTF8 ) ) );
-        entryEditorActionMap.put( copyValueBase64Action, new EntryEditorActionProxy( viewer, new CopyValueAction(
+        entryEditorActionMap.put( copyValueBase64Action, new EntryEditorActionProxy( viewer, this, new CopyValueAction(
             CopyValueAction.MODE_BASE64 ) ) );
-        entryEditorActionMap.put( copyValueHexAction, new EntryEditorActionProxy( viewer, new CopyValueAction(
+        entryEditorActionMap.put( copyValueHexAction, new EntryEditorActionProxy( viewer, this, new CopyValueAction(
             CopyValueAction.MODE_HEX ) ) );
-        entryEditorActionMap.put( copyValueAsLdifAction, new EntryEditorActionProxy( viewer, new CopyValueAction(
+        entryEditorActionMap.put( copyValueAsLdifAction, new EntryEditorActionProxy( viewer, this, new CopyValueAction(
             CopyValueAction.MODE_LDIF ) ) );
 
-        entryEditorActionMap.put( copySearchFilterAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( copySearchFilterAction, new EntryEditorActionProxy( viewer, this,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_EQUALS ) ) );
-        entryEditorActionMap.put( copyNotSearchFilterAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( copyNotSearchFilterAction, new EntryEditorActionProxy( viewer, this,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_NOT ) ) );
-        entryEditorActionMap.put( copyAndSearchFilterAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( copyAndSearchFilterAction, new EntryEditorActionProxy( viewer, this,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_AND ) ) );
-        entryEditorActionMap.put( copyOrSearchFilterAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( copyOrSearchFilterAction, new EntryEditorActionProxy( viewer, this,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_OR ) ) );
 
-        entryEditorActionMap.put( deleteAllValuesAction, new EntryEditorActionProxy( viewer,
+        entryEditorActionMap.put( deleteAllValuesAction, new EntryEditorActionProxy( viewer, this,
             new DeleteAllValuesAction() ) );
-
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractOpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractOpenEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractOpenEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/AbstractOpenEditorAction.java Sun Jun 24 14:49:23 2007
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.ldapbrowser.ui.editors.searchresult;
 
 
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.TableViewer;
@@ -32,12 +33,9 @@
 import org.eclipse.swt.widgets.TableItem;
 
 
-public abstract class AbstractOpenEditorAction extends AbstractSearchResultListenerAction implements FocusListener,
-    KeyListener
+public abstract class AbstractOpenEditorAction extends BrowserAction implements FocusListener, KeyListener
 {
 
-    protected SearchResultEditorActionGroup actionGroup;
-
     protected ValueEditorManager valueEditorManager;
 
     protected TableViewer viewer;
@@ -50,10 +48,8 @@
 
 
     protected AbstractOpenEditorAction( TableViewer viewer, SearchResultEditorCursor cursor,
-        SearchResultEditorActionGroup actionGroup, ValueEditorManager valueEditorManager )
+        ValueEditorManager valueEditorManager )
     {
-        super( cursor, "Editor", null, null );
-        this.actionGroup = actionGroup;
         this.viewer = viewer;
         this.cursor = cursor;
         this.valueEditorManager = valueEditorManager;
@@ -110,9 +106,6 @@
             // deactivate cursor
             this.cursor.setVisible( false );
 
-            // deactivate global actions
-            this.actionGroup.deactivateGlobalActionHandlers();
-
             // start editing
             this.isActive = true;
             this.viewer.editElement( element, cursor.getColumn() );
@@ -165,9 +158,6 @@
             this.cellEditor.getControl().removeFocusListener( this );
             this.cellEditor.getControl().removeKeyListener( this );
         }
-
-        // activate global actions
-        this.actionGroup.activateGlobalActionHandlers();
 
         this.valueEditorManager.setUserSelectedValueEditor( null );
 

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenBestEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenBestEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenBestEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenBestEditorAction.java Sun Jun 24 14:49:23 2007
@@ -23,59 +23,96 @@
 
 import org.apache.directory.studio.valueeditors.IValueEditor;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.TableViewer;
 
 
 public class OpenBestEditorAction extends AbstractOpenEditorAction
 {
 
-    private IValueEditor valueEditor;
+    private IValueEditor bestValueEditor;
 
 
     public OpenBestEditorAction( TableViewer viewer, SearchResultEditorCursor cursor,
-        SearchResultEditorActionGroup actionGroup, ValueEditorManager valueEditorManager )
+        ValueEditorManager valueEditorManager )
     {
-        super( viewer, cursor, actionGroup, valueEditorManager );
+        super( viewer, cursor, valueEditorManager );
     }
 
 
+    /**
+     * Gets the best value editor.
+     * 
+     * @return the best value editor
+     */
     public IValueEditor getBestValueEditor()
     {
-        return this.valueEditor;
+        return this.bestValueEditor;
     }
 
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#dispose()
+     */
+    public void dispose()
+    {
+        bestValueEditor = null;
+        super.dispose();
+    }
 
-    protected void updateEnabledState()
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
+     */
+    public String getCommandId()
     {
+        return null;
+    }
 
-        if ( viewer.getCellModifier().canModify( this.selectedSearchResult, this.selectedProperty ) )
-        {
 
-            if ( this.selectedAttributeHierarchie == null )
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return isEnabled() ? bestValueEditor.getValueEditorImageDescriptor() : null;
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
+     */
+    public String getText()
+    {
+        return isEnabled() ? bestValueEditor.getValueEditorName() : null;
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
+     */
+    public boolean isEnabled()
+    {
+        if ( getSelectedSearchResults().length == 1 && getSelectedProperties().length == 1
+            && viewer.getCellModifier().canModify( getSelectedSearchResults()[0], getSelectedProperties()[0] ) )
+        {
+            if ( getSelectedAttributeHierarchies().length == 0 )
             {
-                this.valueEditor = this.valueEditorManager.getCurrentValueEditor( this.selectedSearchResult
-                    .getEntry(), this.selectedProperty );
+                bestValueEditor = valueEditorManager.getCurrentValueEditor( getSelectedSearchResults()[0].getEntry(),
+                    getSelectedProperties()[0] );
             }
             else
             {
-                this.valueEditor = this.valueEditorManager
-                    .getCurrentValueEditor( this.selectedAttributeHierarchie );
+                bestValueEditor = valueEditorManager.getCurrentValueEditor( getSelectedAttributeHierarchies()[0] );
             }
 
-            super.cellEditor = this.valueEditor.getCellEditor();
-            this.setEnabled( true );
-            this.setText( "" + this.valueEditor.getValueEditorName() );
-            this.setToolTipText( "" + this.valueEditor.getValueEditorName() );
-            this.setImageDescriptor( this.valueEditor.getValueEditorImageDescriptor() );
-
+            super.cellEditor = bestValueEditor.getCellEditor();
+            return true;
         }
         else
         {
-            this.setEnabled( false );
-            this.cellEditor = null;
-            this.setText( "Best Editor" );
-            this.setToolTipText( "Best Editor" );
-            this.setImageDescriptor( null );
+            super.cellEditor = null;
+            return false;
         }
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenDefaultEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenDefaultEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenDefaultEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenDefaultEditorAction.java Sun Jun 24 14:49:23 2007
@@ -22,48 +22,89 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.ui.actions.proxy.SearchResultEditorActionProxy;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.TableViewer;
 
 
-public class OpenDefaultEditorAction extends AbstractSearchResultListenerAction
+public class OpenDefaultEditorAction extends AbstractOpenEditorAction
 {
 
-    private OpenBestEditorAction proxy;
+    private SearchResultEditorActionProxy bestValueEditorProxy;
 
 
-    public OpenDefaultEditorAction( OpenBestEditorAction proxy )
+    public OpenDefaultEditorAction( TableViewer viewer, SearchResultEditorCursor cursor,
+        ValueEditorManager valueEditorManager, SearchResultEditorActionProxy bestValueEditorProxy )
     {
-        super( proxy.selectionProvider, "Edit Value", null, BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
-
-        this.proxy = proxy;
+        super( viewer, cursor, valueEditorManager );
+        this.bestValueEditorProxy = bestValueEditorProxy;
     }
 
 
     public void run()
     {
-        this.proxy.run();
-    }
-
-
-    protected void updateEnabledState()
-    {
-        this.proxy.updateEnabledState();
-        this.setEnabled( this.proxy.isEnabled() );
-
-        this.setImageDescriptor( this.proxy.getImageDescriptor() );
+        this.bestValueEditorProxy.run();
     }
 
 
     public void dispose()
     {
-        this.proxy = null;
+        this.bestValueEditorProxy = null;
 
         super.dispose();
     }
 
-
-    public boolean isActive()
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
+     */
+    public String getCommandId()
     {
-        return this.proxy.isActive();
+        return BrowserCommonConstants.ACTION_ID_EDIT_VALUE;
     }
-
+    
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        if ( bestValueEditorProxy != null )
+        {
+            return bestValueEditorProxy.getImageDescriptor();
+        }
+        else
+        {
+            return null;
+        }
+    }
+    
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
+     */
+    public String getText()
+    {
+        return "Edit Value";
+    }
+    
+    
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
+     */
+    public boolean isEnabled()
+    {
+        if ( bestValueEditorProxy != null )
+        {
+            return bestValueEditorProxy.isEnabled();
+        }
+        else
+        {
+            return false;
+        }
+    }
+    
+    
 }

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEditorAction.java?view=diff&rev=550291&r1=550290&r2=550291
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEditorAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEditorAction.java Sun Jun 24 14:49:23 2007
@@ -23,8 +23,10 @@
 
 import java.util.Arrays;
 
+import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.valueeditors.IValueEditor;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.TableViewer;
 
 
@@ -35,15 +37,12 @@
 
 
     public OpenEditorAction( TableViewer viewer, SearchResultEditorCursor cursor,
-        SearchResultEditorActionGroup actionGroup, ValueEditorManager valueEditorManager,
+        ValueEditorManager valueEditorManager,
         IValueEditor valueEditor )
     {
-        super( viewer, cursor, actionGroup, valueEditorManager );
+        super( viewer, cursor, valueEditorManager );
         super.cellEditor = valueEditor.getCellEditor();
         this.valueEditor = valueEditor;
-        this.setText( "" + this.valueEditor.getValueEditorName() );
-        this.setToolTipText( "" + this.valueEditor.getValueEditorName() );
-        this.setImageDescriptor( this.valueEditor.getValueEditorImageDescriptor() );
     }
 
 
@@ -53,36 +52,75 @@
     }
 
 
-    protected void updateEnabledState()
+    public void run()
+    {
+        this.valueEditorManager.setUserSelectedValueEditor( this.valueEditor );
+        super.run();
+    }
+
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#dispose()
+     */
+    public void dispose()
     {
+        this.valueEditor = null;
+        super.dispose();
+    }
 
-        if ( viewer.getCellModifier().canModify( this.selectedSearchResult, this.selectedProperty ) )
-        {
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getCommandId()
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getImageDescriptor()
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return valueEditor.getValueEditorImageDescriptor();
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#getText()
+     */
+    public String getText()
+    {
+        return valueEditor.getValueEditorName();
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction#isEnabled()
+     */
+    public boolean isEnabled()
+    {
+        if ( getSelectedSearchResults().length == 1 && getSelectedProperties().length == 1
+            && viewer.getCellModifier().canModify( getSelectedSearchResults()[0], getSelectedProperties()[0] ) )
+        {
             IValueEditor[] alternativeVps;
-            if ( this.selectedAttributeHierarchie == null )
+            if ( getSelectedAttributeHierarchies().length == 0 )
             {
-                this.setEnabled( false );
+                return false;
             }
             else
             {
-                alternativeVps = this.valueEditorManager
-                    .getAlternativeValueEditors( this.selectedAttributeHierarchie );
-                this.setEnabled( Arrays.asList( alternativeVps ).contains( this.valueEditor )
-                    && this.valueEditor.getRawValue( this.selectedAttributeHierarchie ) != null );
+                AttributeHierarchy ah = getSelectedAttributeHierarchies()[0];
+                alternativeVps = valueEditorManager.getAlternativeValueEditors( ah );
+                return Arrays.asList( alternativeVps ).contains( this.valueEditor )
+                    && valueEditor.getRawValue( ah ) != null;
             }
         }
         else
         {
-            this.setEnabled( false );
+            return false;
         }
-    }
-
-
-    public void run()
-    {
-        this.valueEditorManager.setUserSelectedValueEditor( this.valueEditor );
-        super.run();
     }
 
 }



Mime
View raw message