directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1214197 - in /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor: controller/actions/ view/dialogs/ view/editors/attributetype/ view/editors/objectclass/ view/wizards/
Date Wed, 14 Dec 2011 12:07:36 GMT
Author: pamarcelot
Date: Wed Dec 14 12:07:36 2011
New Revision: 1214197

URL: http://svn.apache.org/viewvc?rev=1214197&view=rev
Log:
Part of a fix for DIRSTUDIO-446 (Allow the user to rename any item using the F2 shortcut).

Added:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AbstractAliasesDialog.java
      - copied, changed from r1214134, directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAliasesDialog.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAttributeTypeAliasesDialog.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditObjectClassAliasesDialog.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameAttributeTypeDialog.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameObjectClassDialog.java
Removed:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAliasesDialog.java
Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_de.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_fr.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/RenameSchemaElementAction.java
Wed Dec 14 12:07:36 2011
@@ -26,7 +26,8 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.PluginConstants;
 import org.apache.directory.studio.schemaeditor.PluginUtils;
 import org.apache.directory.studio.schemaeditor.model.Schema;
-import org.apache.directory.studio.schemaeditor.view.dialogs.EditAliasesDialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.RenameAttributeTypeDialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.RenameObjectClassDialog;
 import org.apache.directory.studio.schemaeditor.view.dialogs.RenameSchemaDialog;
 import org.apache.directory.studio.schemaeditor.view.editors.EditorsUtils;
 import org.apache.directory.studio.schemaeditor.view.wrappers.AttributeTypeWrapper;
@@ -112,8 +113,8 @@ public class RenameSchemaElementAction e
                 {
                     AttributeType attributeType = ( ( AttributeTypeWrapper ) selectedElement
).getAttributeType();
 
-                    EditAliasesDialog dialog = new EditAliasesDialog( attributeType.getNames()
);
-                    if ( dialog.open() == EditAliasesDialog.OK )
+                    RenameAttributeTypeDialog dialog = new RenameAttributeTypeDialog( attributeType.getNames()
);
+                    if ( dialog.open() == RenameAttributeTypeDialog.OK )
                     {
                         AttributeType modifiedAttributeType = PluginUtils.getClone( attributeType
);
                         modifiedAttributeType.setNames( dialog.getAliases() );
@@ -126,8 +127,8 @@ public class RenameSchemaElementAction e
                 {
                     ObjectClass objectClass = ( ( ObjectClassWrapper ) selectedElement ).getObjectClass();
 
-                    EditAliasesDialog dialog = new EditAliasesDialog( objectClass.getNames()
);
-                    if ( dialog.open() == EditAliasesDialog.OK )
+                    RenameObjectClassDialog dialog = new RenameObjectClassDialog( objectClass.getNames()
);
+                    if ( dialog.open() == RenameObjectClassDialog.OK )
                     {
                         ObjectClass modifiedObjectClass = PluginUtils.getClone( objectClass
);
                         modifiedObjectClass.setNames( dialog.getAliases() );

Copied: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AbstractAliasesDialog.java
(from r1214134, directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAliasesDialog.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AbstractAliasesDialog.java?p2=directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AbstractAliasesDialog.java&p1=directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAliasesDialog.java&r1=1214134&r2=1214197&rev=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAliasesDialog.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AbstractAliasesDialog.java
Wed Dec 14 12:07:36 2011
@@ -58,20 +58,17 @@ import org.eclipse.ui.PlatformUI;
 
 
 /**
- * This class implements the Manage Aliases Dialog.
+ * This class implements dialog to manage aliases.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EditAliasesDialog extends Dialog
+public abstract class AbstractAliasesDialog extends Dialog
 {
     /** The aliases List */
     private List<String> initialLowerCasedAliases = new ArrayList<String>();
-    private List<String> aliases =new ArrayList<String>();
+    private List<String> aliases = new ArrayList<String>();
     private List<String> lowerCasedAliases = new ArrayList<String>();
 
-    /** The dirty flag */
-    private boolean dirty = false;
-
     /** The listener used to override the listerner on the RETURN key */
     private Listener returnKeyListener = new Listener()
     {
@@ -97,12 +94,11 @@ public class EditAliasesDialog extends D
 
 
     /**
-     * Creates a new instance of EditAliasesDialog.
+     * Creates a new instance of AbstractAliasesDialog.
      *
-     * @param aliases
-     *      an array containing the aliases
+     * @param aliases an array of aliases
      */
-    public EditAliasesDialog( List<String> aliases )
+    public AbstractAliasesDialog( List<String> aliases )
     {
         super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() );
         if ( aliases != null )
@@ -129,7 +125,7 @@ public class EditAliasesDialog extends D
 
         // Aliases Label
         Label aliasesLabel = new Label( composite, SWT.NONE );
-        aliasesLabel.setText( Messages.getString( "EditAliasesDialog.Aliases" ) ); //$NON-NLS-1$
+        aliasesLabel.setText( Messages.getString( "AbstractAliasesDialog.Aliases" ) ); //$NON-NLS-1$
         aliasesLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, true, 2, 1 )
);
 
         // Aliases Table
@@ -150,18 +146,18 @@ public class EditAliasesDialog extends D
 
         // Add Button
         addButton = new Button( composite, SWT.PUSH );
-        addButton.setText( Messages.getString( "EditAliasesDialog.Add" ) ); //$NON-NLS-1$
+        addButton.setText( Messages.getString( "AbstractAliasesDialog.Add" ) ); //$NON-NLS-1$
         addButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) );
 
         // Edit Button
         editButton = new Button( composite, SWT.PUSH );
-        editButton.setText( Messages.getString( "EditAliasesDialog.Edit" ) ); //$NON-NLS-1$
+        editButton.setText( Messages.getString( "AbstractAliasesDialog.Edit" ) ); //$NON-NLS-1$
         editButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) );
         editButton.setEnabled( false );
 
         // Remove Button
         removeButton = new Button( composite, SWT.PUSH );
