directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r604860 - in /directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor: ./ view/wizards/
Date Mon, 17 Dec 2007 13:01:33 GMT
Author: pamarcelot
Date: Mon Dec 17 05:01:32 2007
New Revision: 604860

URL: http://svn.apache.org/viewvc?rev=604860&view=rev
Log:
Fix for DIRSTUDIO-240 (Memorize the last import's path).

Modified:
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
    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/ExportSchemasAsXmlWizard.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/ExportSchemasForADSWizard.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/ImportProjectsWizard.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
    directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.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/ImportSchemasFromXmlWizard.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/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PluginConstants.java
Mon Dec 17 05:01:32 2007
@@ -348,8 +348,28 @@
     public static final String PREFS_SEARCH_VIEW_SCHEMA_LABEL_DISPLAY = SearchViewPreferencePage.ID
         + ".schemaLabel.display"; //$NON-NLS-1$
 
+    // Contexts
     /** The Context for the SchemaView */
     public static final String CONTEXT_SCHEMA_VIEW = Activator.PLUGIN_ID + ".contexts.schemaView";
//$NON-NLS-1$
     /** The Context for the SchemaView */
     public static final String CONTEXT_PROJECTS_VIEW = Activator.PLUGIN_ID + ".contexts.projectsView";
//$NON-NLS-1$
+
+    // File Dialogs
+    /** The File Dialog path for 'Export Schema Projects' */
+    public static final String FILE_DIALOG_EXPORT_PROJECTS = Activator.PLUGIN_ID + ".fileDialog.exportProjects";
+    /** The File Dialog path for 'Export Schemas to OpenLDAP files' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP = Activator.PLUGIN_ID
+        + ".fileDialog.exportSchemasOpenLDAP";
+    /** The File Dialog path for 'Export Schemas to XML files' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_XML = Activator.PLUGIN_ID + ".fileDialog.exportSchemasXML";
+    /** The File Dialog path for 'Export Schemas for Apache DS' */
+    public static final String FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS = Activator.PLUGIN_ID
+        + ".fileDialog.exportSchemasApacheDS";
+    /** The File Dialog path for 'Import Schema Projects' */
+    public static final String FILE_DIALOG_IMPORT_PROJECTS = Activator.PLUGIN_ID + ".fileDialog.importProjects";
+    /** The File Dialog path for 'Import Schemas from OpenLDAP files' */
+    public static final String FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP = Activator.PLUGIN_ID
+        + ".fileDialog.importSchemasOpenLDAP";
+    /** The File Dialog path for 'Import Schemas from XML files' */
+    public static final String FILE_DIALOG_IMPORT_SCHEMAS_XML = Activator.PLUGIN_ID + ".fileDialog.importSchemasXML";
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/PreferenceInitializer.java
Mon Dec 17 05:01:32 2007
@@ -92,5 +92,14 @@
             PluginConstants.PREFS_SEARCH_VIEW_SORTING_BY_FIRSTNAME );
         store.setDefault( PluginConstants.PREFS_SEARCH_VIEW_SORTING_ORDER,
             PluginConstants.PREFS_SEARCH_VIEW_SORTING_ORDER_ASCENDING );
+
+        // File Dialogs
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_PROJECTS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_PROJECTS, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
     }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizard.java
Mon Dec 17 05:01:32 2007
@@ -77,8 +77,11 @@
      */
     public boolean performFinish()
     {
-        final Project[] selectedProjects = page.getSelectedProjects();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the projects to be exported and where to export them
+        final Project[] selectedProjects = page.getSelectedProjects();
         final String exportDirectory = page.getExportDirectory();
         try
         {

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportProjectsWizardPage.java
Mon Dec 17 05:01:32 2007
@@ -254,6 +254,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_PROJECTS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -361,5 +370,15 @@
     public String getExportDirectory()
     {
         return exportDirectoryText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_PROJECTS,
+            exportDirectoryText.getText() );
     }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
Mon Dec 17 05:01:32 2007
@@ -74,8 +74,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         final String exportDirectory = page.getExportDirectory();
         try
         {

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=604860&r1=604859&r2=604860&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
Mon Dec 17 05:01:32 2007
@@ -254,6 +254,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -361,5 +370,15 @@
     public String getExportDirectory()
     {
         return exportDirectoryText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_OPENLDAP,
+            exportDirectoryText.getText() );
     }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
Mon Dec 17 05:01:32 2007
@@ -74,8 +74,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         int exportType = page.getExportType();
         if ( exportType == ExportSchemasAsXmlWizardPage.EXPORT_MULTIPLE_FILES )
         {

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=604860&r1=604859&r2=604860&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
Mon Dec 17 05:01:32 2007
@@ -353,6 +353,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportMultipleFilesText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportMultipleFilesText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -373,7 +382,15 @@
             { "*.xml", "*" } );
         dialog.setFilterNames( new String[]
             { "XML Files", "All Files" } );
-        dialog.setFilterPath( exportSingleFileText.getText() );
+        if ( "".equals( exportSingleFileText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportSingleFileText.getText() );
+        }
 
         String selectedFile = dialog.open();
         if ( selectedFile != null )
@@ -538,5 +555,23 @@
     public String getExportFile()
     {
         return exportSingleFileText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        if ( exportMultipleFilesRadio.getSelection() )
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML,
+                exportMultipleFilesText.getText() );
+        }
+        else
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_XML,
+                new File( exportSingleFileText.getText() ).getParent() );
+        }
     }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
