directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r559047 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
Date Tue, 24 Jul 2007 13:24:33 GMT
Author: pamarcelot
Date: Tue Jul 24 06:24:33 2007
New Revision: 559047

URL: http://svn.apache.org/viewvc?view=rev&rev=559047
Log:
Added code to select the newly created Attribute Type or Object Class upon creation.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java?view=diff&rev=559047&r1=559046&r2=559047
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
Tue Jul 24 06:24:33 2007
@@ -106,6 +106,7 @@
 
             if ( schemaWrapper != null )
             {
+                AttributeTypeWrapper atw = null;
                 int group = Activator.getDefault().getPreferenceStore().getInt(
                     PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );
                 if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
@@ -116,17 +117,23 @@
                         Folder folder = ( Folder ) child;
                         if ( folder.getType() == FolderType.ATTRIBUTE_TYPE )
                         {
-                            folder.addChild( new AttributeTypeWrapper( at, folder ) );
+                            atw = new AttributeTypeWrapper( at, folder );
+                            folder.addChild( atw );
                             break;
                         }
                     }
                 }
                 else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
                 {
-                    schemaWrapper.addChild( new AttributeTypeWrapper( at, schemaWrapper )
);
+                    atw = new AttributeTypeWrapper( at, schemaWrapper );
+                    schemaWrapper.addChild( atw );
                 }
 
                 viewer.refresh( schemaWrapper );
+                if ( atw != null )
+                {
+                    viewer.setSelection( new StructuredSelection( atw ) );
+                }
             }
             else
             {
@@ -184,6 +191,7 @@
 
             if ( schemaWrapper != null )
             {
+                ObjectClassWrapper ocw = null;
                 int group = Activator.getDefault().getPreferenceStore().getInt(
                     PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );
                 if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
@@ -194,17 +202,23 @@
                         Folder folder = ( Folder ) child;
                         if ( folder.getType() == FolderType.OBJECT_CLASS )
                         {
-                            folder.addChild( new ObjectClassWrapper( oc, folder ) );
+                            ocw = new ObjectClassWrapper( oc, folder );
+                            folder.addChild( ocw );
                             break;
                         }
                     }
                 }
                 else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
                 {
-                    schemaWrapper.addChild( new ObjectClassWrapper( oc, schemaWrapper ) );
+                    ocw = new ObjectClassWrapper( oc, schemaWrapper );
+                    schemaWrapper.addChild( ocw );
                 }
 
                 viewer.refresh( schemaWrapper );
+                if ( ocw != null )
+                {
+                    viewer.setSelection( new StructuredSelection( ocw ) );
+                }
             }
             else
             {



Mime
View raw message