-        removeButton.setText( Messages.getString( "EditAliasesDialog.Remove" ) ); //$NON-NLS-1$
+        removeButton.setText( Messages.getString( "AbstractAliasesDialog.Remove" ) ); //$NON-NLS-1$
         removeButton.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false ) );
         removeButton.setEnabled( false );
 
@@ -180,7 +176,7 @@ public class EditAliasesDialog extends D
         // Error Label
         errorLabel = new Label( errorComposite, SWT.NONE );
         errorLabel.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
-        errorLabel.setText( Messages.getString( "EditAliasesDialog.ElementWithSameAliasExists"
) ); //$NON-NLS-1$
+        errorLabel.setText( getAliasAlreadyExistsErrorMessage() );
 
         // Filling the Table with the given aliases
         fillAliasesTable();
@@ -248,7 +244,7 @@ public class EditAliasesDialog extends D
         Menu menu = new Menu( getShell(), SWT.POP_UP );
         aliasesTable.setMenu( menu );
         MenuItem removeMenuItem = new MenuItem( menu, SWT.PUSH );
-        removeMenuItem.setText( Messages.getString( "EditAliasesDialog.Remove" ) ); //$NON-NLS-1$
+        removeMenuItem.setText( Messages.getString( "AbstractAliasesDialog.Remove" ) ); //$NON-NLS-1$
         removeMenuItem.setImage( PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_TOOL_DELETE
) );
         removeMenuItem.addListener( SWT.Selection, new Listener()
         {
@@ -322,7 +318,6 @@ public class EditAliasesDialog extends D
             aliases.remove( item.getText() );
             lowerCasedAliases.remove( Strings.toLowerCase( item.getText() ) );
         }
-        dirty = true;
     }
 
 
@@ -334,7 +329,6 @@ public class EditAliasesDialog extends D
         TableItem item = new TableItem( aliasesTable, SWT.NONE );
         item.setText( "" ); //$NON-NLS-1$
         openTableEditor( item );
-        dirty = true;
     }
 
 
@@ -402,7 +396,6 @@ public class EditAliasesDialog extends D
                     lowerCasedAliases.add( Strings.toLowerCase( newText ) );
                 }
                 item.setText( newText );
-                dirty = true;
             }
         }
         checkAliases();
