directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r824279 - 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 Mon, 12 Oct 2009 09:38:27 GMT
Author: seelmann
Date: Mon Oct 12 09:38:26 2009
New Revision: 824279

URL: http://svn.apache.org/viewvc?rev=824279&view=rev
Log:
Fix for DIRSTUDIO-562 (Add 'Copy Display Value' action, default copy action should copy displayed
value)

Added:
    directory/studio/trunk/ldapbrowser-ui/resources/icons/copy_display.gif   (with props)
Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/CopyAction.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetActionGroup.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyValueAction.java
    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/entry/EntryEditorActionGroup.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/CopyAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/CopyAction.java?rev=824279&r1=824278&r2=824279&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/CopyAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/CopyAction.java
Mon Oct 12 09:38:26 2009
@@ -37,6 +37,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
 import org.apache.directory.studio.ldifparser.LdifUtils;
+import org.apache.directory.studio.valueeditors.IValueEditor;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.dnd.Clipboard;
 import org.eclipse.swt.dnd.TextTransfer;
@@ -57,6 +59,8 @@
 {
     private BrowserActionProxy pasteActionProxy;
 
+    private ValueEditorManager valueEditorManager;
+
 
     /**
      * Creates a new instance of CopyAction.
@@ -72,6 +76,20 @@
 
 
     /**
+     * Creates a new instance of CopyAction.
+     *
+     * @param pasteActionProxy
+     *      the associated Paste Action
+     */
+    public CopyAction( BrowserActionProxy pasteActionProxy, ValueEditorManager valueEditorManager
)
+    {
+        super();
+        this.pasteActionProxy = pasteActionProxy;
+        this.valueEditorManager = valueEditorManager;
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     public String getText()
@@ -161,7 +179,15 @@
 
             for ( int i = 0; i < values.length; i++ )
             {
-                if ( values[i].isString() )
+                IValue value = values[i];
+
+                if ( valueEditorManager != null )
+                {
+                    IValueEditor ve = valueEditorManager.getCurrentValueEditor( value );
+                    String displayValue = ve.getDisplayValue( value );
+                    text.append( displayValue );
+                }
+                else if ( values[i].isString() )
                 {
                     text.append( values[i].getStringValue() );
                 }
@@ -169,6 +195,7 @@
                 {
                     text.append( LdifUtils.base64encode( values[i].getBinaryValue() ) );
                 }
+
                 if ( i + 1 < values.length )
                 {
                     text.append( BrowserCoreConstants.LINE_SEPARATOR );

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=824279&r1=824278&r2=824279&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
Mon Oct 12 09:38:26 2009
@@ -41,6 +41,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.utils.ActionUtils;
 import org.apache.directory.studio.valueeditors.IValueEditor;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -122,21 +123,22 @@
 
         entryEditorActionMap = new HashMap<String, EntryEditorActionProxy>();
         TreeViewer viewer = mainWidget.getViewer();
+        ValueEditorManager valueEditorManager = configuration.getValueEditorManager( viewer
);
 
         openSortDialogAction = new OpenSortDialogAction( configuration.getPreferences() );
         showDecoratedValuesAction = new ShowDecoratedValuesAction();
         showQuickFilterAction = new ShowQuickFilterAction( mainWidget.getQuickFilterWidget()
);
 
         openBestValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenBestEditorAction(
viewer,
-            configuration.getValueEditorManager( viewer ), this ) );
+            valueEditorManager, this ) );
         openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenDefaultEditorAction(
viewer,
             openBestValueEditorActionProxy ) );
-        IValueEditor[] valueEditors = configuration.getValueEditorManager( viewer ).getAllValueEditors();
+        IValueEditor[] valueEditors = valueEditorManager.getAllValueEditors();
         openValueEditorActionProxies = new EntryEditorActionProxy[valueEditors.length];
         for ( int i = 0; i < openValueEditorActionProxies.length; i++ )
         {
             openValueEditorActionProxies[i] = new EntryEditorActionProxy( viewer, new OpenEditorAction(
viewer,
-                configuration.getValueEditorManager( viewer ), valueEditors[i], this ) );
+                valueEditorManager, valueEditors[i], this ) );
         }
         openValueEditorPreferencesAction = new ValueEditorPreferencesAction();
 
