directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r521745 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors: attributeType/AttributeTypeEditorOverviewPage.java objectClass/ObjectClassEditorOverviewPage.java
Date Fri, 23 Mar 2007 14:41:09 GMT
Author: pamarcelot
Date: Fri Mar 23 07:41:08 2007
New Revision: 521745

URL: http://svn.apache.org/viewvc?view=rev&rev=521745
Log:
Code cleaning.

Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/objectClass/ObjectClassEditorOverviewPage.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java?view=diff&rev=521745&r1=521744&r2=521745
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/attributeType/AttributeTypeEditorOverviewPage.java
Fri Mar 23 07:41:08 2007
@@ -88,6 +88,9 @@
     /** The modified object class */
     private AttributeType modifiedAttributeType;
 
+    /** The Schema Pool */
+    private SchemaPool schemaPool;
+
     // UI Fields
     private Label aliasesLabel;
     private Button aliasesButton;
@@ -97,6 +100,7 @@
     private Text descriptionText;
     private Hyperlink supLabel;
     private Combo supCombo;
+    private ComboViewer supComboViewer;
     private Combo usageCombo;
     private Combo syntaxCombo;
     private Text syntaxLengthText;
@@ -149,7 +153,7 @@
             if ( OID.isOID( oid ) )
             {
                 if ( ( originalAttributeType.getOid().equals( oid ) )
-                    || !( SchemaPool.getInstance().containsSchemaElement( oid ) ) )
+                    || !( schemaPool.containsSchemaElement( oid ) ) )
                 {
                     modifiedAttributeType.setOid( oid );
                     setEditorDirty();
@@ -427,8 +431,6 @@
         }
     };
 
-    private ComboViewer supComboViewer;
-
 
     /**
      * Default constructor.
@@ -439,7 +441,8 @@
     public AttributeTypeEditorOverviewPage( FormEditor editor )
     {
         super( editor, ID, TITLE );
-        SchemaPool.getInstance().addListener( this );
+        schemaPool = SchemaPool.getInstance();
+        schemaPool.addListener( this );
     }
 
 
@@ -804,8 +807,6 @@
         else
         {
             String supAtName = modifiedAttributeType.getSuperior();
-
-            SchemaPool schemaPool = SchemaPool.getInstance();
 
             AttributeType supAT = schemaPool.getAttributeType( supAtName );
             if ( supAT != null )

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/objectClass/ObjectClassEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/objectClass/ObjectClassEditorOverviewPage.java?view=diff&rev=521745&r1=521744&r2=521745
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/objectClass/ObjectClassEditorOverviewPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/objectClass/ObjectClassEditorOverviewPage.java
Fri Mar 23 07:41:08 2007
@@ -94,6 +94,9 @@
     /** The modified object class */
     private ObjectClass modifiedObjectClass;
 
+    /** The Schema Pool */
+    private SchemaPool schemaPool;
+
     // UI fields
     private Label aliasesLabel;
     private Button aliasesButton;
@@ -156,8 +159,7 @@
 
             if ( OID.isOID( oid ) )
             {
-                if ( ( originalObjectClass.getOid().equals( oid ) )
-                    || !( SchemaPool.getInstance().containsSchemaElement( oid ) ) )
+                if ( ( originalObjectClass.getOid().equals( oid ) ) || !( schemaPool.containsSchemaElement(
oid ) ) )
                 {
                     modifiedObjectClass.setOid( oid );
                     setEditorDirty();
@@ -268,10 +270,9 @@
                 return;
             }
 
-            SchemaPool pool = SchemaPool.getInstance();
             IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 
-            AttributeTypeEditorInput input = new AttributeTypeEditorInput( pool.getAttributeType(
atw
+            AttributeTypeEditorInput input = new AttributeTypeEditorInput( schemaPool.getAttributeType(
atw
                 .getMyAttributeType().getNames()[0] ) );
             try
             {
@@ -304,11 +305,10 @@
         public void widgetSelected( SelectionEvent e )
         {
             AttributeTypeSelectionDialog dialog = new AttributeTypeSelectionDialog();
-            SchemaPool pool = SchemaPool.getInstance();
             List<AttributeType> hiddenATs = new ArrayList<AttributeType>();
             for ( String must : modifiedObjectClass.getMust() )
             {
-                AttributeType at = pool.getAttributeType( must );
+                AttributeType at = schemaPool.getAttributeType( must );
                 if ( at != null )
                 {
                     hiddenATs.add( at );
@@ -316,7 +316,7 @@
             }
             for ( String may : modifiedObjectClass.getMay() )
             {
-                AttributeType at = pool.getAttributeType( may );
+                AttributeType at = schemaPool.getAttributeType( may );
                 if ( at != null )
                 {
                     hiddenATs.add( at );
@@ -401,10 +401,9 @@
                 return;
             }
 
-            SchemaPool pool = SchemaPool.getInstance();
             IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 
-            AttributeTypeEditorInput input = new AttributeTypeEditorInput( pool.getAttributeType(
atw
+            AttributeTypeEditorInput input = new AttributeTypeEditorInput( schemaPool.getAttributeType(
atw
                 .getMyAttributeType().getNames()[0] ) );
             try
             {
@@ -432,11 +431,10 @@
         public void widgetSelected( SelectionEvent e )
         {
             AttributeTypeSelectionDialog dialog = new AttributeTypeSelectionDialog();
-            SchemaPool pool = SchemaPool.getInstance();
             List<AttributeType> hiddenATs = new ArrayList<AttributeType>();
             for ( String must : modifiedObjectClass.getMust() )
             {
-                AttributeType at = pool.getAttributeType( must );
+                AttributeType at = schemaPool.getAttributeType( must );
                 if ( at != null )
                 {
                     hiddenATs.add( at );
@@ -444,7 +442,7 @@
             }
             for ( String may : modifiedObjectClass.getMay() )
             {
-                AttributeType at = pool.getAttributeType( may );
+                AttributeType at = schemaPool.getAttributeType( may );
                 if ( at != null )
                 {
                     hiddenATs.add( at );
@@ -529,11 +527,10 @@
                 return;
             }
 
-            SchemaPool pool = SchemaPool.getInstance();
             IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 
-            ObjectClassEditorInput input = new ObjectClassEditorInput( pool.getObjectClass(
ocw.getMyObjectClass()
-                .getNames()[0] ) );
+            ObjectClassEditorInput input = new ObjectClassEditorInput( schemaPool.getObjectClass(
ocw
+                .getMyObjectClass().getNames()[0] ) );
             try
             {
                 page.openEditor( input, ObjectClassEditor.ID );
@@ -560,11 +557,10 @@
         public void widgetSelected( SelectionEvent e )
         {
             ObjectClassSelectionDialog dialog = new ObjectClassSelectionDialog();
-            SchemaPool pool = SchemaPool.getInstance();
             List<ObjectClass> hiddenOCs = new ArrayList<ObjectClass>();
             for ( String sup : modifiedObjectClass.getSuperiors() )
             {
-                ObjectClass oc = pool.getObjectClass( sup );
+                ObjectClass oc = schemaPool.getObjectClass( sup );
                 if ( oc != null )
                 {
                     hiddenOCs.add( oc );
@@ -642,6 +638,7 @@
     public ObjectClassEditorOverviewPage( FormEditor editor )
     {
         super( editor, ID, TITLE );
+        schemaPool = SchemaPool.getInstance();
     }
 
 



Mime
View raw message