directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r557309 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor: controller/ controller/actions/ view/wizards/
Date Wed, 18 Jul 2007 16:04:19 GMT
Author: pamarcelot
Date: Wed Jul 18 09:04:16 2007
New Revision: 557309

URL: http://svn.apache.org/viewvc?view=rev&rev=557309
Log:
Improved the ExportProjectsAction to pre-select in the wizard the projects selected in the
ProjectsView.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProjectsViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CloseProjectAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/ExportProjectsAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenProjectAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/RenameProjectAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizardPage.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProjectsViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProjectsViewController.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProjectsViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProjectsViewController.java
Wed Jul 18 09:04:16 2007
@@ -105,12 +105,12 @@
     private void initActions()
     {
         newProject = new NewProjectAction();
-        openProject = new OpenProjectAction( view );
-        closeProject = new CloseProjectAction( view );
-        renameProject = new RenameProjectAction( view );
-        deleteProject = new DeleteProjectAction( view );
+        openProject = new OpenProjectAction( view.getViewer() );
+        closeProject = new CloseProjectAction( view.getViewer() );
+        renameProject = new RenameProjectAction( view.getViewer() );
+        deleteProject = new DeleteProjectAction( view.getViewer() );
         importProjects = new ImportProjectsAction();
-        exportProjects = new ExportProjectsAction();
+        exportProjects = new ExportProjectsAction( view.getViewer() );
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CloseProjectAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CloseProjectAction.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CloseProjectAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CloseProjectAction.java
Wed Jul 18 09:04:16 2007
@@ -24,7 +24,6 @@
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project.ProjectState;
-import org.apache.directory.studio.apacheds.schemaeditor.view.views.ProjectsView;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -32,6 +31,7 @@
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 
@@ -44,8 +44,8 @@
  */
 public class CloseProjectAction extends Action implements IWorkbenchWindowActionDelegate
 {
-    /** The associated view */
-    private ProjectsView view;
+    /** The associated viewer */
+    private TableViewer viewer;
 
     /** The ProjectsHandler */
     private ProjectsHandler projectsHandler;
@@ -57,14 +57,14 @@
      * @param view
      *      the associate view
      */
-    public CloseProjectAction( ProjectsView view )
+    public CloseProjectAction( TableViewer viewer )
     {
         super( "Close Project" );
         setToolTipText( getText() );
         setId( PluginConstants.CMD_CLOSE_PROJECT );
         setEnabled( false );
-        this.view = view;
-        this.view.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
+        this.viewer = viewer;
+        this.viewer.addSelectionChangedListener( new ISelectionChangedListener()
         {
             public void selectionChanged( SelectionChangedEvent event )
             {
@@ -89,7 +89,7 @@
      */
     public void run()
     {
-        StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
         if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
         {
             projectsHandler.closeProject( ( ( ProjectWrapper ) selection.getFirstElement()
).getProject() );

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
Wed Jul 18 09:04:16 2007
@@ -25,7 +25,6 @@
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
-import org.apache.directory.studio.apacheds.schemaeditor.view.views.ProjectsView;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -33,6 +32,7 @@
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -49,8 +49,8 @@
  */
 public class DeleteProjectAction extends Action implements IWorkbenchWindowActionDelegate
 {
-    /** The associated view */
-    private ProjectsView view;
+    /** The associated viewer */
+    private TableViewer viewer;
 
 
     /**
@@ -59,7 +59,7 @@
      * @param view
      *      the associated view
      */
-    public DeleteProjectAction( ProjectsView view )
+    public DeleteProjectAction( TableViewer viewer )
     {
         super( "Delete Project" );
         setToolTipText( getText() );
@@ -67,8 +67,8 @@
         setImageDescriptor( AbstractUIPlugin
             .imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_DELETE )
);
         setEnabled( false );
-        this.view = view;
-        this.view.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
+        this.viewer = viewer;
+        this.viewer.addSelectionChangedListener( new ISelectionChangedListener()
         {
             public void selectionChanged( SelectionChangedEvent event )
             {
@@ -100,7 +100,7 @@
     public void run()
     {
         ProjectsHandler projectsHandler = Activator.getDefault().getProjectsHandler();
-        StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
 
         if ( !selection.isEmpty() )
         {

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/ExportProjectsAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/ExportProjectsAction.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/ExportProjectsAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/ExportProjectsAction.java
Wed Jul 18 09:04:16 2007
@@ -20,13 +20,20 @@
 package org.apache.directory.studio.apacheds.schemaeditor.controller.actions;
 
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wizards.ExportProjectsWizard;
+import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
@@ -42,10 +49,14 @@
  */
 public class ExportProjectsAction extends Action implements IWorkbenchWindowActionDelegate
 {
+    /** The associated viewer */
+    private TableViewer viewer;
+
+
     /**
      * Creates a new instance of NewProjectAction.
      */
-    public ExportProjectsAction()
+    public ExportProjectsAction( TableViewer viewer )
     {
         super( "Schema Projects" );
         setToolTipText( getText() );
@@ -53,6 +64,7 @@
         setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
             PluginConstants.IMG_PROJECT_EXPORT ) );
         setEnabled( true );
+        this.viewer = viewer;
     }
 
 
@@ -61,8 +73,20 @@
      */
     public void run()
     {
+        List<Project> selectedProjects = new ArrayList<Project>();
+        // Getting the selection
+        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
+        if ( ( !selection.isEmpty() ) && ( selection.size() > 0 ) )
+        {
+            for ( Iterator<?> i = selection.iterator(); i.hasNext(); )
+            {
+                selectedProjects.add( ( ( ProjectWrapper ) i.next() ).getProject() );
+            }
+        }
+
         // Instantiates and initializes the wizard
         ExportProjectsWizard wizard = new ExportProjectsWizard();
+        wizard.setSelectedProjects( selectedProjects.toArray( new Project[0] ) );
         wizard.init( PlatformUI.getWorkbench(), StructuredSelection.EMPTY );
         // Instantiates the wizard container with the wizard and opens it
         WizardDialog dialog = new WizardDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
wizard );

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenProjectAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenProjectAction.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenProjectAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenProjectAction.java
Wed Jul 18 09:04:16 2007
@@ -24,7 +24,6 @@
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project.ProjectState;
-import org.apache.directory.studio.apacheds.schemaeditor.view.views.ProjectsView;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -32,6 +31,7 @@
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 
@@ -44,8 +44,8 @@
  */
 public class OpenProjectAction extends Action implements IWorkbenchWindowActionDelegate
 {
-    /** The associated view */
-    private ProjectsView view;
+    /** The associated viewer */
+    private TableViewer viewer;
 
     /** The ProjectsHandler */
     private ProjectsHandler projectsHandler;
@@ -57,14 +57,14 @@
      * @param view
      *      the associate view
      */
-    public OpenProjectAction( ProjectsView view )
+    public OpenProjectAction( TableViewer viewer )
     {
         super( "Open Project" );
         setToolTipText( getText() );
         setId( PluginConstants.CMD_OPEN_PROJECT );
         setEnabled( false );
-        this.view = view;
-        this.view.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
+        this.viewer = viewer;
+        this.viewer.addSelectionChangedListener( new ISelectionChangedListener()
         {
             public void selectionChanged( SelectionChangedEvent event )
             {
@@ -89,7 +89,7 @@
      */
     public void run()
     {
-        StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
         if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
         {
             projectsHandler.openProject( ( ( ProjectWrapper ) selection.getFirstElement()
).getProject() );

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/RenameProjectAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/RenameProjectAction.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/RenameProjectAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/RenameProjectAction.java
Wed Jul 18 09:04:16 2007
@@ -25,7 +25,6 @@
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.view.dialogs.RenameProjectDialog;
-import org.apache.directory.studio.apacheds.schemaeditor.view.views.ProjectsView;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -34,6 +33,7 @@
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -47,8 +47,8 @@
  */
 public class RenameProjectAction extends Action implements IWorkbenchWindowActionDelegate
 {
-    /** The associated view */
-    private ProjectsView view;
+    /** The associated viewer */
+    private TableViewer viewer;
 
     /** The ProjectsHandler */
     private ProjectsHandler projectsHandler;
@@ -60,7 +60,7 @@
      * @param view
      *      the associate view
      */
-    public RenameProjectAction( ProjectsView view )
+    public RenameProjectAction( TableViewer viewer)
     {
         super( "Rename Project..." );
         setToolTipText( getText() );
@@ -68,8 +68,8 @@
         setImageDescriptor( AbstractUIPlugin
             .imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_RENAME )
);
         setEnabled( false );
-        this.view = view;
-        this.view.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
+        this.viewer = viewer;
+        this.viewer.addSelectionChangedListener( new ISelectionChangedListener()
         {
             public void selectionChanged( SelectionChangedEvent event )
             {
@@ -86,7 +86,7 @@
      */
     public void run()
     {
-        StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
         if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
         {
             Project project = ( ( ProjectWrapper ) selection.getFirstElement() ).getProject();

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
Wed Jul 18 09:04:16 2007
@@ -43,6 +43,9 @@
  */
 public class ExportProjectsWizard extends Wizard implements IExportWizard
 {
+    /** The selected projects */
+    private Project[] selectedProjects = new Project[0];
+
     // The pages of the wizard
     private ExportProjectsWizardPage page;
 
@@ -54,6 +57,7 @@
     {
         // Creating pages
         page = new ExportProjectsWizardPage();
+        page.setSelectedProjects( selectedProjects );
 
         // Adding pages
         addPage( page );
@@ -107,6 +111,18 @@
         }
 
         return true;
+    }
+
+
+    /**
+     * Sets the selected projects.
+     *
+     * @param projects
+     *      the projects
+     */
+    public void setSelectedProjects( Project[] projects )
+    {
+        selectedProjects = projects;
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizardPage.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizardPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizardPage.java
Wed Jul 18 09:04:16 2007
@@ -22,6 +22,8 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
@@ -64,6 +66,9 @@
  */
 public class ExportProjectsWizardPage extends WizardPage
 {
+    /** The selected projects */
+    private Project[] selectedProjects = new Project[0];
+
     // UI Fields
     private CheckboxTableViewer projectsTableViewer;
     private Button projectsTableSelectAllButton;
@@ -221,7 +226,20 @@
     private void initFields()
     {
         // Filling the Schemas table
-        projectsTableViewer.setInput( Activator.getDefault().getProjectsHandler().getProjects()
);
+        List<Project> projects = new ArrayList<Project>();
+        projects.addAll( Activator.getDefault().getProjectsHandler().getProjects() );
+        Collections.sort( projects, new Comparator<Project>()
+        {
+            public int compare( Project o1, Project o2 )
+            {
+                return o1.getName().compareToIgnoreCase( o2.getName() );
+            }
+
+        } );
+        projectsTableViewer.setInput( projects );
+
+        // Setting the selected projects
+        projectsTableViewer.setCheckedElements( selectedProjects );
 
         displayErrorMessage( null );
         setPageComplete( false );
@@ -319,6 +337,18 @@
         }
 
         return schemas.toArray( new Project[0] );
+    }
+
+
+    /**
+     * Sets the selected projects.
+     *
+     * @param projects
+     *      the projects
+     */
+    public void setSelectedProjects( Project[] projects )
+    {
+        selectedProjects = projects;
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizardPage.java
Wed Jul 18 09:04:16 2007
@@ -22,6 +22,8 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
@@ -217,7 +219,22 @@
     private void initFields()
     {
         // Filling the Schemas table
-        schemasTableViewer.setInput( schemaHandler.getSchemas() );
+        if ( schemaHandler != null )
+        {
+            List<Schema> schemas = new ArrayList<Schema>();
+            schemas.addAll( schemaHandler.getSchemas() );
+
+            Collections.sort( schemas, new Comparator<Schema>()
+            {
+                public int compare( Schema o1, Schema o2 )
+                {
+                    return o1.getName().compareToIgnoreCase( o2.getName() );
+                }
+
+            } );
+
+            schemasTableViewer.setInput( schemas );
+        }
 
         displayErrorMessage( null );
         setPageComplete( false );

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java?view=diff&rev=557309&r1=557308&r2=557309
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizardPage.java
Wed Jul 18 09:04:16 2007
@@ -22,6 +22,8 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
@@ -279,7 +281,22 @@
     private void initFields()
     {
         // Filling the Schemas table
-        schemasTableViewer.setInput( schemaHandler.getSchemas() );
+        if ( schemaHandler != null )
+        {
+            List<Schema> schemas = new ArrayList<Schema>();
+            schemas.addAll( schemaHandler.getSchemas() );
+
+            Collections.sort( schemas, new Comparator<Schema>()
+            {
+                public int compare( Schema o1, Schema o2 )
+                {
+                    return o1.getName().compareToIgnoreCase( o2.getName() );
+                }
+
+            } );
+
+            schemasTableViewer.setInput( schemas );
+        }
 
         // Selecting the Multiple Files choice
         exportMultipleFilesSelected();



Mime
View raw message