@@ -144,7 +146,7 @@
 
         entryEditorActionMap.put( pasteAction, new EntryEditorActionProxy( viewer, new PasteAction()
) );
         entryEditorActionMap.put( copyAction, new EntryEditorActionProxy( viewer, new CopyAction(
-            ( BrowserActionProxy ) entryEditorActionMap.get( pasteAction ) ) ) );
+            ( BrowserActionProxy ) entryEditorActionMap.get( pasteAction ), valueEditorManager
) ) );
         entryEditorActionMap.put( deleteAction, new EntryEditorActionProxy( viewer, new DeleteAction()
) );
         entryEditorActionMap.put( selectAllAction, new EntryEditorActionProxy( viewer, new
SelectAllAction( viewer ) ) );
 

Added: directory/studio/trunk/ldapbrowser-ui/resources/icons/copy_display.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/resources/icons/copy_display.gif?rev=824279&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/ldapbrowser-ui/resources/icons/copy_display.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=824279&r1=824278&r2=824279&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
Mon Oct 12 09:38:26 2009
@@ -128,6 +128,7 @@
     public static final String IMG_COPY_BASE64 = "resources/icons/copy_base64.gif"; //$NON-NLS-1$
     public static final String IMG_COPY_HEX = "resources/icons/copy_hex.gif"; //$NON-NLS-1$
     public static final String IMG_COPY_UTF8 = "resources/icons/copy_raw.gif"; //$NON-NLS-1$
+    public static final String IMG_COPY_DISPLAY = "resources/icons/copy_display.gif"; //$NON-NLS-1$
     public static final String IMG_COPY_DN = "resources/icons/copy_dn.gif"; //$NON-NLS-1$
     public static final String IMG_COPY_URL = "resources/icons/copy_url.gif"; //$NON-NLS-1$
     public static final String IMG_COPY_ATT = "resources/icons/copy_att.gif"; //$NON-NLS-1$

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyValueAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyValueAction.java?rev=824279&r1=824278&r2=824279&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyValueAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyValueAction.java
Mon Oct 12 09:38:26 2009
@@ -30,6 +30,7 @@
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.CopyAction;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
+import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
 import org.apache.directory.studio.ldapbrowser.core.utils.ModelConverter;
@@ -37,40 +38,53 @@
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldifparser.LdifUtils;
+import org.apache.directory.studio.valueeditors.IValueEditor;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;
 
 
 /**
- * This Action copies the value of the selecte Entry to the Clipboard.
+ * This Action copies values of the seleced Entry to the Clipboard.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 public class CopyValueAction extends BrowserAction
 {
-    /**
-     * UTF8 Mode.
-     */
-    public static final int MODE_UTF8 = 1;
 
-    /**
-     * Base64 Mode.
-     */
-    public static final int MODE_BASE64 = 2;
+    public enum Mode
+    {
+        /**
+         * UTF8 Mode.
+         */
+        UTF8,
 
-    /**
-     * Hexadecimal Mode. 
-     */
-    public static final int MODE_HEX = 3;
+        /**
+         * Base64 Mode.
+         */
+        BASE64,
 
-    /**
-     * LDIF Mode.
-     */
-    public static final int MODE_LDIF = 4;
+        /**
+         * Hexadecimal Mode. 
+         */
+        HEX,
+
+        /**
+         * LDIF Mode.
+         */
+        LDIF,
+
+        /**
+         * Display mode, copies the display value.
+         */
+        DISPLAY,
+    }
 
-    private int mode;
+    private Mode mode;
+
+    private ValueEditorManager valueEditorManager;
 
 
     /**
@@ -79,9 +93,10 @@
      * @param mode
      *      the copy Mode
      */
-    public CopyValueAction( int mode )
+    public CopyValueAction( Mode mode, ValueEditorManager valueEditorManager )
     {
         this.mode = mode;
+        this.valueEditorManager = valueEditorManager;
     }
 
 