Mon Dec 17 05:01:32 2007
@@ -86,8 +86,11 @@
      */
     public boolean performFinish()
     {
-        final Schema[] selectedSchemas = page.getSelectedSchemas();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be exported and where to export them
+        final Schema[] selectedSchemas = page.getSelectedSchemas();
         int exportType = page.getExportType();
         if ( exportType == ExportSchemasAsXmlWizardPage.EXPORT_MULTIPLE_FILES )
         {

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=604860&r1=604859&r2=604860&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
Mon Dec 17 05:01:32 2007
@@ -353,6 +353,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder in which export the files." );
+        if ( "".equals( exportMultipleFilesText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportMultipleFilesText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -373,7 +382,15 @@
             { "*.ldif", "*" } );
         dialog.setFilterNames( new String[]
             { "LDIF Files", "All Files" } );
-        dialog.setFilterPath( exportSingleFileText.getText() );
+        if ( "".equals( exportSingleFileText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( exportSingleFileText.getText() );
+        }
 
         String selectedFile = dialog.open();
         if ( selectedFile != null )
@@ -538,5 +555,23 @@
     public String getExportFile()
     {
         return exportSingleFileText.getText();
+    }
+
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        if ( exportMultipleFilesRadio.getSelection() )
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS,
+                exportMultipleFilesText.getText() );
+        }
+        else
+        {
+            Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_EXPORT_SCHEMAS_APACHE_DS,
+                new File( exportSingleFileText.getText() ).getParent() );
+        }
     }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
Mon Dec 17 05:01:32 2007
@@ -73,8 +73,11 @@
      */
     public boolean performFinish()
     {
-        final File[] selectedProjectFiles = page.getSelectedProjectFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the projects to be imported
+        final File[] selectedProjectFiles = page.getSelectedProjectFiles();
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizardPage.java
Mon Dec 17 05:01:32 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_PROJECTS ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new File[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_PROJECTS,
+            fromDirectoryText.getText() );
+    }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
Mon Dec 17 05:01:32 2007
@@ -77,8 +77,11 @@
      */
     public boolean performFinish()
     {
-        final File[] selectedSchemasFiles = page.getSelectedSchemaFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be imported
+        final File[] selectedSchemasFiles = page.getSelectedSchemaFiles();
         schemaChecker.disableModificationsListening();
 
         try

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=604860&r1=604859&r2=604860&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
Mon Dec 17 05:01:32 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -260,7 +269,7 @@
      */
     private void dialogChanged()
     {
-        // Export Directory
+        // Import Directory
         String directory = fromDirectoryText.getText();
         if ( ( directory == null ) || ( directory.equals( "" ) ) )
         {
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new File[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_OPENLDAP,
+            fromDirectoryText.getText() );
+    }
 }

Modified: directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java?rev=604860&r1=604859&r2=604860&view=diff
==============================================================================
--- directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
(original)
+++ directory/studio/trunk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
Mon Dec 17 05:01:32 2007
@@ -78,10 +78,12 @@
      */
     public boolean performFinish()
     {
-        final String[] selectedSchemasFiles = page.getSelectedSchemaFiles();
+        // Saving the dialog settings
+        page.saveDialogSettings();
 
+        // Getting the schemas to be imported
+        final String[] selectedSchemasFiles = page.getSelectedSchemaFiles();
         schemaChecker.disableModificationsListening();
-
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()

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=604860&r1=604859&r2=604860&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
Mon Dec 17 05:01:32 2007
@@ -219,6 +219,15 @@
         DirectoryDialog dialog = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
);
         dialog.setText( "Choose Folder" );
         dialog.setMessage( "Select the folder from which import the files." );
+        if ( "".equals( fromDirectoryText.getText() ) )
+        {
+            dialog.setFilterPath( Activator.getDefault().getPreferenceStore().getString(
+                PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML ) );
+        }
+        else
+        {
+            dialog.setFilterPath( fromDirectoryText.getText() );
+        }
 
         String selectedDirectory = dialog.open();
         if ( selectedDirectory != null )
@@ -331,4 +340,13 @@
         return schemaFiles.toArray( new String[0] );
     }
 
+
+    /**
+     * Saves the dialog settings.
+     */
+    public void saveDialogSettings()
+    {
+        Activator.getDefault().getPreferenceStore().putValue( PluginConstants.FILE_DIALOG_IMPORT_SCHEMAS_XML,
+            fromDirectoryText.getText() );
+    }
 }



Mime
View raw message