directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r928234 - in /directory/studio/trunk: ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/ ldapbrowser-...
Date Sat, 27 Mar 2010 17:11:08 GMT
Author: seelmann
Date: Sat Mar 27 17:11:07 2010
New Revision: 928234

URL: http://svn.apache.org/viewvc?rev=928234&view=rev
Log:
Fix for DIRSTUDIO-637 (copy/paste of attributes no longer works):
o sub-classed paste action into specialized classes
o entry editor and search result editor paste action only modify the model, modification in directory is managed by the editors
o browser paste action directly modifies the entry in directory

Added:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorPasteAction.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java
Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages.properties
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_de.properties
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_fr.properties
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages.properties
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_de.properties
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_fr.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_de.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_fr.properties
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorPasteAction.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java Sat Mar 27 17:11:07 2010
@@ -21,32 +21,12 @@
 package org.apache.directory.studio.ldapbrowser.common.actions;
 
 
-import org.apache.directory.studio.connection.core.Utils;
-import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
-import org.apache.directory.studio.ldapbrowser.common.dialogs.EntryExistsCopyStrategyDialogImpl;
-import org.apache.directory.studio.ldapbrowser.common.dialogs.ScopeDialog;
-import org.apache.directory.studio.ldapbrowser.common.dnd.EntryTransfer;
-import org.apache.directory.studio.ldapbrowser.common.dnd.SearchTransfer;
-import org.apache.directory.studio.ldapbrowser.common.dnd.ValuesTransfer;
-import org.apache.directory.studio.ldapbrowser.core.jobs.CopyEntriesJob;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
-import org.apache.directory.studio.ldapbrowser.core.utils.CompoundModification;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.dnd.Clipboard;
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
 import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 
 
