directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r570183 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor: controller/ controller/actions/ view/widget/ view/wizards/
Date Mon, 27 Aug 2007 17:00:08 GMT
Author: pamarcelot
Date: Mon Aug 27 10:00:07 2007
New Revision: 570183

URL: http://svn.apache.org/viewvc?rev=570183&view=rev
Log:
Updated the CommitChanges Action and Wizard.

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/SchemaViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CommitChangesAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/widget/DifferencesWidget.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/CommitChangesDifferencesWizardPage.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?rev=570183&r1=570182&r2=570183&view=diff
==============================================================================
--- 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
Mon Aug 27 10:00:07 2007
@@ -22,7 +22,6 @@
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CloseProjectAction;
-import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CommitChangesAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.DeleteProjectAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ExportProjectsAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ImportProjectsAction;
@@ -77,7 +76,6 @@
     private DeleteProjectAction deleteProject;
     private ImportProjectsAction importProjects;
     private ExportProjectsAction exportProjects;
-    private CommitChangesAction commitChanges;
 
 
     /**
@@ -113,7 +111,6 @@
         deleteProject = new DeleteProjectAction( view.getViewer() );
         importProjects = new ImportProjectsAction();
         exportProjects = new ExportProjectsAction( view.getViewer() );
-        commitChanges = new CommitChangesAction();
     }
 
 
@@ -124,7 +121,6 @@
     {
         IToolBarManager toolbar = view.getViewSite().getActionBars().getToolBarManager();
         toolbar.add( newProject );
-        toolbar.add( commitChanges );
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java?rev=570183&r1=570182&r2=570183&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
Mon Aug 27 10:00:07 2007
@@ -27,6 +27,7 @@
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CollapseAllAction;
+import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CommitChangesAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.DeleteSchemaElementAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ExportSchemasAsOpenLdapAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ExportSchemasAsXmlAction;
@@ -356,6 +357,7 @@
     private OpenSchemaViewSortingDialogAction openSchemaViewSortingDialog;
     private OpenSchemaViewPreferenceAction openSchemaViewPreference;
     private LinkWithEditorSchemaViewAction linkWithEditor;
+    private CommitChangesAction commitChanges;
 
 
     /**
@@ -401,6 +403,7 @@
         openSchemaViewSortingDialog = new OpenSchemaViewSortingDialogAction();
         openSchemaViewPreference = new OpenSchemaViewPreferenceAction();
         linkWithEditor = new LinkWithEditorSchemaViewAction( view );
+        commitChanges = new CommitChangesAction();
     }
 
 
@@ -414,6 +417,8 @@
         toolbar.add( newAttributeType );
         toolbar.add( newObjectClass );
         toolbar.add( new Separator() );
+        toolbar.add( commitChanges );
+        toolbar.add( new Separator() );
         toolbar.add( collapseAll );
         toolbar.add( linkWithEditor );
     }
@@ -502,6 +507,7 @@
                     linkWithEditor.setEnabled( true );
                     openSchemaViewSortingDialog.setEnabled( true );
                     openSchemaViewPreference.setEnabled( true );
+                    commitChanges.setEnabled( true );
 
                     addSchemaHandlerListener( newProject );
                     view.reloadViewer();
@@ -517,6 +523,7 @@
                     linkWithEditor.setEnabled( false );
                     openSchemaViewSortingDialog.setEnabled( false );
                     openSchemaViewPreference.setEnabled( false );
+                    commitChanges.setEnabled( false );
                 }
             }
         } );
@@ -828,6 +835,7 @@
             linkWithEditor.setEnabled( true );
             openSchemaViewSortingDialog.setEnabled( true );
             openSchemaViewPreference.setEnabled( true );
+            commitChanges.setEnabled( true );
 
             addSchemaHandlerListener( project );
             view.reloadViewer();
@@ -842,6 +850,7 @@
             linkWithEditor.setEnabled( false );
             openSchemaViewSortingDialog.setEnabled( false );
             openSchemaViewPreference.setEnabled( false );
+            commitChanges.setEnabled( false );
         }
     }
 }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CommitChangesAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CommitChangesAction.java?rev=570183&r1=570182&r2=570183&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CommitChangesAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/CommitChangesAction.java
Mon Aug 27 10:00:07 2007
@@ -52,7 +52,7 @@
         setId( PluginConstants.CMD_COMMIT_CHANGES );
         setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
             PluginConstants.IMG_COMMIT_CHANGES ) );
-        setEnabled( true );
+        setEnabled( false );
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/widget/DifferencesWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/widget/DifferencesWidget.java?rev=570183&r1=570182&r2=570183&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/widget/DifferencesWidget.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/widget/DifferencesWidget.java
Mon Aug 27 10:00:07 2007
@@ -187,7 +187,9 @@
 
         // TreeViewer
         treeViewer = new TreeViewer( leftComposite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL
| SWT.BORDER );
-        treeViewer.getTree().setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true
) );
+        GridData gridData = new GridData( SWT.FILL, SWT.FILL, true, true );
+        gridData.heightHint = 250;
+        treeViewer.getTree().setLayoutData( gridData );
         treeViewer.setContentProvider( new DifferencesWidgetSchemaContentProvider() );
         treeViewer.setLabelProvider( new DifferencesWidgetSchemaLabelProvider() );
         treeViewer.addSelectionChangedListener( new ISelectionChangedListener()

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/CommitChangesDifferencesWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/CommitChangesDifferencesWizardPage.java?rev=570183&r1=570182&r2=570183&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/CommitChangesDifferencesWizardPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/CommitChangesDifferencesWizardPage.java
Mon Aug 27 10:00:07 2007
@@ -20,15 +20,9 @@
 package org.apache.directory.studio.apacheds.schemaeditor.view.wizards;
 
 
-import java.util.ArrayList;
-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.AttributeTypeImpl;
-import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
-import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
-import org.apache.directory.studio.apacheds.schemaeditor.model.SchemaImpl;
+import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.model.difference.DifferenceEngine;
 import org.apache.directory.studio.apacheds.schemaeditor.view.widget.DifferencesWidget;
 import org.eclipse.jface.wizard.WizardPage;
@@ -78,57 +72,10 @@
         differencesWidget = new DifferencesWidget();
         differencesWidget.createWidget( composite );
 
-        SchemaImpl schema1Old = new SchemaImpl( "Schema1" );
-        SchemaImpl schema1New = new SchemaImpl( "Schema1" );
-        SchemaImpl schema2 = new SchemaImpl( "Schema2" );
-        SchemaImpl schema3 = new SchemaImpl( "Schema3" );
-        SchemaImpl schema4 = new SchemaImpl( "Schema4" );
-
-        List<Schema> schemasListOld = new ArrayList<Schema>();
-        schemasListOld.add( schema1Old );
-        schemasListOld.add( schema2 );
-        schemasListOld.add( schema4 );
-
-        List<Schema> schemasListNew = new ArrayList<Schema>();
-        schemasListNew.add( schema4 );
-        schemasListNew.add( schema1New );
-        schemasListNew.add( schema3 );
-
-        AttributeTypeImpl at1 = new AttributeTypeImpl( "1.2.1" );
-        at1.setNames( new String[]
-            { "AT1", "AttributeType1" } );
-        AttributeTypeImpl at2 = new AttributeTypeImpl( "1.2.2" );
-        at2.setNames( new String[]
-            { "AT2", "AttributeType2" } );
-        AttributeTypeImpl at2Bis = new AttributeTypeImpl( "1.2.2" );
-        at2Bis.setNames( new String[]
-            { "AT2" } );
-        AttributeTypeImpl at3 = new AttributeTypeImpl( "1.2.3" );
-        at3.setNames( new String[]
-            { "AT3" } );
-        schema1Old.addAttributeType( at1 );
-        schema1Old.addAttributeType( at2 );
-        schema1New.addAttributeType( at2Bis );
-        schema1New.addAttributeType( at3 );
-
-        ObjectClassImpl oc1 = new ObjectClassImpl( "1.2.10" );
-        oc1.setNames( new String[]
-            { "OC1", "ObjectClass1" } );
-        ObjectClassImpl oc2 = new ObjectClassImpl( "1.2.11" );
-        oc2.setNames( new String[]
-            { "OC2", "ObjectClass2" } );
-        ObjectClassImpl oc2Bis = new ObjectClassImpl( "1.2.11" );
-        oc2Bis.setNames( new String[]
-            { "OC2" } );
-        ObjectClassImpl oc3 = new ObjectClassImpl( "1.2.12" );
-        oc3.setNames( new String[]
-            { "OC3" } );
-        schema1Old.addObjectClass( oc1 );
-        schema1Old.addObjectClass( oc2 );
-        schema1New.addObjectClass( oc2Bis );
-        schema1New.addObjectClass( oc3 );
+        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();
 
-        differencesWidget.setInput( DifferenceEngine.getDifferences( schemasListOld, schemasListNew
) );
+        differencesWidget.setInput( DifferenceEngine.getDifferences( project.getSchemaBackup(),
project
+            .getSchemaHandler().getSchemas() ) );
 
         initFields();
 



Mime
View raw message