@@ -433,17 +426,19 @@ public class EditAliasesDialog extends D
 
         for ( String alias : aliases )
         {
-            if ( ( Activator.getDefault().getSchemaHandler().isAliasOrOidAlreadyTaken( alias
) )
+            if ( ( isAliasAlreadyTaken( alias ) )
                 && ( !initialLowerCasedAliases.contains( Strings.toLowerCase( alias
) ) ) )
             {
                 errorComposite.setVisible( true );
-                errorLabel.setText( Messages.getString( "EditAliasesDialog.ElementWithSameAliasExists"
) ); //$NON-NLS-1$
+                errorLabel.setText( getAliasAlreadyExistsErrorMessage() );
+                return;
             }
             else if ( !PluginUtils.verifyName( alias ) )
             {
                 errorComposite.setVisible( true );
-                errorLabel.setText( NLS.bind( Messages.getString( "EditAliasesDialog.TheAliasBegin"
), new String[] //$NON-NLS-1$
+                errorLabel.setText( NLS.bind( Messages.getString( "AbstractAliasesDialog.InvalidAlias"
), new String[] //$NON-NLS-1$
                     { alias } ) );
+                return;
             }
         }
     }
@@ -455,7 +450,7 @@ public class EditAliasesDialog extends D
     protected void configureShell( Shell newShell )
     {
         super.configureShell( newShell );
-        newShell.setText( Messages.getString( "EditAliasesDialog.EditAlias" ) ); //$NON-NLS-1$
+        newShell.setText( Messages.getString( "AbstractAliasesDialog.EditAlias" ) ); //$NON-NLS-1$
     }
 
 
@@ -470,15 +465,20 @@ public class EditAliasesDialog extends D
         return aliases.toArray( new String[0] );
     }
 
-    
+
     /**
-     * Gets the Dirty flag of the dialog
+     * Gets the error message in the case where an identical alias already exists.
      *
-     * @return
-     *      the dirty flag of the dialog
+     * @return the error message
      */
-    public boolean isDirty()
-    {
-        return dirty;
-    }
+    protected abstract String getAliasAlreadyExistsErrorMessage();
+
+
+    /**
+     * Checks if the given alias is already taken.
+     *
+     * @return <code>true</code> if the given alias is already taken,
+     *         <code>false</code> if not.
+     */
+    protected abstract boolean isAliasAlreadyTaken( String alias );
 }

