directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r504912 - /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/
Date Thu, 08 Feb 2007 14:33:43 GMT
Author: pamarcelot
Date: Thu Feb  8 06:33:42 2007
New Revision: 504912

URL: http://svn.apache.org/viewvc?view=rev&rev=504912
Log:
Updated Javadoc and code cleaning.

Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditor.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorInput.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorOverviewPage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorSourceCodePage.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditor.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditor.java?view=diff&rev=504912&r1=504911&r2=504912
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditor.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditor.java
Thu Feb  8 06:33:42 2007
@@ -22,7 +22,6 @@
 
 
 import org.apache.directory.ldapstudio.schemas.controller.Application;
-import org.apache.directory.ldapstudio.schemas.view.editors.Messages;
 import org.apache.directory.ldapstudio.schemas.model.ObjectClass;
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -122,11 +121,9 @@
     {
         try
         {
-            overview = new ObjectClassFormEditorOverviewPage( this,
-                "overview", Messages.getString( "ObjectClassFormEditor.Overview" ) ); //$NON-NLS-1$
//$NON-NLS-2$
+            overview = new ObjectClassFormEditorOverviewPage( this ); //$NON-NLS-1$ //$NON-NLS-2$
             addPage( overview );
-            sourceCode = new ObjectClassFormEditorSourceCodePage( this,
-                "sourceCode", Messages.getString( "ObjectClassFormEditor.Source_Code" ) );
//$NON-NLS-1$ //$NON-NLS-2$
+            sourceCode = new ObjectClassFormEditorSourceCodePage( this ); //$NON-NLS-1$ //$NON-NLS-2$
             addPage( sourceCode );
         }
         catch ( PartInitException e )

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorInput.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorInput.java?view=diff&rev=504912&r1=504911&r2=504912
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorInput.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorInput.java
Thu Feb  8 06:33:42 2007
@@ -36,8 +36,10 @@
 
 
     /**
-     * Default constructor
+     * Default constructor.
+     * 
      * @param obj
+     *      the object class
      */
     public ObjectClassFormEditorInput( ObjectClass obj )
     {
@@ -118,11 +120,12 @@
 
     /**
      * Returns the input object class
-     * @return the input object class
+     * 
+     * @return
+     *      the input object class
      */
     public ObjectClass getObjectClass()
     {
         return this.objectClass;
     }
-
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorOverviewPage.java?view=diff&rev=504912&r1=504911&r2=504912
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorOverviewPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorOverviewPage.java
Thu Feb  8 06:33:42 2007
@@ -74,6 +74,12 @@
  */
 public class ObjectClassFormEditorOverviewPage extends FormPage implements SchemaElementListener
 {
+    /** The page ID */
+    public static final String ID = "org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassEditorOverviewPage";
+
+    /** The page title*/
+    public static final String TITLE = Messages.getString( "ObjectClassFormEditor.Overview"
);
+
     /** The modified object class */
     private ObjectClass modifiedObjectClass;
 
@@ -434,12 +440,11 @@
     /**
      * Default constructor
      * @param editor
-     * @param id
-     * @param title
+     *      the associated editor
      */
-    public ObjectClassFormEditorOverviewPage( FormEditor editor, String id, String title
)
+    public ObjectClassFormEditorOverviewPage( FormEditor editor )
     {
-        super( editor, id, title );
+        super( editor, ID, TITLE );
     }
 
 
@@ -639,6 +644,16 @@
     }
 
 
+    /**
+     * Verifies if an attribute type is already present in a the given table
+     *
+     * @param name
+     *      the name of the attribute type to search
+     * @param table
+     *      the table to search in
+     * @return
+     *      true if the attribute type is already present in the given table
+     */
     private boolean isAttributeTypeAlreadySpecified( String name, Table table )
     {
         for ( int i = 0; i < table.getItemCount(); i++ )

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorSourceCodePage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorSourceCodePage.java?view=diff&rev=504912&r1=504911&r2=504912
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorSourceCodePage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/ObjectClassFormEditorSourceCodePage.java
Thu Feb  8 06:33:42 2007
@@ -25,13 +25,11 @@
 import java.text.ParseException;
 import java.util.List;
 
-import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.model.LDAPModelEvent;
 import org.apache.directory.ldapstudio.schemas.model.ObjectClass;
 import org.apache.directory.ldapstudio.schemas.model.SchemaElement;
 import org.apache.directory.ldapstudio.schemas.model.SchemaElementListener;
 import org.apache.directory.ldapstudio.schemas.model.Schema.SchemaType;
-import org.apache.directory.ldapstudio.schemas.view.IImageKeys;
 import org.apache.directory.ldapstudio.schemas.view.viewers.SchemaSourceViewer;
 import org.apache.directory.server.core.tools.schema.ObjectClassLiteral;
 import org.apache.directory.server.core.tools.schema.OpenLdapSchemaParser;
@@ -49,7 +47,6 @@
 import org.eclipse.ui.forms.editor.FormPage;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 
 /**
@@ -57,22 +54,30 @@
  */
 public class ObjectClassFormEditorSourceCodePage extends FormPage implements SchemaElementListener
 {
+    /** The page ID */
+    public static final String ID = "org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassEditorSourceCodePage";
+
+    /** The page title*/
+    public static final String TITLE = Messages.getString( "ObjectClassFormEditor.Source_Code"
);
+
+    /** The modified object class */
     private ObjectClass modifiedObjectClass;
+
+    /** The Schema Source Viewer */
     private SchemaSourceViewer schemaSourceViewer;
-    
+
+    /** The flag to indicate if the user can leave the Source Code page */
     private boolean canLeaveThePage = true;
 
 
     /**
      * Default constructor
      * @param editor
-     * @param id
-     * @param title
+     *      the associated editor
      */
-    public ObjectClassFormEditorSourceCodePage( FormEditor editor, String id, String title
)
+    public ObjectClassFormEditorSourceCodePage( FormEditor editor )
     {
-        super( editor, id, title );
-        setTitleImage( AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, IImageKeys.ATTRIBUTE_TYPE_NEW_WIZARD
).createImage() );
+        super( editor, ID, TITLE );
     }
 
 
@@ -93,7 +98,8 @@
         modifiedObjectClass.addListener( this );
 
         // SOURCE CODE Field
-        schemaSourceViewer = new SchemaSourceViewer( form.getBody(), null, null, false, SWT.BORDER
| SWT.H_SCROLL | SWT.V_SCROLL );
+        schemaSourceViewer = new SchemaSourceViewer( form.getBody(), null, null, false, SWT.BORDER
| SWT.H_SCROLL
+            | SWT.V_SCROLL );
         GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true );
         gd.heightHint = 10;
         schemaSourceViewer.getTextWidget().setLayoutData( gd );
@@ -108,10 +114,10 @@
                 canLeaveThePage = true;
                 try
                 {
-                    ( (ObjectClassFormEditor) getEditor() ).setDirty( true );
+                    ( ( ObjectClassFormEditor ) getEditor() ).setDirty( true );
                     OpenLdapSchemaParser parser = new OpenLdapSchemaParser();
                     parser.parse( schemaSourceViewer.getTextWidget().getText() );
-                    
+
                     List objectclasses = parser.getObjectClassTypes();
                     if ( objectclasses.size() != 1 )
                     {
@@ -132,13 +138,13 @@
                     System.err.println( exception.getMessage() );
                 }
             }
-        });
+        } );
         //toolkit.createLabel( form.getBody(), "" );