@@ -90,25 +105,20 @@
      */
     public String getText()
     {
-        if ( mode == MODE_UTF8 )
-        {
-            return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuesUTF"
) : Messages.getString( "CopyValueAction.CopyValueUTF" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        else if ( mode == MODE_BASE64 )
+        switch ( mode )
         {
-            return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuesBase"
) : Messages.getString( "CopyValueAction.CopyValueBase" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        else if ( mode == MODE_HEX )
-        {
-            return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.VopyValuesHex"
) : Messages.getString( "CopyValueAction.CopyValueHex" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        else if ( mode == MODE_LDIF )
-        {
-            return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuePairs"
) : Messages.getString( "CopyValueAction.CopyValuePair" ); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        else
-        {
-            return Messages.getString( "CopyValueAction.CopyValue" ); //$NON-NLS-1$
+            case UTF8:
+                return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuesUTF"
) : Messages.getString( "CopyValueAction.CopyValueUTF" ); //$NON-NLS-1$ //$NON-NLS-2$
+            case BASE64:
+                return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuesBase"
) : Messages.getString( "CopyValueAction.CopyValueBase" ); //$NON-NLS-1$ //$NON-NLS-2$
+            case HEX:
+                return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.VopyValuesHex"
) : Messages.getString( "CopyValueAction.CopyValueHex" ); //$NON-NLS-1$ //$NON-NLS-2$
+            case LDIF:
+                return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyValuePairs"
) : Messages.getString( "CopyValueAction.CopyValuePair" ); //$NON-NLS-1$ //$NON-NLS-2$
+            case DISPLAY:
+                return getValueSet().size() > 1 ? Messages.getString( "CopyValueAction.CopyDisplayValues"
) : Messages.getString( "CopyValueAction.CopyDisplayValue" ); //$NON-NLS-1$ //$NON-NLS-2$
+            default:
+                return Messages.getString( "CopyValueAction.CopyValue" ); //$NON-NLS-1$
         }
     }
 
@@ -118,25 +128,20 @@
      */
     public ImageDescriptor getImageDescriptor()
     {
-        if ( mode == MODE_UTF8 )
-        {
-            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_UTF8
);
-        }
-        else if ( mode == MODE_BASE64 )
+        switch ( mode )
         {
-            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_BASE64
);
-        }
-        else if ( mode == MODE_HEX )
-        {
-            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_HEX
);
-        }
-        else if ( mode == MODE_LDIF )
-        {
-            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_LDIF
);
-        }
-        else
-        {
-            return null;
+            case UTF8:
+                return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_UTF8
);
+            case BASE64:
+                return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_BASE64
);
+            case HEX:
+                return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_HEX
);
+            case LDIF:
+                return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_LDIF
);
+            case DISPLAY:
+                return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_COPY_DISPLAY
);
+            default:
+                return null;
         }
     }
 
