directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r515994 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions: LinkWithEditorHierarchyView.java LinkWithEditorSchemasView.java
Date Thu, 08 Mar 2007 09:58:44 GMT
Author: pamarcelot
Date: Thu Mar  8 01:58:43 2007
New Revision: 515994

URL: http://svn.apache.org/viewvc?view=rev&rev=515994
Log:
Fixed a bug with LinkWithEditor listener on Schemas View. The listener was not linking well
SchemaFormEditors with SchemaWrappers.

Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorHierarchyView.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorSchemasView.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorHierarchyView.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorHierarchyView.java?view=diff&rev=515994&r1=515993&r2=515994
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorHierarchyView.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorHierarchyView.java
Thu Mar  8 01:58:43 2007
@@ -29,7 +29,6 @@
 import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditor;
 import org.apache.directory.ldapstudio.schemas.view.editors.SchemaFormEditor;
 import org.apache.directory.ldapstudio.schemas.view.viewers.HierarchyView;
-import org.apache.directory.ldapstudio.schemas.view.viewers.SchemasView;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.AttributeTypeWrapper;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.DisplayableTreeElement;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.IntermediateNode;
@@ -76,9 +75,9 @@
 
             if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
             {
-                hierarchyView.getSite().getPage().removePostSelectionListener( HierarchyView.ID,
viewListener );
+                hierarchyView.getSite().getPage().removePostSelectionListener( viewListener
);
                 linkViewWithEditor( partRef.getPartName(), id );
-                hierarchyView.getSite().getPage().addPostSelectionListener( HierarchyView.ID,
viewListener );
+                hierarchyView.getSite().getPage().addPostSelectionListener( viewListener
);
             }
         }
 
@@ -219,13 +218,13 @@
                 linkViewWithEditor( editor.getPartName(), AttributeTypeFormEditor.ID );
             }
 
-            hierarchyView.getSite().getPage().addPostSelectionListener( HierarchyView.ID,
viewListener );
+            hierarchyView.getSite().getPage().addPostSelectionListener( viewListener );
         }
         else
         // Disabling the listeners
         {
             PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(
editorListener );
-            hierarchyView.getSite().getPage().removePostSelectionListener( SchemasView.ID,
viewListener );
+            hierarchyView.getSite().getPage().removePostSelectionListener( viewListener );
         }
     }
 

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorSchemasView.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorSchemasView.java?view=diff&rev=515994&r1=515993&r2=515994
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorSchemasView.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/LinkWithEditorSchemasView.java
Thu Mar  8 01:58:43 2007
@@ -24,6 +24,7 @@
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.model.AttributeType;
 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.AttributeTypeFormEditor;
 import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditor;
@@ -73,11 +74,12 @@
         {
             String id = partRef.getId();
 
-            if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
+            if ( id.equals( ObjectClassFormEditor.ID ) || id.equals( AttributeTypeFormEditor.ID
)
+                || id.equals( SchemaFormEditor.ID ) )
             {
-                schemasView.getSite().getPage().removePostSelectionListener( SchemasView.ID,
viewListener );
+                schemasView.getSite().getPage().removePostSelectionListener( viewListener
);
                 linkViewWithEditor( partRef.getPartName(), id );
-                schemasView.getSite().getPage().addPostSelectionListener( SchemasView.ID,
viewListener );
+                schemasView.getSite().getPage().addPostSelectionListener( viewListener );
             }
         }
 
@@ -218,13 +220,13 @@
                 linkViewWithEditor( editor.getPartName(), AttributeTypeFormEditor.ID );
             }
 
-            schemasView.getSite().getPage().addPostSelectionListener( SchemasView.ID, viewListener
);
+            schemasView.getSite().getPage().addPostSelectionListener( viewListener );
         }
         else
         // Disabling the listeners
         {
             PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(
editorListener );
-            schemasView.getSite().getPage().removePostSelectionListener( SchemasView.ID,
viewListener );
+            schemasView.getSite().getPage().removePostSelectionListener( viewListener );
         }
     }
 
@@ -255,6 +257,12 @@
         {
             ObjectClass oc = SchemaPool.getInstance().getObjectClass( editorName );
             wrapper = new ObjectClassWrapper( oc, null );
+            structuredSelection = new StructuredSelection( wrapper );
+        }
+        else if ( editorID.equals( SchemaFormEditor.ID ) )
+        {
+            Schema schema = SchemaPool.getInstance().getSchema( editorName );
+            wrapper = new SchemaWrapper( schema, null );
             structuredSelection = new StructuredSelection( wrapper );
         }
         else



Mime
View raw message