-        
+
         // set text font
         Font font = JFaceResources.getFont( JFaceResources.TEXT_FONT );
         schemaSourceViewer.getTextWidget().setFont( font );
-        
+
         IDocument document = new Document();
         schemaSourceViewer.setDocument( document );
         schemaSourceViewer.getAnnotationModel().connect( document );
@@ -148,26 +154,42 @@
     }
 
 
+    /**
+     * Fills in the User Interface.
+     */
     private void fillInUiFields()
     {
         // SOURCE CODE Field
         schemaSourceViewer.getDocument().set( modifiedObjectClass.write() );
     }
-    
-    
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.editor.FormPage#canLeaveThePage()
+     */
     public boolean canLeaveThePage()
     {
         return canLeaveThePage;
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.ldapstudio.schemas.model.SchemaElementListener#schemaElementChanged(org.apache.directory.ldapstudio.schemas.model.SchemaElement,
org.apache.directory.ldapstudio.schemas.model.LDAPModelEvent)
+     */
     public void schemaElementChanged( SchemaElement originatingSchemaElement, LDAPModelEvent
e )
     {
         modifiedObjectClass.removeListener( this );
         fillInUiFields();
         modifiedObjectClass.addListener( this );
     }
-    
+
+
+    /**
+     * Updates the Modified Object Class from the given Object Class Literal.
+     *
+     * @param ocl
+     *      the Object Class Literal
+     */
     private void updateObjectClass( ObjectClassLiteral ocl )
     {
         modifiedObjectClass.removeListener( this );



Mime
View raw message