directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r513420 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions: LinkWithEditorHierarchyView.java LinkWithEditorSchemasView.java
Date Thu, 01 Mar 2007 18:00:40 GMT
Author: pamarcelot
Date: Thu Mar  1 10:00:37 2007
New Revision: 513420

URL: http://svn.apache.org/viewvc?view=rev&rev=513420
Log:
Improved LinkWithEditor Actions. Removed unnecessary code.

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=513420&r1=513419&r2=513420
==============================================================================
--- 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  1 10:00:37 2007
@@ -68,9 +68,9 @@
     private IPartListener2 editorListener = new IPartListener2()
     {
         /* (non-Javadoc)
-         * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+         * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
          */
-        public void partBroughtToTop( IWorkbenchPartReference partRef )
+        public void partVisible( IWorkbenchPartReference partRef )
         {
             String id = partRef.getId();
 
@@ -88,14 +88,6 @@
          */
         public void partActivated( IWorkbenchPartReference partRef )
         {
-            String id = partRef.getId();
-
-            if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
-            {
-                hierarchyView.getSite().getPage().removePostSelectionListener( HierarchyView.ID,
viewListener );
-                linkViewWithEditor( partRef.getPartName(), id );
-                hierarchyView.getSite().getPage().addPostSelectionListener( HierarchyView.ID,
viewListener );
-            }
         }
 
 
@@ -140,18 +132,10 @@
 
 
         /* (non-Javadoc)
-         * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
+         * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
          */
-        public void partVisible( IWorkbenchPartReference partRef )
+        public void partBroughtToTop( IWorkbenchPartReference partRef )
         {
-            String id = partRef.getId();
-
-            if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
-            {
-                hierarchyView.getSite().getPage().removePostSelectionListener( HierarchyView.ID,
viewListener );
-                linkViewWithEditor( partRef.getPartName(), id );
-                hierarchyView.getSite().getPage().addPostSelectionListener( HierarchyView.ID,
viewListener );
-            }
         }
     };
 
@@ -352,10 +336,12 @@
             IEditorReference reference = editorReferences[i];
             IWorkbenchPart workbenchPart = reference.getPart( true );
 
-            if ( ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper
instanceof ObjectClassWrapper ) && ( reference.getPartName().equals( ( ( ObjectClassWrapper
) wrapper).getMyObjectClass().getNames()[0] ) ) )
-              || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper
instanceof AttributeTypeWrapper ) && ( reference.getPartName().equals( ( ( AttributeTypeWrapper
) wrapper).getMyAttributeType().getNames()[0] ) ) ) 
-              || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof
SchemaWrapper ) && ( reference.getPartName().equals( ( ( SchemaWrapper ) wrapper).getMySchema().getName()
) ) ) 
-               )
+            if ( ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper
instanceof ObjectClassWrapper ) && ( reference
+                .getPartName().equals( ( ( ObjectClassWrapper ) wrapper ).getMyObjectClass().getNames()[0]
) ) )
+                || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper
instanceof AttributeTypeWrapper ) && ( reference
+                    .getPartName().equals( ( ( AttributeTypeWrapper ) wrapper ).getMyAttributeType().getNames()[0]
) ) )
+                || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof
SchemaWrapper ) && ( reference
+                    .getPartName().equals( ( ( SchemaWrapper ) wrapper ).getMySchema().getName()
) ) ) )
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop(
workbenchPart );
                 return;

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=513420&r1=513419&r2=513420
==============================================================================
--- 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  1 10:00:37 2007
@@ -67,9 +67,9 @@
     private IPartListener2 editorListener = new IPartListener2()
     {
         /* (non-Javadoc)
-         * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+         * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
          */
-        public void partBroughtToTop( IWorkbenchPartReference partRef )
+        public void partVisible( IWorkbenchPartReference partRef )
         {
             String id = partRef.getId();
 
@@ -87,14 +87,6 @@
          */
         public void partActivated( IWorkbenchPartReference partRef )
         {
-            String id = partRef.getId();
-
-            if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
-            {
-                schemasView.getSite().getPage().removePostSelectionListener( SchemasView.ID,
viewListener );
-                linkViewWithEditor( partRef.getPartName(), id );
-                schemasView.getSite().getPage().addPostSelectionListener( SchemasView.ID,
viewListener );
-            }
         }
 
 
@@ -139,18 +131,10 @@
 
 
         /* (non-Javadoc)
-         * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
+         * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
          */
-        public void partVisible( IWorkbenchPartReference partRef )
+        public void partBroughtToTop( IWorkbenchPartReference partRef )
         {
-            String id = partRef.getId();
-
-            if ( ( id.equals( ObjectClassFormEditor.ID ) || ( id.equals( AttributeTypeFormEditor.ID
) ) ) )
-            {
-                schemasView.getSite().getPage().removePostSelectionListener( SchemasView.ID,
viewListener );
-                linkViewWithEditor( partRef.getPartName(), id );
-                schemasView.getSite().getPage().addPostSelectionListener( SchemasView.ID,
viewListener );
-            }
         }
     };
 
@@ -351,10 +335,12 @@
             IEditorReference reference = editorReferences[i];
             IWorkbenchPart workbenchPart = reference.getPart( true );
 
-            if ( ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper
instanceof ObjectClassWrapper ) && ( reference.getPartName().equals( ( ( ObjectClassWrapper
) wrapper).getMyObjectClass().getNames()[0] ) ) )
-              || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper
instanceof AttributeTypeWrapper ) && ( reference.getPartName().equals( ( ( AttributeTypeWrapper
) wrapper).getMyAttributeType().getNames()[0] ) ) ) 
-              || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof
SchemaWrapper ) && ( reference.getPartName().equals( ( ( SchemaWrapper ) wrapper).getMySchema().getName()
) ) ) 
-               )
+            if ( ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper
instanceof ObjectClassWrapper ) && ( reference
+                .getPartName().equals( ( ( ObjectClassWrapper ) wrapper ).getMyObjectClass().getNames()[0]
) ) )
+                || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper
instanceof AttributeTypeWrapper ) && ( reference
+                    .getPartName().equals( ( ( AttributeTypeWrapper ) wrapper ).getMyAttributeType().getNames()[0]
) ) )
+                || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof
SchemaWrapper ) && ( reference
+                    .getPartName().equals( ( ( SchemaWrapper ) wrapper ).getMySchema().getName()
) ) ) )
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop(
workbenchPart );
                 return;



Mime
View raw message