@@ -164,60 +169,71 @@
      */
     public void run()
     {
-
         StringBuffer text = new StringBuffer();
-        Set valueSet = getValueSet();
+        Set<IValue> valueSet = getValueSet();
         if ( !valueSet.isEmpty() )
         {
-            for ( Iterator iterator = valueSet.iterator(); iterator.hasNext(); )
+            for ( Iterator<IValue> iterator = valueSet.iterator(); iterator.hasNext();
)
             {
-                IValue value = ( IValue ) iterator.next();
-
-                if ( mode == MODE_UTF8 )
-                {
-                    text.append( LdifUtils.utf8decode( value.getBinaryValue() ) );
-                    if ( iterator.hasNext() )
-                        text.append( BrowserCoreConstants.LINE_SEPARATOR );
-                }
-                else if ( mode == MODE_BASE64 )
-                {
-                    text.append( LdifUtils.base64encode( value.getBinaryValue() ) );
-                    if ( iterator.hasNext() )
-                        text.append( BrowserCoreConstants.LINE_SEPARATOR );
-                }
-                else if ( mode == MODE_HEX )
-                {
-                    text.append( LdifUtils.hexEncode( value.getBinaryValue() ) );
-                    if ( iterator.hasNext() )
-                        text.append( BrowserCoreConstants.LINE_SEPARATOR );
-                }
-                else if ( mode == MODE_LDIF )
+                IValue value = iterator.next();
+                switch ( mode )
                 {
-                    text.append( ModelConverter.valueToLdifAttrValLine( value ).toFormattedString(
-                        Utils.getLdifFormatParameters() ) );
+                    case UTF8:
+                        text.append( LdifUtils.utf8decode( value.getBinaryValue() ) );
+                        if ( iterator.hasNext() )
+                        {
+                            text.append( BrowserCoreConstants.LINE_SEPARATOR );
+                        }
+                        break;
+                    case BASE64:
+                        text.append( LdifUtils.base64encode( value.getBinaryValue() ) );
+                        if ( iterator.hasNext() )
+                        {
+                            text.append( BrowserCoreConstants.LINE_SEPARATOR );
+                        }
+                        break;
+                    case HEX:
+                        text.append( LdifUtils.hexEncode( value.getBinaryValue() ) );
+                        if ( iterator.hasNext() )
+                        {
+                            text.append( BrowserCoreConstants.LINE_SEPARATOR );
+                        }
+                        break;
+                    case LDIF:
+                        text.append( ModelConverter.valueToLdifAttrValLine( value ).toFormattedString(
+                            Utils.getLdifFormatParameters() ) );
+                        break;
+                    case DISPLAY:
+                        IValueEditor ve = valueEditorManager.getCurrentValueEditor( value
);
+                        String displayValue = ve.getDisplayValue( value );
+                        text.append( displayValue );
+                        if ( iterator.hasNext() )
+                        {
+                            text.append( BrowserCoreConstants.LINE_SEPARATOR );
+                        }
+                        break;
                 }
-
             }
         }
         else if ( getSelectedSearchResults().length > 0 )
         {
             LdapDN dn = getSelectedSearchResults()[0].getDn();
-
-            if ( mode == MODE_UTF8 )
-            {
-                text.append( dn.getUpName() );
-            }
-            else if ( mode == MODE_BASE64 )
-            {
-                text.append( LdifUtils.base64encode( LdifUtils.utf8encode( dn.getUpName()
) ) );
-            }
-            else if ( mode == MODE_HEX )
-            {
-                text.append( LdifUtils.hexEncode( LdifUtils.utf8encode( dn.getUpName() )
) );
-            }
-            else if ( mode == MODE_LDIF )
+            switch ( mode )
             {
-                text.append( ModelConverter.dnToLdifDnLine( dn ).toFormattedString( Utils.getLdifFormatParameters()
) );
+                case UTF8:
+                case DISPLAY:
+                    text.append( dn.getUpName() );
+                    break;
+                case BASE64:
+                    text.append( LdifUtils.base64encode( LdifUtils.utf8encode( dn.getUpName()
) ) );
+                    break;
+                case HEX:
+                    text.append( LdifUtils.hexEncode( LdifUtils.utf8encode( dn.getUpName()
) ) );
+                    break;
+                case LDIF:
+                    text.append( ModelConverter.dnToLdifDnLine( dn )
+                        .toFormattedString( Utils.getLdifFormatParameters() ) );
+                    break;
             }
         }
 
@@ -236,20 +252,19 @@
      * @return
      *      a Set containing all the Values
      */
-    protected Set getValueSet()
+    protected Set<IValue> getValueSet()
     {
-        Set valueSet = new LinkedHashSet();
-        for ( int i = 0; i < getSelectedAttributeHierarchies().length; i++ )
+        Set<IValue> valueSet = new LinkedHashSet<IValue>();
+        for ( AttributeHierarchy ah : getSelectedAttributeHierarchies() )
         {
-            for ( Iterator it = getSelectedAttributeHierarchies()[i].iterator(); it.hasNext();
)
+            for ( IAttribute att : ah )
             {
-                IAttribute att = ( IAttribute ) it.next();
                 valueSet.addAll( Arrays.asList( att.getValues() ) );
             }
         }
-        for ( int i = 0; i < getSelectedAttributes().length; i++ )
+        for ( IAttribute att : getSelectedAttributes() )
         {
-            valueSet.addAll( Arrays.asList( getSelectedAttributes()[i].getValues() ) );
+            valueSet.addAll( Arrays.asList( att.getValues() ) );
         }
         valueSet.addAll( Arrays.asList( getSelectedValues() ) );
         return valueSet;

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=824279&r1=824278&r2=824279&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
Mon Oct 12 09:38:26 2009
@@ -36,10 +36,12 @@
 CopyUrlAction.CopyURL=Copy URL
 CopyValueAction.CopyValue=Copy Value
 CopyValueAction.CopyValueBase=Copy Value (BASE-64)
+CopyValueAction.CopyDisplayValues=Copy Display Value
 CopyValueAction.CopyValueHex=Copy Value (HEX)
 CopyValueAction.CopyValuePair=Copy Name-Value-Pair as LDIF
 CopyValueAction.CopyValuePairs=Copy Name-Value-Pairs as LDIF
 CopyValueAction.CopyValuesBase=Copy Values (BASE-64)
+CopyValueAction.CopyDisplayValues=Copy Display Values
 CopyValueAction.CopyValuesUTF=Copy Values (UTF-8)
 CopyValueAction.CopyValueUTF=Copy Value (UTF-8)
 CopyValueAction.VopyValuesHex=Copy Values (HEX)

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=824279&r1=824278&r2=824279&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
Mon Oct 12 09:38:26 2009
@@ -34,10 +34,12 @@
 CopyUrlAction.CopyURL=Kopiere URL
 CopyValueAction.CopyValue=Kopiere Wert
 CopyValueAction.CopyValueBase=Kopiere Wert (BASE-64)
+CopyValueAction.CopyDisplayValue=Kopiere Anzeigewert
 CopyValueAction.CopyValueHex=Kopiere Wert (HEX)
 CopyValueAction.CopyValuePair=Kopiere Name-Value-Pair als LDIF
 CopyValueAction.CopyValuePairs=Kopiere Name-Value-Pairs als LDIF
 CopyValueAction.CopyValuesBase=Kopiere Werte (BASE-64)
+CopyValueAction.CopyDisplayValues=Kopiere Anzeigewerte
 CopyValueAction.CopyValuesUTF=Kopiere Werte (UTF-8)
 CopyValueAction.CopyValueUTF=Kopiere Wert (UTF-8)
 CopyValueAction.VopyValuesHex=Kopiere Werte (HEX)

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=824279&r1=824278&r2=824279&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
Mon Oct 12 09:38:26 2009
@@ -36,10 +36,12 @@
 CopyUrlAction.CopyURL=Copier l'URL
 CopyValueAction.CopyValue=Copier la valeur
 CopyValueAction.CopyValueBase=Copier la valeur (BASE-64)
+CopyValueAction.CopyDisplayValue=TODO:Copy Display Value
 CopyValueAction.CopyValueHex=Copier la valeur (HEX)
 CopyValueAction.CopyValuePair=Copier la paire nom-valeur comme LDIF
 CopyValueAction.CopyValuePairs=Copier les paires nom-valeur comme LDIF
 CopyValueAction.CopyValuesBase=Copier les valeurs (BASE-64)
+CopyValueAction.CopyDisplayValues=TODO:Copy Display Values
 CopyValueAction.CopyValuesUTF=Copier les valeurs (UTF-8)
 CopyValueAction.CopyValueUTF=Copier la valeur (UTF-8)
 CopyValueAction.VopyValuesHex=Copier les valeurs (HEX)

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java?rev=824279&r1=824278&r2=824279&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
Mon Oct 12 09:38:26 2009
@@ -43,6 +43,7 @@
 import org.apache.directory.studio.ldapbrowser.ui.actions.NewSearchAction;
 import org.apache.directory.studio.ldapbrowser.ui.actions.OpenSchemaBrowserAction;
 import org.apache.directory.studio.utils.ActionUtils;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -70,7 +71,7 @@
 
     /** The toggle auto save action */
     private ToggleAutosaveAction toggleAutosaveAction;
-    
+
     /** The open entry value editor action. */
     private EntryEditorActionProxy openEntryValueEditorActionProxy;
 
@@ -107,6 +108,9 @@
     /** The Constant copyAttriuteDescriptionAction. */
     private static final String copyAttriuteDescriptionAction = "copyAttriuteDescriptionAction";
//$NON-NLS-1$
 
+    /** The Constant copyDisplayValueAction. */
+    private static final String copyDisplayValueAction = "copyDisplayValueAction"; //$NON-NLS-1$
+
     /** The Constant copyValueUtf8Action. */
     private static final String copyValueUtf8Action = "copyValueUtf8Action"; //$NON-NLS-1$
 
@@ -168,6 +172,7 @@
     {
         super( entryEditor.getMainWidget(), entryEditor.getConfiguration() );
         TreeViewer viewer = entryEditor.getMainWidget().getViewer();
+        ValueEditorManager valueEditorManager = entryEditor.getConfiguration().getValueEditorManager(
viewer );
 
         // create OpenDefaultEditorAction with enabled rename action flag
         openDefaultValueEditorActionProxy.dispose();
@@ -175,8 +180,7 @@
             openBestValueEditorActionProxy ) );
 
         openEntryValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenEntryEditorAction(
viewer,
-            entryEditor.getConfiguration().getValueEditorManager( viewer ), entryEditor.getConfiguration()
-                .getValueEditorManager( viewer ).getEntryValueEditor(), this ) );
+            valueEditorManager, valueEditorManager.getEntryValueEditor(), this ) );
 
         showOperationalAttributesAction = new ShowOperationalAttributesAction();
         toggleAutosaveAction = new ToggleAutosaveAction( entryEditor );
