directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r499717 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view: viewers/wrappers/ wizards/
Date Thu, 25 Jan 2007 10:09:08 GMT
Author: pamarcelot
Date: Thu Jan 25 02:09:07 2007
New Revision: 499717

URL: http://svn.apache.org/viewvc?view=rev&rev=499717
Log:
Fixing DIRSTUDIO-32 (When creating a new OC/AT, the associated editor should be opened at
the end of the wizard).

Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/AttributeTypeWrapper.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizard.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizard.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/AttributeTypeWrapper.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/AttributeTypeWrapper.java?view=diff&rev=499717&r1=499716&r2=499717
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/AttributeTypeWrapper.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/AttributeTypeWrapper.java
Thu Jan 25 02:09:07 2007
@@ -127,6 +127,19 @@
     /******************************************
      *           Object Redefinition          *
      ******************************************/
+    
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( obj instanceof AttributeTypeWrapper )
+        {
+            AttributeTypeWrapper compared = ( AttributeTypeWrapper ) obj;
+            return compared.getOid().equals( this.getOid() );
+        }
+        return false;
+    }
 
     /* (non-Javadoc)
      * @see java.lang.Object#toString()

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizard.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizard.java?view=diff&rev=499717&r1=499716&r2=499717
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizard.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizard.java
Thu Jan 25 02:09:07 2007
@@ -24,12 +24,16 @@
 import org.apache.directory.ldapstudio.schemas.model.AttributeType;
 import org.apache.directory.ldapstudio.schemas.model.Schema;
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
+import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditor;
+import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditorInput;
 import org.apache.directory.server.core.tools.schema.AttributeTypeLiteral;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -75,11 +79,20 @@
 
         // Creating the new attribute type and adding it to the schema
         AttributeTypeLiteral attributeTypeLiteral = new AttributeTypeLiteral( this.page.getOidField()
);
-        attributeTypeLiteral.setNames( new String[]
-            { this.page.getNameField() } );
-
+        attributeTypeLiteral.setNames( new String[] { this.page.getNameField() } );
         AttributeType attributeType = new AttributeType( attributeTypeLiteral, schema );
         schema.addAttributeType( attributeType );
+        
+        // Opening the associated editor
+        AttributeTypeFormEditorInput input = new AttributeTypeFormEditorInput( attributeType
);
+        String editorId = AttributeTypeFormEditor.ID;
+        try
+        {
+            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(
input, editorId );
+        }
+        catch ( PartInitException e )
+        {
+        }
 
         return true;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizard.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizard.java?view=diff&rev=499717&r1=499716&r2=499717
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizard.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizard.java
Thu Jan 25 02:09:07 2007
@@ -24,12 +24,16 @@
 import org.apache.directory.ldapstudio.schemas.model.ObjectClass;
 import org.apache.directory.ldapstudio.schemas.model.Schema;
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
+import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditor;
+import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditorInput;
 import org.apache.directory.server.core.tools.schema.ObjectClassLiteral;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -74,14 +78,22 @@
 
         // Creating the new object class and adding it to the schema
         ObjectClassLiteral objectClassLiteral = new ObjectClassLiteral( this.page.getOidField()
);
-        objectClassLiteral.setNames( new String[]
-            { this.page.getNameField() } );
-        objectClassLiteral.setSuperiors( new String[]
-            { "top" } ); //$NON-NLS-1$
-
+        objectClassLiteral.setNames( new String[] { this.page.getNameField() } );
+        objectClassLiteral.setSuperiors( new String[]{ "top" } ); //$NON-NLS-1$
         ObjectClass objectClass = new ObjectClass( objectClassLiteral, schema );
         schema.addObjectClass( objectClass );
 
+        // Opening the associated editor
+        ObjectClassFormEditorInput input = new ObjectClassFormEditorInput( objectClass );
+        String editorId = ObjectClassFormEditor.ID;
+        try
+        {
+            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(
input, editorId );
+        }
+        catch ( PartInitException e )
+        {
+        }
+        
         return true;
     }
 



Mime
View raw message