directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r507502 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors: AttributeTypeFormEditorOverviewPage.java ObjectClassFormEditorOverviewPage.java
Date Wed, 14 Feb 2007 12:13:09 GMT
Author: pamarcelot
Date: Wed Feb 14 04:13:08 2007
New Revision: 507502

URL: http://svn.apache.org/viewvc?view=rev&rev=507502
Log:
Fixed DIRSTUDIO-59 (Add a Schema Field in the AT/OC editors).

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

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/AttributeTypeFormEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/AttributeTypeFormEditorOverviewPage.java?view=diff&rev=507502&r1=507501&r2=507502
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/AttributeTypeFormEditorOverviewPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/editors/AttributeTypeFormEditorOverviewPage.java
Wed Feb 14 04:13:08 2007
@@ -46,6 +46,7 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
@@ -80,6 +81,8 @@
     private String[] aliasesList;
     private Button aliasesButton;
     private Text oidText;
+    private Hyperlink schemaLink;
+    private Label schemaLabel;
     private Text descriptionText;
     private Hyperlink supLabel;
     private Combo supCombo;
@@ -140,6 +143,27 @@
 
     /** The listener for the OID Text Widget */
     //    private Object oidTextListener;
+    
+    /** The listener for the Schema Hyperlink Widget*/
+    private HyperlinkAdapter schemaLinkListener = new HyperlinkAdapter()
+    {
+        public void linkActivated( HyperlinkEvent e )
+        {
+            IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+            SchemaFormEditorInput input = new SchemaFormEditorInput( modifiedAttributeType.getOriginatingSchema()
);
+            String editorId = SchemaFormEditor.ID;
+            try
+            {
+                page.openEditor( input, editorId );
+            }
+            catch ( PartInitException exception )
+            {
+                Logger.getLogger( AttributeTypeFormEditorInput.class ).debug( "error when
opening the editor" ); //$NON-NLS-1$
+            }
+        }
+    };
+    
     /** The listener for the Description Text Widget */
     private ModifyListener descriptionTextListener = new ModifyListener()
     {
@@ -441,6 +465,11 @@
             .getString( "AttributeTypeFormEditorOverviewPage.Description" ) ); //$NON-NLS-1$
         descriptionText = toolkit.createText( client_general_information, "", SWT.MULTI |
SWT.V_SCROLL ); //$NON-NLS-1$
         descriptionText.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 2, 1
) );
+        
+        // SCHEMA Field
+        schemaLink = toolkit.createHyperlink( client_general_information, "Schema:", SWT.WRAP
 );
+        schemaLabel =  toolkit.createLabel( client_general_information, "" ); //$NON-NLS-1$
+        schemaLabel.setLayoutData( new GridData( SWT.FILL, 0, true, false, 2, 1 ) );
 
         // SUP Combo
         supLabel = toolkit.createHyperlink( client_general_information, Messages
@@ -704,6 +733,12 @@
         {
             this.oidText.setText( modifiedAttributeType.getOid() );
         }
+        
+        // SCHEMA Field
+        if ( modifiedAttributeType.getOriginatingSchema() != null )
+        {
+            this.schemaLabel.setText( modifiedAttributeType.getOriginatingSchema().getName()
);
+        }
 
         // DESCRIPTION Field
         if ( modifiedAttributeType.getDescription() != null )
@@ -809,7 +844,7 @@
         // ALIASES Button
         // The user can always access to the Manage Aliases Window, but if the object class
is in a core-schema file editing will be disabled
         aliasesButton.addSelectionListener( aliasesButtonListener );
-
+        schemaLink.addHyperlinkListener( schemaLinkListener );
         supLabel.addHyperlinkListener( supLabelListener );
     }
 
@@ -821,6 +856,7 @@
     {
         nameText.removeModifyListener( nameTextListener );
         aliasesButton.removeSelectionListener( aliasesButtonListener );
+        schemaLink.removeHyperlinkListener( schemaLinkListener );
         descriptionText.removeModifyListener( descriptionTextListener );
         supLabel.removeHyperlinkListener( supLabelListener );
         supCombo.removeModifyListener( supComboListener );

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=507502&r1=507501&r2=507502
==============================================================================
--- 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
Wed Feb 14 04:13:08 2007
@@ -48,6 +48,7 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
@@ -85,6 +86,8 @@
     private String[] aliasesList;
     private Button aliasesButton;
     private Text oidText;
+    private Hyperlink schemaLink;
+    private Label schemaLabel;
     private Text descriptionText;
     private Hyperlink supLabel;
     private Combo supCombo;
@@ -149,6 +152,26 @@
             setEditorDirty();
         }
     };
+    
+    /** The listener for the Schema Hyperlink Widget*/
+    private HyperlinkAdapter schemaLinkListener = new HyperlinkAdapter()
+    {
+        public void linkActivated( HyperlinkEvent e )
+        {
+            IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+            SchemaFormEditorInput input = new SchemaFormEditorInput( modifiedObjectClass.getOriginatingSchema()
);
+            String editorId = SchemaFormEditor.ID;
+            try
+            {
+                page.openEditor( input, editorId );
+            }
+            catch ( PartInitException exception )
+            {
+                Logger.getLogger( AttributeTypeFormEditorInput.class ).debug( "error when
opening the editor" ); //$NON-NLS-1$
+            }
+        }
+    };
 
     /** The listener for Description Text Widget */
     private ModifyListener descriptionTextListener = new ModifyListener()
@@ -529,6 +552,11 @@
         oidText = toolkit.createText( client_general_information, "" ); //$NON-NLS-1$
         oidText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
+        // SCHEMA Field
+        schemaLink = toolkit.createHyperlink( client_general_information, "Schema:", SWT.WRAP
 );
+        schemaLabel =  toolkit.createLabel( client_general_information, "" ); //$NON-NLS-1$
+        schemaLabel.setLayoutData( new GridData( SWT.FILL, 0, true, false ) );
+
         // DESCRIPTION Field
         toolkit.createLabel( client_general_information, Messages
             .getString( "ObjectClassFormEditorOverviewPage.Description" ) ); //$NON-NLS-1$
@@ -698,6 +726,12 @@
         {
             oidText.setText( modifiedObjectClass.getOid() );
         }
+        
+        // SCHEMAS Field
+        if ( modifiedObjectClass.getOriginatingSchema() != null )
+        {
+            this.schemaLabel.setText( modifiedObjectClass.getOriginatingSchema().getName()
);
+        }
 
         // DESCRIPTION Field
         if ( modifiedObjectClass.getDescription() != null )
@@ -875,6 +909,7 @@
         // The user can always access to the Manage Aliases Window, but if the object class
is in a core-schema file editing will be disabled
         aliasesButton.addSelectionListener( aliasesButtonListener );
 
+        schemaLink.addHyperlinkListener( schemaLinkListener );
         supLabel.addHyperlinkListener( supLabelListener );
 
         // This listener needs to be outside of the 'if' so that attribute type editor can
be opened from any object class (in a core or a user schema)
@@ -893,6 +928,7 @@
         nameText.removeModifyListener( nameTextListener );
         aliasesButton.removeSelectionListener( aliasesButtonListener );
         oidText.removeModifyListener( oidTextListener );
+        schemaLink.removeHyperlinkListener( schemaLinkListener );
         descriptionText.removeModifyListener( descriptionTextListener );
         supLabel.removeHyperlinkListener( supLabelListener );
         supCombo.removeModifyListener( supComboListener );



Mime
View raw message