@@ -212,14 +216,16 @@
         entryEditorActionMap.put( copyUrlAction, new EntryEditorActionProxy( viewer, new
CopyUrlAction() ) );
         entryEditorActionMap.put( copyAttriuteDescriptionAction, new EntryEditorActionProxy(
viewer,
             new CopyAttributeDescriptionAction() ) );
+        entryEditorActionMap.put( copyDisplayValueAction, new EntryEditorActionProxy( viewer,
new CopyValueAction(
+            CopyValueAction.Mode.DISPLAY, valueEditorManager ) ) );
         entryEditorActionMap.put( copyValueUtf8Action, new EntryEditorActionProxy( viewer,
new CopyValueAction(
-            CopyValueAction.MODE_UTF8 ) ) );
+            CopyValueAction.Mode.UTF8, valueEditorManager ) ) );
         entryEditorActionMap.put( copyValueBase64Action, new EntryEditorActionProxy( viewer,
new CopyValueAction(
-            CopyValueAction.MODE_BASE64 ) ) );
+            CopyValueAction.Mode.BASE64, valueEditorManager ) ) );
         entryEditorActionMap.put( copyValueHexAction, new EntryEditorActionProxy( viewer,
new CopyValueAction(
-            CopyValueAction.MODE_HEX ) ) );
+            CopyValueAction.Mode.HEX, valueEditorManager ) ) );
         entryEditorActionMap.put( copyValueAsLdifAction, new EntryEditorActionProxy( viewer,
new CopyValueAction(
-            CopyValueAction.MODE_LDIF ) ) );
+            CopyValueAction.Mode.LDIF, valueEditorManager ) ) );
 
         entryEditorActionMap.put( copySearchFilterAction, new EntryEditorActionProxy( viewer,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_EQUALS ) ) );
