directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1208628 - /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java
Date Wed, 30 Nov 2011 18:18:22 GMT
Author: pamarcelot
Date: Wed Nov 30 18:18:22 2011
New Revision: 1208628

URL: http://svn.apache.org/viewvc?rev=1208628&view=rev
Log:
Fix for DIRSTUDIO-749 (Syntaxes shouldn't have/use 'names' (or 'aliases') but 'description'
instead)

Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java?rev=1208628&r1=1208627&r2=1208628&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboLabelProvider.java
Wed Nov 30 18:18:22 2011
@@ -42,10 +42,31 @@ public class ATESyntaxComboLabelProvider
         {
             LdapSyntax syntax = ( LdapSyntax ) obj;
 
+            // Getting description (and name for backward compatibility)
+            String description = syntax.getDescription();
             String name = syntax.getName();
-            if ( name != null )
+            
+            
+            if ( ( description != null ) || ( name != null ) )
             {
-                return name + "  -  (" + syntax.getOid() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+                StringBuilder sb = new StringBuilder();
+
+                if ( description != null )
+                {
+                    // Using description
+                    sb.append( description );
+                }
+                else
+                {
+                    // Using name (for backward compatibility)
+                    sb.append( name );
+                }
+
+                sb.append( "  -  (" ); //$NON-NLS-1$
+                sb.append( syntax.getOid() );
+                sb.append( ")" ); //$NON-NLS-1$ 
+
+                return sb.toString();
             }
             else
             {



Mime
View raw message