directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r619357 - /directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/
Date Thu, 07 Feb 2008 10:49:04 GMT
Author: pamarcelot
Date: Thu Feb  7 02:49:03 2008
New Revision: 619357

URL: http://svn.apache.org/viewvc?rev=619357&view=rev
Log:
Fix for DIRSTUDIO-275 (Import/Export wizards should display an error if no Schema Project
is open).

Modified:
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportCoreSchemasWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -211,6 +211,7 @@
         } );
 
         initFields();
+        dialogChanged();
 
         setControl( composite );
     }
@@ -277,6 +278,13 @@
      */
     private void dialogChanged()
     {
+        // Checking if a Schema Project is open
+        if ( schemaHandler == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to export schemas as OpenLDAP
files." );
+            return;
+        }
+        
         // Schemas table
         if ( schemasTableViewer.getCheckedElements().length == 0 )
         {

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -273,6 +273,7 @@
         } );
 
         initFields();
+        dialogChanged();
 
         setControl( composite );
     }
@@ -405,6 +406,13 @@
      */
     private void dialogChanged()
     {
+        // Checking if a Schema Project is open
+        if ( schemaHandler == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to export schemas as XML
files." );
+            return;
+        }
+        
         // Schemas table
         if ( schemasTableViewer.getCheckedElements().length == 0 )
         {

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -273,6 +273,7 @@
         } );
 
         initFields();
+        dialogChanged();
 
         setControl( composite );
     }
@@ -405,6 +406,13 @@
      */
     private void dialogChanged()
     {
+        // Checking if a Schema Project is open
+        if ( schemaHandler == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to export schemas for Apache
DS." );
+            return;
+        }
+
         // Schemas table
         if ( schemasTableViewer.getCheckedElements().length == 0 )
         {

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportCoreSchemasWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportCoreSchemasWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportCoreSchemasWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportCoreSchemasWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -83,7 +83,39 @@
             coreSchemaSelectionWidget.setGrayedCoreSchemas( schemaNames.toArray( new String[0]
) );
         }
 
+        dialogChanged();
+
         setControl( composite );
+    }
+
+
+    /**
+     * This method is called when the user modifies something in the UI.
+     */
+    private void dialogChanged()
+    {
+        // Checking if a Schema Project is open
+        if ( Activator.getDefault().getSchemaHandler() == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to import core schemas files."
);
+            return;
+        }
+
+        displayErrorMessage( null );
+    }
+
+
+    /**
+     * Displays an error message and set the page status as incomplete
+     * if the message is not null.
+     *
+     * @param message
+     *      the message to display
+     */
+    private void displayErrorMessage( String message )
+    {
+        setErrorMessage( message );
+        setPageComplete( message == null );
     }
 
 

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -196,6 +196,7 @@
         } );
 
         initFields();
+        dialogChanged();
 
         setControl( composite );
     }
@@ -269,6 +270,13 @@
      */
     private void dialogChanged()
     {
+        // Checking if a Schema Project is open
+        if ( Activator.getDefault().getSchemaHandler() == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to import schemas from OpenLDAP
files." );
+            return;
+        }
+
         // Import Directory
         String directory = fromDirectoryText.getText();
         if ( ( directory == null ) || ( directory.equals( "" ) ) )

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java?rev=619357&r1=619356&r2=619357&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizardPage.java
Thu Feb  7 02:49:03 2008
@@ -196,6 +196,7 @@
         } );
 
         initFields();
+        dialogChanged();
 
         setControl( composite );
     }
@@ -269,6 +270,13 @@
      */
     private void dialogChanged()
     {
+        // Checking if a Schema Project is open
+        if ( Activator.getDefault().getSchemaHandler() == null )
+        {
+            displayErrorMessage( "A Schema Project must be open to import schemas from XML
files." );
+            return;
+        }
+        
         // Export Directory
         String directory = fromDirectoryText.getText();
         if ( ( directory == null ) || ( directory.equals( "" ) ) )



Mime
View raw message