@@ -352,6 +358,7 @@
         advancedMenuManager.add( new Separator() );
         advancedMenuManager.add( entryEditorActionMap.get( copyAttriuteDescriptionAction
) );
         advancedMenuManager.add( new Separator() );
+        advancedMenuManager.add( entryEditorActionMap.get( copyDisplayValueAction ) );
         advancedMenuManager.add( entryEditorActionMap.get( copyValueUtf8Action ) );
         advancedMenuManager.add( entryEditorActionMap.get( copyValueBase64Action ) );
         advancedMenuManager.add( entryEditorActionMap.get( copyValueHexAction ) );

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java?rev=824279&r1=824278&r2=824279&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java
Mon Oct 12 09:38:26 2009
@@ -126,6 +126,8 @@
 
     private static final String copyAttriuteDescriptionAction = "copyAttriuteDescriptionAction";
//$NON-NLS-1$
 
+    private static final String copyDisplayValueAction = "copyDisplayValueAction"; //$NON-NLS-1$
+
     private static final String copyValueUtf8Action = "copyValueUtf8Action"; //$NON-NLS-1$
 
     private static final String copyValueBase64Action = "copyValueBase64Action"; //$NON-NLS-1$
@@ -239,7 +241,7 @@
         searchResultEditorActionMap.put( pasteAction, new SearchResultEditorActionProxy(
cursor,
             new SearchResultEditorPasteAction() ) );
         searchResultEditorActionMap.put( copyAction, new SearchResultEditorActionProxy( cursor,
new CopyAction(
-            ( BrowserActionProxy ) this.searchResultEditorActionMap.get( pasteAction ) )
) );
+            ( BrowserActionProxy ) this.searchResultEditorActionMap.get( pasteAction ), valueEditorManager
) ) );
         searchResultEditorActionMap.put( deleteAction, new SearchResultEditorActionProxy(
cursor,
             new SearchResultDeleteAction() ) );
 
