directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1209520 - in /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors: ./ attributetype/
Date Fri, 02 Dec 2011 14:57:59 GMT
Author: pamarcelot
Date: Fri Dec  2 14:57:58 2011
New Revision: 1209520

URL: http://svn.apache.org/viewvc?rev=1209520&view=rev
Log:
Fix for DIRSTUDIO-749 (Syntaxes shouldn't have/use 'names' (or 'aliases') but 'description'
instead).
The comparator and object for a non exisiting syntax were still using names.

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

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/NonExistingSyntax.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/NonExistingSyntax.java?rev=1209520&r1=1209519&r2=1209520&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/NonExistingSyntax.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/NonExistingSyntax.java
Fri Dec  2 14:57:58 2011
@@ -27,34 +27,34 @@ package org.apache.directory.studio.sche
  */
 public class NonExistingSyntax
 {
-    /** The None syntax name */
+    /** The None syntax description */
     public static final String NONE = "(None)"; //$NON-NLS-1$
 
-    /** The name */
-    private String name;
+    /** The description */
+    private String description;
 
 
     /**
      * Creates a new instance of NonExistingSyntax.
      *
-     * @param name
-     *      the name the NonExistingSyntax
+     * @param description
+     *      the description the NonExistingSyntax
      */
-    public NonExistingSyntax( String name )
+    public NonExistingSyntax( String description )
     {
-        this.name = name;
+        this.description = description;
     }
 
 
     /**
-     * Gets the name of the NonExistingSyntax.
+     * Gets the description of the NonExistingSyntax.
      *
      * @return
-     *      the name of the NonExistingSyntax
+     *      the description of the NonExistingSyntax
      */
-    public String getName()
+    public String getDescription()
     {
-        return name;
+        return description;
     }
 
 
@@ -66,13 +66,13 @@ public class NonExistingSyntax
      */
     public String getDisplayName()
     {
-        if ( name.equals( NONE ) )
+        if ( description.equals( NONE ) )
         {
             return NONE;
         }
         else
         {
-            return name + "   " + "(This syntax doesnt exist)";
+            return description + "   " + "(This syntax doesnt exist)";
         }
     }
 
@@ -84,7 +84,7 @@ public class NonExistingSyntax
     {
         if ( obj instanceof NonExistingSyntax )
         {
-            return name.equalsIgnoreCase( ( ( NonExistingSyntax ) obj ).getName() );
+            return description.equalsIgnoreCase( ( ( NonExistingSyntax ) obj ).getDescription()
);
         }
 
         return false;

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboComparator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboComparator.java?rev=1209520&r1=1209519&r2=1209520&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboComparator.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/ATESyntaxComboComparator.java
Fri Dec  2 14:57:58 2011
@@ -21,7 +21,6 @@ package org.apache.directory.studio.sche
 
 
 import java.util.Comparator;
-import java.util.List;
 
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingSyntax;
@@ -39,46 +38,34 @@ public class ATESyntaxComboComparator im
      */
     public int compare( Object o1, Object o2 )
     {
+        String syntax1Description = null;
+        String syntax2Description = null;
+
         if ( o1 instanceof LdapSyntax && o2 instanceof LdapSyntax )
         {
-            List<String> syntax1Names = ( ( LdapSyntax ) o1 ).getNames();
-            List<String> syntax2Names = ( ( LdapSyntax ) o2 ).getNames();
+            syntax1Description = ( ( LdapSyntax ) o1 ).getDescription();
+            syntax2Description = ( ( LdapSyntax ) o2 ).getDescription();
 
-            if ( ( syntax1Names != null ) && ( syntax2Names != null ) &&
( syntax1Names.size() > 0 )
-                && ( syntax2Names.size() > 0 ) )
-            {
-                return syntax1Names.get( 0 ).compareToIgnoreCase( syntax2Names.get( 0 ) );
-            }
         }
         else if ( o1 instanceof LdapSyntax && o2 instanceof NonExistingSyntax )
         {
-            List<String> syntax1Names = ( ( LdapSyntax ) o1 ).getNames();
-            String syntax2Name = ( ( NonExistingSyntax ) o2 ).getName();
-
-            if ( ( syntax1Names != null ) && ( syntax2Name != null ) && (
syntax1Names.size() > 0 ) )
-            {
-                return syntax1Names.get( 0 ).compareToIgnoreCase( syntax2Name );
-            }
+            syntax1Description = ( ( LdapSyntax ) o1 ).getDescription();
+            syntax2Description = ( ( NonExistingSyntax ) o2 ).getDescription();
         }
         else if ( o1 instanceof NonExistingSyntax && o2 instanceof LdapSyntax )
         {
-            String syntax1Name = ( ( NonExistingSyntax ) o1 ).getName();
-            List<String> syntax2Names = ( ( LdapSyntax ) o2 ).getNames();
-
-            if ( ( syntax1Name != null ) && ( syntax2Names != null ) && (
syntax2Names.size() > 0 ) )
-            {
-                return syntax1Name.compareToIgnoreCase( syntax2Names.get( 0 ) );
-            }
+            syntax1Description = ( ( NonExistingSyntax ) o1 ).getDescription();
+            syntax2Description = ( ( LdapSyntax ) o2 ).getDescription();
         }
         else if ( o1 instanceof NonExistingSyntax && o2 instanceof NonExistingSyntax
)
         {
-            String syntax1Name = ( ( NonExistingSyntax ) o1 ).getName();
-            String syntax2Name = ( ( NonExistingSyntax ) o2 ).getName();
+            syntax1Description = ( ( NonExistingSyntax ) o1 ).getDescription();
+            syntax2Description = ( ( NonExistingSyntax ) o2 ).getDescription();
+        }
 
-            if ( ( syntax1Name != null ) && ( syntax2Name != null ) )
-            {
-                return syntax1Name.compareToIgnoreCase( syntax2Name );
-            }
+        if ( ( syntax1Description != null ) && ( syntax2Description != null ) )
+        {
+            return syntax1Description.compareToIgnoreCase( syntax2Description );
         }
 
         return 0;

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java?rev=1209520&r1=1209519&r2=1209520&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
Fri Dec  2 14:57:58 2011
@@ -491,13 +491,13 @@ public class AttributeTypeEditorOverview
             {
                 NonExistingSyntax nes = ( NonExistingSyntax ) selectedItem;
 
-                if ( NonExistingMatchingRule.NONE.equals( nes.getName() ) )
+                if ( NonExistingMatchingRule.NONE.equals( nes.getDescription() ) )
                 {
                     modifiedAttributeType.setSyntaxOid( null );
                 }
                 else
                 {
-                    modifiedAttributeType.setSyntaxOid( ( ( NonExistingSyntax ) selectedItem
).getName() );
+                    modifiedAttributeType.setSyntaxOid( ( ( NonExistingSyntax ) selectedItem
).getDescription() );
                 }
             }
             setEditorDirty();



Mime
View raw message