directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r581288 - /directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java
Date Tue, 02 Oct 2007 15:55:08 GMT
Author: pamarcelot
Date: Tue Oct  2 08:55:07 2007
New Revision: 581288

URL: http://svn.apache.org/viewvc?rev=581288&view=rev
Log:
Fix for DIRSTUDIO-214 (IllegalArgumentException raised when selecting an AT with no alias
as superior in the NewAttributeTypeWizard).

Modified:
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java?rev=581288&r1=581287&r2=581288&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeContentWizardPage.java
Tue Oct  2 08:55:07 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.studio.schemaeditor.Activator;
 import org.apache.directory.studio.schemaeditor.PluginConstants;
 import org.apache.directory.studio.schemaeditor.controller.SchemaHandler;
+import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.schemaeditor.model.SyntaxImpl;
 import org.apache.directory.studio.schemaeditor.view.dialogs.AttributeTypeSelectionDialog;
 import org.eclipse.jface.dialogs.Dialog;
@@ -137,7 +138,16 @@
                 AttributeTypeSelectionDialog dialog = new AttributeTypeSelectionDialog();
                 if ( dialog.open() == Dialog.OK )
                 {
-                    superiorText.setText( dialog.getSelectedAttributeType().getName() );
+                    AttributeTypeImpl selectedAT = dialog.getSelectedAttributeType();
+                    String[] aliases = selectedAT.getNames();
+                    if ( ( aliases != null ) && ( aliases.length > 0 ) )
+                    {
+                        superiorText.setText( aliases[0] );
+                    }
+                    else
+                    {
+                        superiorText.setText( selectedAT.getOid() );
+                    }
                 }
             }
         } );



Mime
View raw message