@@ -248,14 +250,16 @@
             .put( copyUrlAction, new SearchResultEditorActionProxy( cursor, new CopyUrlAction()
) );
         searchResultEditorActionMap.put( copyAttriuteDescriptionAction, new SearchResultEditorActionProxy(
cursor,
             new CopyAttributeDescriptionAction() ) );
+        searchResultEditorActionMap.put( copyDisplayValueAction, new SearchResultEditorActionProxy(
cursor,
+            new CopyValueAction( CopyValueAction.Mode.DISPLAY, valueEditorManager ) ) );
         searchResultEditorActionMap.put( copyValueUtf8Action, new SearchResultEditorActionProxy(
cursor,
-            new CopyValueAction( CopyValueAction.MODE_UTF8 ) ) );
+            new CopyValueAction( CopyValueAction.Mode.UTF8, valueEditorManager ) ) );
         searchResultEditorActionMap.put( copyValueBase64Action, new SearchResultEditorActionProxy(
cursor,
-            new CopyValueAction( CopyValueAction.MODE_BASE64 ) ) );
+            new CopyValueAction( CopyValueAction.Mode.BASE64, valueEditorManager ) ) );
         searchResultEditorActionMap.put( copyValueHexAction, new SearchResultEditorActionProxy(
cursor,
-            new CopyValueAction( CopyValueAction.MODE_HEX ) ) );
+            new CopyValueAction( CopyValueAction.Mode.HEX, valueEditorManager ) ) );
         searchResultEditorActionMap.put( copyValueAsLdifAction, new SearchResultEditorActionProxy(
cursor,
-            new CopyValueAction( CopyValueAction.MODE_LDIF ) ) );
+            new CopyValueAction( CopyValueAction.Mode.LDIF, valueEditorManager ) ) );
 
         searchResultEditorActionMap.put( copySearchFilterAction, new SearchResultEditorActionProxy(
cursor,
             new CopySearchFilterAction( CopySearchFilterAction.MODE_EQUALS ) ) );
@@ -425,6 +429,7 @@
         advancedMenuManager.add( new Separator() );
         advancedMenuManager.add( searchResultEditorActionMap.get( copyAttriuteDescriptionAction
) );
         advancedMenuManager.add( new Separator() );
+        advancedMenuManager.add( searchResultEditorActionMap.get( copyDisplayValueAction
) );
         advancedMenuManager.add( searchResultEditorActionMap.get( copyValueUtf8Action ) );
         advancedMenuManager.add( searchResultEditorActionMap.get( copyValueBase64Action )
);
         advancedMenuManager.add( searchResultEditorActionMap.get( copyValueHexAction ) );



Mime
View raw message