Added: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAttributeTypeAliasesDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAttributeTypeAliasesDialog.java?rev=1214197&view=auto
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAttributeTypeAliasesDialog.java
(added)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditAttributeTypeAliasesDialog.java
Wed Dec 14 12:07:36 2011
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.dialogs;
+
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * This dialog is used to edit aliases of an attribute type.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class EditAttributeTypeAliasesDialog extends AbstractAliasesDialog
+{
+    /**
+     * Creates a new instance of EditAttributeTypeAliasesDialog.
+     *
+     * @param aliases an array of aliases
+     */
+    public EditAttributeTypeAliasesDialog( List<String> aliases )
+    {
+        super( aliases );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void configureShell( Shell newShell )
+    {
+        super.configureShell( newShell );
+        newShell.setText( Messages.getString( "EditAttributeTypeAliasesDialog.EditAliases"
) ); //$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getAliasAlreadyExistsErrorMessage()
+    {
+        return Messages.getString( "EditAttributeTypeAliasesDialog.AliasAlreadyExists" );
//$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected boolean isAliasAlreadyTaken( String alias )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}

Added: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditObjectClassAliasesDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditObjectClassAliasesDialog.java?rev=1214197&view=auto
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditObjectClassAliasesDialog.java
(added)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/EditObjectClassAliasesDialog.java
Wed Dec 14 12:07:36 2011
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.dialogs;
+
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * This dialog is used to edit aliases of an object class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class EditObjectClassAliasesDialog extends AbstractAliasesDialog
+{
+    /**
+     * Creates a new instance of EditObjectClassAliasesDialog.
+     *
+     * @param aliases an array of aliases
+     */
+    public EditObjectClassAliasesDialog( List<String> aliases )
+    {
+        super( aliases );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void configureShell( Shell newShell )
+    {
+        super.configureShell( newShell );
+        newShell.setText( Messages.getString( "EditObjectClassAliasesDialog.EditAliases"
) ); //$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected String getAliasAlreadyExistsErrorMessage()
+    {
+        return Messages.getString( "EditObjectClassAliasesDialog.AliasAlreadyExists" ); //$NON-NLS-1$
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected boolean isAliasAlreadyTaken( String alias )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}

Added: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameAttributeTypeDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameAttributeTypeDialog.java?rev=1214197&view=auto
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameAttributeTypeDialog.java
(added)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameAttributeTypeDialog.java
Wed Dec 14 12:07:36 2011
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.dialogs;
+
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * This dialog is used to rename an attribute type.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class RenameAttributeTypeDialog extends EditAttributeTypeAliasesDialog
+{
+    /**
+     * Creates a new instance of RenameAttributeTypeDialog.
+     *
+     * @param aliases an array of aliases
+     */
+    public RenameAttributeTypeDialog( List<String> aliases )
+    {
+        super( aliases );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void configureShell( Shell newShell )
+    {
+        super.configureShell( newShell );
+        newShell.setText( Messages.getString( "RenameAttributeTypeDialog.RenameAttributeType"
) ); //$NON-NLS-1$
+    }
+}

Added: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameObjectClassDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameObjectClassDialog.java?rev=1214197&view=auto
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameObjectClassDialog.java
(added)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/RenameObjectClassDialog.java
Wed Dec 14 12:07:36 2011
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.dialogs;
+
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * This dialog is used to rename an object class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class RenameObjectClassDialog extends EditAttributeTypeAliasesDialog
+{
+    /**
+     * Creates a new instance of RenameObjectClassDialog.
+     *
+     * @param aliases an array of aliases
+     */
+    public RenameObjectClassDialog( List<String> aliases )
+    {
+        super( aliases );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void configureShell( Shell newShell )
+    {
+        super.configureShell( newShell );
+        newShell.setText( Messages.getString( "RenameObjectClassDialog.RenameObjectClass"
) ); //$NON-NLS-1$
+    }
+}

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages.properties?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages.properties
Wed Dec 14 12:07:36 2011
@@ -15,6 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
+AbstractAliasesDialog.EditAlias=Edit Aliases
+AbstractAliasesDialog.Add=Add...
+AbstractAliasesDialog.Aliases=Aliases:
+AbstractAliasesDialog.Edit=Edit...
+AbstractAliasesDialog.Remove=Remove
+AbstractAliasesDialog.InvalidAlias=The alias "{0}" is invalid.
 AbstractRenameDialog.NewName=New name:
 AttributeTypeSelectionDialog.ChooseAType=Choose an attribute type
 AttributeTypeSelectionDialog.InvalidSelection=Invalid Selection
@@ -23,13 +29,10 @@ AttributeTypeSelectionDialog.MustChooseT
 AttributeTypeSelectionDialog.TypeSelection=Attribute Type Selection
 AttributeTypeSelectionDialog.Choose=Choose
 AttributeTypeSelectionDialogLabelProvider.None=(None)  -  ({0})
-EditAliasesDialog.Add=Add...
-EditAliasesDialog.Aliases=Aliases:
-EditAliasesDialog.Edit=Edit...
-EditAliasesDialog.EditAlias=Edit Aliases
-EditAliasesDialog.ElementWithSameAliasExists=An element with the same alias already exists.
-EditAliasesDialog.Remove=Remove
-EditAliasesDialog.TheAliasBegin=The alias "{0}" is invalid.
+EditAttributeTypeAliasesDialog.EditAliases=Edit Attribute Type Aliases
+EditAttributeTypeAliasesDialog.AliasAlreadyExists=An attribute type with the same alias already
exists.
+EditObjectClassAliasesDialog.EditAliases=Edit ObjectClass Aliases
+EditObjectClassAliasesDialog.AliasAlreadyExists=An object class type with the same alias
already exists.
 ObjectClassSelectionDialog.ChooseClass=Choose an object class
 ObjectClassSelectionDialog.ClassSelection=Object Class Selection
 ObjectClassSelectionDialog.InvalidSelection=Invalid Selection
@@ -41,6 +44,8 @@ PreviousSearchesDialog.Open=Open
 PreviousSearchesDialog.Previous=Previous Searches
 PreviousSearchesDialog.Remove=Remove
 PreviousSearchesDialog.ShowResultsInView=Select the search to show in the search results
view:
+RenameAttributeTypeDialog.RenameAttributeType=Rename Attribute Type
+RenameObjectClassDialog.RenameObjectClass=Rename Object Class
 RenameProjectDialog.NameExists=A project with the same name already exists.
 RenameProjectDialog.Rename=Rename Schema Project
 RenameSchemaDialog.NameExists=A schema with the same name already exists.

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_de.properties?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_de.properties
Wed Dec 14 12:07:36 2011
@@ -15,6 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
+AbstractAliasesDialog.Add=Hinzuf\u00FCgen...
+AbstractAliasesDialog.Aliases=Aliase\:
+AbstractAliasesDialog.Edit=Editieren...
+AbstractAliasesDialog.EditAlias=Aliase editieren
+AbstractAliasesDialog.Remove=L\u00F6schen
+AbstractAliasesDialog.InvalidAlias=Der Alias "{0}" ist ung\u00FCltig.
 AbstractRenameDialog.NewName=Neuer Name\:
 AttributeTypeSelectionDialog.ChooseAType=W\u00E4hle einen Attribut Typ
 AttributeTypeSelectionDialog.InvalidSelection=Ung\u00FCltige Auswahl
@@ -23,13 +29,10 @@ AttributeTypeSelectionDialog.MustChooseT
 AttributeTypeSelectionDialog.TypeSelection=Auswahl Attribute Typ
 AttributeTypeSelectionDialog.Choose=Ausw\u00E4hlen
 AttributeTypeSelectionDialogLabelProvider.None=(Keine)  -  ({0})
-EditAliasesDialog.Add=Hinzuf\u00FCgen...
-EditAliasesDialog.Aliases=Aliase\:
-EditAliasesDialog.Edit=Editieren...
-EditAliasesDialog.EditAlias=Aliase editieren
-EditAliasesDialog.ElementWithSameAliasExists=Es existiert schon ein Element mit demselben
Alias.
-EditAliasesDialog.Remove=L\u00F6schen
-EditAliasesDialog.TheAliasBegin=Der Alias "{0}" ist ung\u00FCltig.
+EditAttributeTypeAliasesDialog.EditAliases=TODO:Edit Attribute Type Aliases
+EditAttributeTypeAliasesDialog.AliasAlreadyExists=TODO:An attribute type with the same alias
already exists.
+EditObjectClassAliasesDialog.EditAliases=TODO:Edit ObjectClass Aliases
+EditObjectClassAliasesDialog.AliasAlreadyExists=TODO:An object class type with the same alias
already exists.
 ObjectClassSelectionDialog.ChooseClass=W\u00E4hle eine Objektklasse
 ObjectClassSelectionDialog.ClassSelection=Auswahl Objektklasse
 ObjectClassSelectionDialog.InvalidSelection=Ung\u00FCltige Auswahl
@@ -41,6 +44,8 @@ PreviousSearchesDialog.Open=\u00D6ffnen
 PreviousSearchesDialog.Previous=Fr\u00FChere Suchen
 PreviousSearchesDialog.Remove=L\u00F6schen
 PreviousSearchesDialog.ShowResultsInView=W\u00E4hlen Sie die Suche aus, die in der Resultate-Ansicht
angezeigt werden soll\:
+RenameAttributeTypeDialog.RenameAttributeType=Attribut Typ umbenennen
+RenameObjectClassDialog.RenameObjectClass=Objektklasse umbenennen
 RenameProjectDialog.NameExists=Ein Projekt mit diesem Namen existiert bereits.
 RenameProjectDialog.Rename=Schema Project umbenennen
 RenameSchemaDialog.NameExists=Ein Schema mit diesem Namen existiert bereits.

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_fr.properties?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/messages_fr.properties
Wed Dec 14 12:07:36 2011
@@ -15,6 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
+AbstractAliasesDialog.Add=Ajouter...
+AbstractAliasesDialog.Aliases=Alias :
+AbstractAliasesDialog.Edit=Editer...
+AbstractAliasesDialog.EditAlias=Editer les alias
+AbstractAliasesDialog.Remove=Supprimer
+AbstractAliasesDialog.InvalidAlias=L''alias "{0}" est invalide.
 AbstractRenameDialog.NewName=Nouveau nom:
 AttributeTypeSelectionDialog.ChooseAType=Choisissez un type d'attribut
 AttributeTypeSelectionDialog.InvalidSelection=S\u00E9lection invalide
@@ -23,13 +29,10 @@ AttributeTypeSelectionDialog.MustChooseT
 AttributeTypeSelectionDialog.TypeSelection=S\u00E9lection de type d'attribut
 AttributeTypeSelectionDialog.Choose=Choisir
 AttributeTypeSelectionDialogLabelProvider.None=(Pas de nom)  -  ({0})
-EditAliasesDialog.Add=Ajouter...
-EditAliasesDialog.Aliases=Alias :
-EditAliasesDialog.Edit=Editer...
-EditAliasesDialog.EditAlias=Editer les alias
-EditAliasesDialog.ElementWithSameAliasExists=Un \u00E9l\u00E9ment avec le m\u00EAme alias
existe.
-EditAliasesDialog.Remove=Supprimer
-EditAliasesDialog.TheAliasBegin=L''alias "{0}" est invalide.
+EditAttributeTypeAliasesDialog.EditAliases=Editer les alias du type d'attribut
+EditAttributeTypeAliasesDialog.AliasAlreadyExists=Un type d'attribut avec un alias identique
existe d\u00E9j\u00E0.
+EditObjectClassAliasesDialog.EditAliases=Editer les alias de la classe d'objet
+EditObjectClassAliasesDialog.AliasAlreadyExists=Une classe d'objet avec un alias identique
existe d\u00E9j\u00E0.
 ObjectClassSelectionDialog.ChooseClass=Choisissez une classe d'objet
 ObjectClassSelectionDialog.ClassSelection=S\u00E9lection d'une classe d'objet
 ObjectClassSelectionDialog.InvalidSelection=S\u00E9lection invalide
@@ -41,6 +44,8 @@ PreviousSearchesDialog.Open=Ouvrir
 PreviousSearchesDialog.Previous=Recherches pr\u00E9c\u00E9dentes
 PreviousSearchesDialog.Remove=Supprimer
 PreviousSearchesDialog.ShowResultsInView=S\u00E9lectionner la recherche \u00E0 afficher dans
la vue des r\u00E9sultats de recherches:
+RenameAttributeTypeDialog.RenameAttributeType=Renommer le type d'attribut
+RenameObjectClassDialog.RenameObjectClass=Renommer la classe d'objet
 RenameProjectDialog.NameExists=Un projet avec un nom identique existe d\u00E9j\u00E0.
 RenameProjectDialog.Rename=Renommer le projet de sch\u00E9ma
 RenameSchemaDialog.NameExists=Un sch\u00E9ma avec un nom identique existe d\u00E9j\u00E0.

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/attributetype/AttributeTypeEditorOverviewPage.java
Wed Dec 14 12:07:36 2011
@@ -39,7 +39,7 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.model.alias.AliasWithError;
 import org.apache.directory.studio.schemaeditor.model.alias.AliasesStringParser;
 import org.apache.directory.studio.schemaeditor.view.ViewUtils;
-import org.apache.directory.studio.schemaeditor.view.dialogs.EditAliasesDialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.EditAttributeTypeAliasesDialog;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingAttributeType;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingMatchingRule;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingSyntax;
@@ -254,16 +254,12 @@ public class AttributeTypeEditorOverview
     {
         public void widgetSelected( SelectionEvent e )
         {
-            EditAliasesDialog editDialog = new EditAliasesDialog( modifiedAttributeType.getNames()
);
-            if ( editDialog.open() != EditAliasesDialog.OK )
+            EditAttributeTypeAliasesDialog dialog = new EditAttributeTypeAliasesDialog(
+                modifiedAttributeType.getNames() );
+            if ( dialog.open() == EditAttributeTypeAliasesDialog.OK )
             {
-                return;
-            }
-            if ( editDialog.isDirty() )
-            {
-                modifiedAttributeType.setNames( editDialog.getAliases() );
-                if ( ( modifiedAttributeType.getNames() != null )
-                    && ( modifiedAttributeType.getNames().size() != 0 ) )
+                modifiedAttributeType.setNames( dialog.getAliases() );
+                if ( ( modifiedAttributeType.getNames() != null ) && ( modifiedAttributeType.getNames().size()
!= 0 ) )
                 {
                     aliasesText.setText( ViewUtils.concateAliases( modifiedAttributeType.getNames()
) );
                 }

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/editors/objectclass/ObjectClassEditorOverviewPage.java
Wed Dec 14 12:07:36 2011
@@ -40,7 +40,7 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.model.alias.AliasesStringParser;
 import org.apache.directory.studio.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.schemaeditor.view.dialogs.AttributeTypeSelectionDialog;
-import org.apache.directory.studio.schemaeditor.view.dialogs.EditAliasesDialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.EditObjectClassAliasesDialog;
 import org.apache.directory.studio.schemaeditor.view.dialogs.ObjectClassSelectionDialog;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingAttributeType;
 import org.apache.directory.studio.schemaeditor.view.editors.NonExistingObjectClass;
@@ -256,14 +256,10 @@ public class ObjectClassEditorOverviewPa
     {
         public void widgetSelected( SelectionEvent e )
         {
-            EditAliasesDialog editDialog = new EditAliasesDialog( modifiedObjectClass.getNames()
);
-            if ( editDialog.open() != EditAliasesDialog.OK )
+            EditObjectClassAliasesDialog dialog = new EditObjectClassAliasesDialog( modifiedObjectClass.getNames()
);
+            if ( dialog.open() == EditObjectClassAliasesDialog.OK )
             {
-                return;
-            }
-            if ( editDialog.isDirty() )
-            {
-                modifiedObjectClass.setNames( editDialog.getAliases() );
+                modifiedObjectClass.setNames( dialog.getAliases() );
                 if ( ( modifiedObjectClass.getNames() != null ) && ( modifiedObjectClass.getNames().size()
!= 0 ) )
                 {
                     aliasesText.setText( ViewUtils.concateAliases( modifiedObjectClass.getNames()
) );
@@ -1246,7 +1242,7 @@ public class ObjectClassEditorOverviewPa
     public void dispose()
     {
         removeListeners();
-        
+
         schemaHandler.removeListener( schemaHandlerListener );
 
         super.dispose();

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewAttributeTypeGeneralWizardPage.java
Wed Dec 14 12:07:36 2011
@@ -35,8 +35,7 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.model.alias.AliasWithPartError;
 import org.apache.directory.studio.schemaeditor.model.alias.AliasWithStartError;
 import org.apache.directory.studio.schemaeditor.model.alias.AliasesStringParser;
-import org.apache.directory.studio.schemaeditor.view.dialogs.EditAliasesDialog;
-import org.eclipse.jface.dialogs.Dialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.EditAttributeTypeAliasesDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.ComboViewer;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -218,9 +217,9 @@ public class NewAttributeTypeGeneralWiza
              */
             public void widgetSelected( SelectionEvent arg0 )
             {
-                EditAliasesDialog dialog = new EditAliasesDialog( getAliasesValue() );
+                EditAttributeTypeAliasesDialog dialog = new EditAttributeTypeAliasesDialog(
getAliasesValue() );
 
-                if ( ( dialog.open() == Dialog.OK ) && ( dialog.isDirty() ) )
+                if ( dialog.open() == EditAttributeTypeAliasesDialog.OK )
                 {
                     String[] newAliases = dialog.getAliases();
 

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java?rev=1214197&r1=1214196&r2=1214197&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewObjectClassGeneralPageWizardPage.java
Wed Dec 14 12:07:36 2011
@@ -35,8 +35,7 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.model.alias.AliasWithPartError;
 import org.apache.directory.studio.schemaeditor.model.alias.AliasWithStartError;
 import org.apache.directory.studio.schemaeditor.model.alias.AliasesStringParser;
-import org.apache.directory.studio.schemaeditor.view.dialogs.EditAliasesDialog;
-import org.eclipse.jface.dialogs.Dialog;
+import org.apache.directory.studio.schemaeditor.view.dialogs.EditObjectClassAliasesDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.ComboViewer;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -219,9 +218,9 @@ public class NewObjectClassGeneralPageWi
              */
             public void widgetSelected( SelectionEvent arg0 )
             {
-                EditAliasesDialog dialog = new EditAliasesDialog( getAliasesValue() );
+                EditObjectClassAliasesDialog dialog = new EditObjectClassAliasesDialog( getAliasesValue()
);
 
-                if ( ( dialog.open() == Dialog.OK ) && ( dialog.isDirty() ) )
+                if ( dialog.open() == EditObjectClassAliasesDialog.OK )
                 {
                     String[] newAliases = dialog.getAliases();
 



Mime
View raw message