@@ -56,7 +36,7 @@ import org.eclipse.ui.texteditor.IWorkbe
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class PasteAction extends BrowserAction
+public abstract class PasteAction extends BrowserAction
 {
     /**
      * Creates a new instance of PasteAction.
@@ -70,36 +50,6 @@ public class PasteAction extends Browser
     /**
      * {@inheritDoc}
      */
-    public String getText()
-    {
-        // entry
-        IEntry[] entries = getEntriesToPaste();
-        if ( entries != null )
-        {
-            return entries.length > 1 ? Messages.getString( "PasteAction.PasteEntries" ) : Messages.getString( "PasteAction.PasteEntry" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        // searches
-        ISearch[] searches = getSearchesToPaste();
-        if ( searches != null )
-        {
-            return searches.length > 1 ? Messages.getString( "PasteAction.PasteSearches" ) : Messages.getString( "PasteAction.PasteSearch" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        // value
-        IValue[] values = getValuesToPaste();
-        if ( values != null )
-        {
-            return values.length > 1 ? Messages.getString( "PasteAction.PasteValues" ) : Messages.getString( "PasteAction.PasteValue" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        return Messages.getString( "PasteAction.Paste" ); //$NON-NLS-1$
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public ImageDescriptor getImageDescriptor()
     {
         return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor( ISharedImages.IMG_TOOL_PASTE );
@@ -116,262 +66,6 @@ public class PasteAction extends Browser
 
 
     /**
-     * {@inheritDoc}
-     */
-    public boolean isEnabled()
-    {
-        // entry
-        if ( getEntriesToPaste() != null )
-        {
-            return true;
-        }
-
-        // search
-        else if ( getSearchesToPaste() != null )
-        {
-            return true;
-        }
-
-        // value
-        else if ( getValuesToPaste() != null )
-        {
-            return true;
-        }
-
-        return false;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void run()
-    {
-        // entry
-        IEntry[] entries = getEntriesToPaste();
-        if ( entries != null )
-        {
-            pasteEntries( getSelectedEntries()[0], entries );
-            return;
-        }
-
-        // search
-        ISearch[] searches = getSearchesToPaste();
-        if ( searches != null )
-        {
-            pasteSearches( searches );
-            return;
-        }
-
-        // value
-        IValue[] values = getValuesToPaste();
-        if ( values != null )
-        {
-            pasteValues( values );
-            return;
-        }
-
-    }
-
-
-    /**
-     * Pastes the given entries
-     *
-     * @param parent
-     *      the parent Entry
-     * @param entriesToPaste
-     *      the Entries to paste
-     */
-    private void pasteEntries( final IEntry parent, final IEntry[] entriesToPaste )
-    {
-        SearchScope scope = SearchScope.OBJECT;
-        boolean askForScope = false;
-        for ( int i = 0; i < entriesToPaste.length; i++ )
-        {
-            if ( entriesToPaste[i].hasChildren() )
-            {
-                askForScope = true;
-                break;
-            }
-        }
-        if ( askForScope )
-        {
-            ScopeDialog scopeDialog = new ScopeDialog( Display.getDefault().getActiveShell(), Messages
-                .getString( "PasteAction.SelectCopyDepth" ), //$NON-NLS-1$
-                entriesToPaste.length > 1 );
-            scopeDialog.open();
-            scope = scopeDialog.getScope();
-        }
-
-        new CopyEntriesJob( parent, entriesToPaste, scope, new EntryExistsCopyStrategyDialogImpl( Display.getDefault()
-            .getActiveShell() ) ).execute();
-    }
-
-
-    private void pasteSearches( ISearch[] searches )
-    {
-        IBrowserConnection browserConnection = null;
-        if ( getSelectedBrowserViewCategories().length > 0 )
-        {
-            browserConnection = getSelectedBrowserViewCategories()[0].getParent();
-        }
-        else if ( getSelectedSearches().length > 0 )
-        {
-            browserConnection = getSelectedSearches()[0].getBrowserConnection();
-        }
-
-        if ( browserConnection != null )
-        {
-            ISearch clone = null;
-            for ( ISearch search : searches )
-            {
-                SearchParameter searchParameter = ( SearchParameter ) search.getSearchParameter().clone();
-                clone = new Search( browserConnection, searchParameter );
-                browserConnection.getSearchManager().addSearch( clone );
-            }
-
-            if ( searches.length == 1 )
-            {
-                IAdaptable element = ( IAdaptable ) clone;
-                String pageId = BrowserCommonConstants.PROP_SEARCH;
-                String title = clone.getName();
-
-                PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( getShell(), element, pageId, null,
-                    null );
-                if ( dialog != null )
-                {
-                    title = Utils.shorten( title, 30 );
-                }
-                dialog.getShell().setText( NLS.bind( Messages.getString( "PropertiesAction.PropertiesForX" ), title ) ); //$NON-NLS-1$
-                dialog.open();
-            }
-        }
-    }
-
-
-    /**
-     * Paste Values
-     *
-     * @param values
-     *      the Values to paste
-     */
-    private void pasteValues( IValue[] values )
-    {
-        IEntry entry = null;
-        if ( getSelectedAttributes().length > 0 )
-        {
-            entry = getSelectedAttributes()[0].getEntry();
-        }
-        else if ( getSelectedValues().length > 0 )
-        {
-            entry = getSelectedValues()[0].getAttribute().getEntry();
-        }
-        else if ( getSelectedEntries().length == 1 )
-        {
-            entry = getSelectedEntries()[0];
-        }
-        else if ( getSelectedSearchResults().length == 1 )
-        {
-            entry = getSelectedSearchResults()[0].getEntry();
-        }
-        else if ( getSelectedBookmarks().length == 1 )
-        {
-            entry = getSelectedBookmarks()[0].getEntry();
-        }
-
-        if ( entry != null )
-        {
-            new CompoundModification().createValues( entry, values );
-        }
-    }
-
-
-    /**
-     * Conditions: 
-     * <li>an entry is selected</li>
-     * <li>there are entries in clipboard</li>
-     * 
-     * @return
-     */
-    private IEntry[] getEntriesToPaste()
-    {
-        if ( getSelectedBookmarks().length + getSelectedSearchResults().length + getSelectedSearches().length
-            + getSelectedConnections().length + getSelectedAttributes().length + getSelectedValues().length == 0
-            && getSelectedEntries().length == 1 )
-        {
-
-            Object content = this.getFromClipboard( EntryTransfer.getInstance() );
-            if ( content != null && content instanceof IEntry[] )
-            {
-                IEntry[] entries = ( IEntry[] ) content;
-                return entries;
-            }
-        }
-
-        return null;
-    }
-
-
-    /**
-     * Conditions: 
-     * <li>a search or category is selected</li> 
-     * <li>there are searches in clipboard</li>
-     * 
-     * @return
-     */
-    private ISearch[] getSearchesToPaste()
-    {
-        if ( getSelectedBookmarks().length + getSelectedSearchResults().length + getSelectedEntries().length
-            + getSelectedConnections().length + getSelectedAttributes().length + getSelectedValues().length == 0
-            && ( getSelectedSearches().length + getSelectedBrowserViewCategories().length > 0 ) )
-        {
-            Object content = this.getFromClipboard( SearchTransfer.getInstance() );
-            if ( content != null && content instanceof ISearch[] )
-            {
-                ISearch[] searches = ( ISearch[] ) content;
-                return searches;
-            }
-        }
-
-        return null;
-    }
-
-
-    /**
-     * Conditions: 
-     * <li>an attribute or value is selected</li>
-     * <li>there are values in clipboard</li>
-     * 
-     * @return
-     */
-    private IValue[] getValuesToPaste()
-    {
-        if ( ( getSelectedEntries().length + getSelectedSearchResults().length + getSelectedBookmarks().length
-            + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedAttributes().length
-            + getSelectedValues().length > 0 ) )
-            || ( getSelectedAttributes().length + getSelectedValues().length + getSelectedSearchResults().length
-                + getSelectedBookmarks().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedEntries().length == 1 ) )
-            || ( getSelectedAttributes().length + getSelectedValues().length + getSelectedEntries().length
-                + getSelectedSearchResults().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedBookmarks().length == 1 ) )
-            || ( getSelectedAttributes().length + getSelectedValues().length + getSelectedEntries().length
-                + getSelectedBookmarks().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedSearchResults().length == 1 ) )
-
-        )
-        {
-
-            Object content = this.getFromClipboard( ValuesTransfer.getInstance() );
-            if ( content != null && content instanceof IValue[] )
-            {
-                IValue[] values = ( IValue[] ) content;
-                return values;
-            }
-        }
-
-        return null;
-    }
-
-
-    /**
      * Retrieve the data of the specified type currently available on the system clipboard.
      *
      * @param dataType

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages.properties Sat Mar 27 17:11:07 2010
@@ -65,14 +65,6 @@ NewAttributeAction.NewAttribute=New Attr
 NewAttributeAction.NewAttributeLabel=New Attribute...
 NewValueAction.NewValue=New Value
 OpenQuickSearchAction.OpenQuickSearch=Quick Search
-PasteAction.Paste=Paste
-PasteAction.PasteEntries=Paste Entries
-PasteAction.PasteEntry=Paste Entry
-PasteAction.PasteSearches=Paste Searches
-PasteAction.PasteSearch=Paste Search
-PasteAction.PasteValue=Paste Value
-PasteAction.PasteValues=Paste Values
-PasteAction.SelectCopyDepth=Select Copy Depth
 PropertiesAction.Properties=Properties
 PropertiesAction.PropertiesForX=Properties for {0}
 RefreshAction.PerformSearch=Perform Search

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_de.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_de.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_de.properties Sat Mar 27 17:11:07 2010
@@ -65,14 +65,6 @@ NewAttributeAction.NewAttribute=Neues At
 NewAttributeAction.NewAttributeLabel=Neues Attribut...
 NewValueAction.NewValue=Neuer Wert
 OpenQuickSearchAction.OpenQuickSearch=Schnellsuche
-PasteAction.Paste=Einf\u00FCgen
-PasteAction.PasteEntries=Eintr\u00E4ge einf\u00FCgen
-PasteAction.PasteEntry=Eintrag einf\u00FCgen
-PasteAction.PasteSearches=Suchen einf\u00FCgen
-PasteAction.PasteSearch=Suche einf\u00FCgen
-PasteAction.PasteValue=Wert einf\u00FCgen
-PasteAction.PasteValues=Werte einf\u00FCgen
-PasteAction.SelectCopyDepth=Kopiertiefe ausw\u00E4hlen
 PropertiesAction.Properties=Eigenschaften
 PropertiesAction.PropertiesForX=Eigenschaften f\u00FCr {0}
 RefreshAction.PerformSearch=Suche auf\u00FChren

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_fr.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_fr.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/messages_fr.properties Sat Mar 27 17:11:07 2010
@@ -65,14 +65,6 @@ NewAttributeAction.NewAttribute=Nouvel a
 NewAttributeAction.NewAttributeLabel=Nouvel attribut...
 NewValueAction.NewValue=Nouvelle valeur
 OpenQuickSearchAction.OpenQuickSearch=Recherche rapide
-PasteAction.Paste=Coller
-PasteAction.PasteEntries=Coller les entr\u00E9es
-PasteAction.PasteEntry=Coller l'entr\u00E9e
-PasteAction.PasteSearches=Coller les recherches
-PasteAction.PasteSearch=Coller la recherche
-PasteAction.PasteValue=Coller la valeur
-PasteAction.PasteValues=Coller les valeurs
-PasteAction.SelectCopyDepth=S\u00E9lectionner la profondeur de copie
 PropertiesAction.Properties=Propri\u00E9t\u00E9s
 PropertiesAction.PropertiesForX=Propri\u00E9t\u00E9s pour {0}
 RefreshAction.PerformSearch=Lancer la recherche

Added: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorPasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorPasteAction.java?rev=928234&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorPasteAction.java (added)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorPasteAction.java Sat Mar 27 17:11:07 2010
@@ -0,0 +1,128 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.PasteAction;
+import org.apache.directory.studio.ldapbrowser.common.dnd.ValuesTransfer;
+import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.IValue;
+import org.apache.directory.studio.ldapbrowser.core.utils.CompoundModification;
+
+
+/**
+ * This class implements the paste action for the tabular entry editor. 
+ * It copies attribute-values to another entry.
+ * It does not invoke an UpdateEntryRunnable but only updates the model.
+ */
+public class EntryEditorPasteAction extends PasteAction
+{
+
+    /**
+     * Creates a new instance of EntryEditorPasteAction.
+     */
+    public EntryEditorPasteAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        IValue[] values = getValuesToPaste();
+        if ( values != null )
+        {
+            return values.length > 1 ? Messages.getString( "EntryEditorPasteAction.PasteValues" ) : Messages.getString( "EntryEditorPasteAction.PasteValue" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        return Messages.getString( "EntryEditorPasteAction.Paste" ); //$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        if ( getValuesToPaste() != null )
+        {
+            return true;
+        }
+
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        IValue[] values = getValuesToPaste();
+        if ( values != null )
+        {
+            IEntry entry = null;
+            if ( getInput() instanceof IEntry )
+            {
+                entry = ( IEntry ) getInput();
+            }
+            else if ( getInput() instanceof AttributeHierarchy )
+            {
+                entry = ( ( AttributeHierarchy ) getInput() ).getEntry();
+            }
+
+            if ( entry != null )
+            {
+                // only modify the model
+                // the modification at the directory is done by EntryEditorManager
+                new CompoundModification().createValues( entry, values );
+            }
+        }
+    }
+
+
+    /**
+     * Conditions: 
+     * <li>the input is an entry or attribute hierarchy</li>
+     * <li>there are values in clipboard</li>
+     * 
+     * @return the values to paste
+     */
+    private IValue[] getValuesToPaste()
+    {
+        if ( getInput() instanceof IEntry || getInput() instanceof AttributeHierarchy )
+        {
+            Object content = this.getFromClipboard( ValuesTransfer.getInstance() );
+            if ( content != null && content instanceof IValue[] )
+            {
+                IValue[] values = ( IValue[] ) content;
+                return values;
+            }
+        }
+
+        return null;
+    }
+
+}

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java Sat Mar 27 17:11:07 2010
@@ -29,7 +29,6 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.ldapbrowser.common.actions.CopyAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.DeleteAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.NewValueAction;
-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.SelectAllAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.ShowDecoratedValuesAction;
@@ -144,7 +143,7 @@ public class EntryEditorWidgetActionGrou
 
         entryEditorActionMap.put( newValueAction, new EntryEditorActionProxy( viewer, new NewValueAction() ) );
 
-        entryEditorActionMap.put( pasteAction, new EntryEditorActionProxy( viewer, new PasteAction() ) );
+        entryEditorActionMap.put( pasteAction, new EntryEditorActionProxy( viewer, new EntryEditorPasteAction() ) );
         entryEditorActionMap.put( copyAction, new EntryEditorActionProxy( viewer, new CopyAction(
             ( BrowserActionProxy ) entryEditorActionMap.get( pasteAction ), valueEditorManager ) ) );
         entryEditorActionMap.put( deleteAction, new EntryEditorActionProxy( viewer, new DeleteAction() ) );

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages.properties Sat Mar 27 17:11:07 2010
@@ -44,3 +44,6 @@ OpenBestEditorAction.NewValueQuestion=Do
 OpenDefaultEditorAction.EditValue=Edit Value
 OpenSortDialogAction.Sorting=Sorting...
 ShowQuickFilterAction.ShowQuickFilter=Show Quick Filter
+EntryEditorPasteAction.Paste=Paste
+EntryEditorPasteAction.PasteValue=Paste Value
+EntryEditorPasteAction.PasteValues=Paste Values

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_de.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_de.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_de.properties Sat Mar 27 17:11:07 2010
@@ -44,3 +44,6 @@ OpenBestEditorAction.NewValueQuestion=Wo
 OpenDefaultEditorAction.EditValue=Wert bearbeiten
 OpenSortDialogAction.Sorting=Sortierung...
 ShowQuickFilterAction.ShowQuickFilter=Schnell-Filer anzeigen
+EntryEditorPasteAction.Paste=Einf\u00FCgen
+EntryEditorPasteAction.PasteValue=Wert einf\u00FCgen
+EntryEditorPasteAction.PasteValues=Werte einf\u00FCgen

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_fr.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_fr.properties (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/messages_fr.properties Sat Mar 27 17:11:07 2010
@@ -44,3 +44,6 @@ OpenBestEditorAction.NewValueQuestion=So
 OpenDefaultEditorAction.EditValue=Editer la valeur
 OpenSortDialogAction.Sorting=Tri...
 ShowQuickFilterAction.ShowQuickFilter=Afficher le filtre rapide
+EntryEditorPasteAction.Paste=Coller
+EntryEditorPasteAction.PasteValue=Coller la valeur
+EntryEditorPasteAction.PasteValues=Coller les valeurs

Added: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java?rev=928234&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java (added)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java Sat Mar 27 17:11:07 2010
@@ -0,0 +1,357 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.ui.actions;
+
+
+import org.apache.directory.studio.connection.core.Utils;
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.common.actions.PasteAction;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.EntryExistsCopyStrategyDialogImpl;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.ScopeDialog;
+import org.apache.directory.studio.ldapbrowser.common.dnd.EntryTransfer;
+import org.apache.directory.studio.ldapbrowser.common.dnd.SearchTransfer;
+import org.apache.directory.studio.ldapbrowser.common.dnd.ValuesTransfer;
+import org.apache.directory.studio.ldapbrowser.core.jobs.CopyEntriesJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.UpdateEntryRunnable;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
+import org.apache.directory.studio.ldapbrowser.core.model.IValue;
+import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
+import org.apache.directory.studio.ldapbrowser.core.utils.CompoundModification;
+import org.apache.directory.studio.ldifparser.LdifFormatParameters;
+import org.apache.directory.studio.ldifparser.model.LdifFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+
+/**
+ * This class implements the paste action for the LDAP browser view.
+ * It copies attribute-values to another entry.
+ * It invokes an UpdateEntryRunnable.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BrowserPasteAction extends PasteAction
+{
+    /**
+     * Creates a new instance of BrowserPasteAction.
+     */
+    public BrowserPasteAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        // entry
+        IEntry[] entries = getEntriesToPaste();
+        if ( entries != null )
+        {
+            return entries.length > 1 ? Messages.getString( "BrowserPasteAction.PasteEntries" ) : Messages.getString( "BrowserPasteAction.PasteEntry" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        // searches
+        ISearch[] searches = getSearchesToPaste();
+        if ( searches != null )
+        {
+            return searches.length > 1 ? Messages.getString( "BrowserPasteAction.PasteSearches" ) : Messages.getString( "BrowserPasteAction.PasteSearch" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        // value
+        IValue[] values = getValuesToPaste();
+        if ( values != null )
+        {
+            return values.length > 1 ? Messages.getString( "BrowserPasteAction.PasteValues" ) : Messages.getString( "BrowserPasteAction.PasteValue" ); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        return Messages.getString( "BrowserPasteAction.Paste" ); //$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        // entry
+        if ( getEntriesToPaste() != null )
+        {
+            return true;
+        }
+
+        // search
+        else if ( getSearchesToPaste() != null )
+        {
+            return true;
+        }
+
+        // value
+        else if ( getValuesToPaste() != null )
+        {
+            return true;
+        }
+
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        // entry
+        IEntry[] entries = getEntriesToPaste();
+        if ( entries != null )
+        {
+            pasteEntries( getSelectedEntries()[0], entries );
+            return;
+        }
+
+        // search
+        ISearch[] searches = getSearchesToPaste();
+        if ( searches != null )
+        {
+            pasteSearches( searches );
+            return;
+        }
+
+        // value
+        IValue[] values = getValuesToPaste();
+        if ( values != null )
+        {
+            pasteValues( values );
+            return;
+        }
+
+    }
+
+
+    /**
+     * Pastes the given entries
+     *
+     * @param parent
+     *      the parent Entry
+     * @param entriesToPaste
+     *      the Entries to paste
+     */
+    private void pasteEntries( final IEntry parent, final IEntry[] entriesToPaste )
+    {
+        SearchScope scope = SearchScope.OBJECT;
+        boolean askForScope = false;
+        for ( int i = 0; i < entriesToPaste.length; i++ )
+        {
+            if ( entriesToPaste[i].hasChildren() )
+            {
+                askForScope = true;
+                break;
+            }
+        }
+        if ( askForScope )
+        {
+            ScopeDialog scopeDialog = new ScopeDialog( Display.getDefault().getActiveShell(), Messages
+                .getString( "BrowserPasteAction.SelectCopyDepth" ), //$NON-NLS-1$
+                entriesToPaste.length > 1 );
+            scopeDialog.open();
+            scope = scopeDialog.getScope();
+        }
+
+        new CopyEntriesJob( parent, entriesToPaste, scope, new EntryExistsCopyStrategyDialogImpl( Display.getDefault()
+            .getActiveShell() ) ).execute();
+    }
+
+
+    private void pasteSearches( ISearch[] searches )
+    {
+        IBrowserConnection browserConnection = null;
+        if ( getSelectedBrowserViewCategories().length > 0 )
+        {
+            browserConnection = getSelectedBrowserViewCategories()[0].getParent();
+        }
+        else if ( getSelectedSearches().length > 0 )
+        {
+            browserConnection = getSelectedSearches()[0].getBrowserConnection();
+        }
+
+        if ( browserConnection != null )
+        {
+            ISearch clone = null;
+            for ( ISearch search : searches )
+            {
+                SearchParameter searchParameter = ( SearchParameter ) search.getSearchParameter().clone();
+                clone = new Search( browserConnection, searchParameter );
+                browserConnection.getSearchManager().addSearch( clone );
+            }
+
+            if ( searches.length == 1 )
+            {
+                IAdaptable element = ( IAdaptable ) clone;
+                String pageId = BrowserCommonConstants.PROP_SEARCH;
+                String title = clone.getName();
+
+                PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( getShell(), element, pageId, null,
+                    null );
+                if ( dialog != null )
+                {
+                    title = Utils.shorten( title, 30 );
+                }
+                dialog.getShell().setText( NLS.bind( Messages.getString( "PropertiesAction.PropertiesForX" ), title ) ); //$NON-NLS-1$
+                dialog.open();
+            }
+        }
+    }
+
+
+    /**
+     * Paste Values
+     *
+     * @param values
+     *      the Values to paste
+     */
+    private void pasteValues( IValue[] values )
+    {
+        IEntry entry = null;
+        if ( getSelectedEntries().length == 1 )
+        {
+            entry = getSelectedEntries()[0];
+        }
+        else if ( getSelectedSearchResults().length == 1 )
+        {
+            entry = getSelectedSearchResults()[0].getEntry();
+        }
+        else if ( getSelectedBookmarks().length == 1 )
+        {
+            entry = getSelectedBookmarks()[0].getEntry();
+        }
+
+        // always get the real entry in case it is a bookmark or search continuation
+        if ( entry != null )
+        {
+            entry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
+        }
+
+        if ( entry != null )
+        {
+            IEntry clone = new CompoundModification().cloneEntry( entry );
+            new CompoundModification().createValues( clone, values );
+            LdifFile diff = org.apache.directory.studio.ldapbrowser.core.utils.Utils.computeDiff( entry, clone );
+            if ( diff != null )
+            {
+                UpdateEntryRunnable runnable = new UpdateEntryRunnable( entry, diff
+                    .toFormattedString( LdifFormatParameters.DEFAULT ) );
+                new StudioBrowserJob( runnable ).execute();
+            }
+        }
+
+    }
+
+
+    /**
+     * Conditions: 
+     * <li>an entry is selected</li>
+     * <li>there are entries in clipboard</li>
+     * 
+     * @return
+     */
+    private IEntry[] getEntriesToPaste()
+    {
+        if ( getSelectedBookmarks().length + getSelectedSearchResults().length + getSelectedSearches().length
+            + getSelectedConnections().length + getSelectedAttributes().length + getSelectedValues().length == 0
+            && getSelectedEntries().length == 1 )
+        {
+
+            Object content = this.getFromClipboard( EntryTransfer.getInstance() );
+            if ( content != null && content instanceof IEntry[] )
+            {
+                IEntry[] entries = ( IEntry[] ) content;
+                return entries;
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Conditions: 
+     * <li>a search or category is selected</li> 
+     * <li>there are searches in clipboard</li>
+     * 
+     * @return
+     */
+    private ISearch[] getSearchesToPaste()
+    {
+        if ( getSelectedBookmarks().length + getSelectedSearchResults().length + getSelectedEntries().length
+            + getSelectedConnections().length + getSelectedAttributes().length + getSelectedValues().length == 0
+            && ( getSelectedSearches().length + getSelectedBrowserViewCategories().length > 0 ) )
+        {
+            Object content = this.getFromClipboard( SearchTransfer.getInstance() );
+            if ( content != null && content instanceof ISearch[] )
+            {
+                ISearch[] searches = ( ISearch[] ) content;
+                return searches;
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Conditions: 
+     * <li>an entry, search result, or bookmark is seleted</li>
+     * <li>there are values in clipboard</li>
+     * 
+     * @return
+     */
+    private IValue[] getValuesToPaste()
+    {
+        if ( ( getSelectedAttributes().length + getSelectedValues().length + getSelectedSearchResults().length
+            + getSelectedBookmarks().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedEntries().length == 1 ) )
+            || ( getSelectedAttributes().length + getSelectedValues().length + getSelectedEntries().length
+                + getSelectedSearchResults().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedBookmarks().length == 1 ) )
+            || ( getSelectedAttributes().length + getSelectedValues().length + getSelectedEntries().length
+                + getSelectedBookmarks().length + getSelectedSearches().length + getSelectedConnections().length == 0 && ( getSelectedSearchResults().length == 1 ) ) )
+        {
+            Object content = this.getFromClipboard( ValuesTransfer.getInstance() );
+            if ( content != null && content instanceof IValue[] )
+            {
+                IValue[] values = ( IValue[] ) content;
+                return values;
+            }
+        }
+
+        return null;
+    }
+
+}

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages.properties (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages.properties Sat Mar 27 17:11:07 2010
@@ -87,3 +87,11 @@ OpenSchemaBrowserAction.SubstringDescrip
 OpenSchemaBrowserAction.SyntaxDescription=Syntax Description
 OpenSearchAction.Search=Search...
 OpenSearchResultAction.OpenResult=Open Search Result
+BrowserPasteAction.Paste=Paste
+BrowserPasteAction.PasteEntries=Paste Entries
+BrowserPasteAction.PasteEntry=Paste Entry
+BrowserPasteAction.PasteSearches=Paste Searches
+BrowserPasteAction.PasteSearch=Paste Search
+BrowserPasteAction.PasteValue=Paste Value
+BrowserPasteAction.PasteValues=Paste Values
+BrowserPasteAction.SelectCopyDepth=Select Copy Depth

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_de.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_de.properties (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_de.properties Sat Mar 27 17:11:07 2010
@@ -85,3 +85,11 @@ OpenSchemaBrowserAction.SubstringDescrip
 OpenSchemaBrowserAction.SyntaxDescription=Syntax Beschreibung
 OpenSearchAction.Search=Suche...
 OpenSearchResultAction.OpenResult=\u00D6ffne Suchresultat
+BrowserPasteAction.Paste=Einf\u00FCgen
+BrowserPasteAction.PasteEntries=Eintr\u00E4ge einf\u00FCgen
+BrowserPasteAction.PasteEntry=Eintrag einf\u00FCgen
+BrowserPasteAction.PasteSearches=Suchen einf\u00FCgen
+BrowserPasteAction.PasteSearch=Suche einf\u00FCgen
+BrowserPasteAction.PasteValue=Wert einf\u00FCgen
+BrowserPasteAction.PasteValues=Werte einf\u00FCgen
+BrowserPasteAction.SelectCopyDepth=Kopiertiefe ausw\u00E4hlen

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_fr.properties?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_fr.properties (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/messages_fr.properties Sat Mar 27 17:11:07 2010
@@ -87,3 +87,11 @@ OpenSchemaBrowserAction.SubstringDescrip
 OpenSchemaBrowserAction.SyntaxDescription=Description de syntaxe
 OpenSearchAction.Search=Rechercher...
 OpenSearchResultAction.OpenResult=Ouvrir le r\u00E9sultat de recherche
+BrowserPasteAction.Paste=Coller
+BrowserPasteAction.PasteEntries=Coller les entr\u00E9es
+BrowserPasteAction.PasteEntry=Coller l'entr\u00E9e
+BrowserPasteAction.PasteSearches=Coller les recherches
+BrowserPasteAction.PasteSearch=Coller la recherche
+BrowserPasteAction.PasteValue=Coller la valeur
+BrowserPasteAction.PasteValues=Coller les valeurs
+BrowserPasteAction.SelectCopyDepth=S\u00E9lectionner la profondeur de copie

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorPasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorPasteAction.java?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorPasteAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorPasteAction.java Sat Mar 27 17:11:07 2010
@@ -31,8 +31,9 @@ import org.apache.directory.studio.ldapb
 
 
 /**
- * Special paste action to copy the values of a copied attr-val to another
- * attribute.
+ * This class implements the paste action for the search result editor. 
+ * It copies the value af a copied attribute-value to another attribute.
+ * It does not invoke an UpdateEntryRunnable but only updates the model.
  */
 public class SearchResultEditorPasteAction extends PasteAction
 {
@@ -92,6 +93,8 @@ public class SearchResultEditorPasteActi
                 newValues[v] = new Value( attribute, values[v].getRawValue() );
             }
 
+            // only modify the model
+            // the modification at the directory is done by SearchResultEditor.entryUpdateListener
             new CompoundModification().createValues( entry, newValues );
         }
     }

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java?rev=928234&r1=928233&r2=928234&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewActionGroup.java Sat Mar 27 17:11:07 2010
@@ -28,11 +28,11 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.ldapbrowser.common.actions.FetchOperationalAttributesAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.FetchReferralsAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.FetchSubentriesAction;
-import org.apache.directory.studio.ldapbrowser.common.actions.PasteAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.RenameAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserViewActionProxy;
 import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserActionGroup;
+import org.apache.directory.studio.ldapbrowser.ui.actions.BrowserPasteAction;
 import org.apache.directory.studio.ldapbrowser.ui.actions.CopyDnAction;
 import org.apache.directory.studio.ldapbrowser.ui.actions.CopyEntryAsCsvAction;
 import org.apache.directory.studio.ldapbrowser.ui.actions.CopyEntryAsLdifAction;
@@ -223,7 +223,7 @@ public class BrowserViewActionGroup exte
             .put( locateEntryInDitAction, new BrowserViewActionProxy( viewer, new LocateEntryInDitAction() ) );
         browserActionMap.put( gotoDnAction, new BrowserViewActionProxy( viewer, new GotoDnAction() ) );
 
-        browserActionMap.put( pasteAction, new BrowserViewActionProxy( viewer, new PasteAction() ) );
+        browserActionMap.put( pasteAction, new BrowserViewActionProxy( viewer, new BrowserPasteAction() ) );
         browserActionMap.put( copyAction, new BrowserViewActionProxy( viewer, new CopyAction(
             ( BrowserActionProxy ) browserActionMap.get( pasteAction ) ) ) );
         browserActionMap.put( deleteAction, new BrowserViewActionProxy( viewer, new DeleteAction() ) );



Mime
View raw message