directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1689040 [1/2] - in /directory/studio/trunk/plugins: openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/ openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/ o...
Date Fri, 03 Jul 2015 15:51:58 GMT
Author: elecharny
Date: Fri Jul  3 15:51:57 2015
New Revision: 1689040

URL: http://svn.apache.org/r1689040
Log:
o Added a DbIndexTypeEnum to list the possible indexes
o Used a TableWidget instead of a IndexWidget for the MDB database
o Created the logic for the TableWidget<DbIndexWrapper> :
  o Create a DbIndexWrapper
  o Created a DbIndexDialog
  o Created a DbIndexDecorator
  o Deleted the IndexDialog class (replaced by DbIndexDialog)
o Some fixes in the SsfDialog and StringValueDialog
o Fixed the OlcDbIndex toString() method
o Almost ripped of the IndexWidget. It will be removed soon.
o Externalized some Strings.
  

Added:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java
      - copied, changed from r1688864, directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/IndexTypeEnum.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/Messages.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages.properties
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_de.properties
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_fr.properties
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DbIndexDialog.java
      - copied, changed from r1688864, directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/IndexDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java
Removed:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/IndexTypeEnum.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/IndexDialog.java
Modified:
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/BerkeleyDbDatabaseSpecificDetailsBlock.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabaseTypeEnum.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabasesDetailsPage.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/MdbDatabaseSpecificDetailsBlock.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/OrderedStringValueDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/OlcDbIndex.java
    directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/model/widgets/IndicesWidget.java

Copied: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java (from r1688864, directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/IndexTypeEnum.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java?p2=directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java&p1=directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/IndexTypeEnum.java&r1=1688864&r2=1689040&rev=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/IndexTypeEnum.java (original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java Fri Jul  3 15:51:57 2015
@@ -39,32 +39,37 @@ package org.apache.directory.studio.open
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum IndexTypeEnum
+public enum DbIndexTypeEnum
 {
-    APPROX( "approx" ),
-    EQ( "eq" ),
-    NOLANG( "nolang" ),
-    NOSUBTYPES( "nosubtypes" ),
-    NOTAGS( "notags" ),
-    PRES( "pres" ),
-    SUB( "sub" ),
-    SUBANY( "subany" ),
-    SUBFINAL( "subfinal" ),
-    SUBINITIAL( "subinitial" ),
-    SUBSTR( "substr" ),
-    NONE( "none" );
+    APPROX( 0, "approx" ),
+    EQ( 1, "eq" ),
+    NOLANG( 2, "nolang" ),
+    NOSUBTYPES( 3, "nosubtypes" ),
+    NOTAGS( 4, "notags" ),
+    PRES( 5, "pres" ),
+    SUB( 6, "sub" ),
+    SUBANY( 7, "subany" ),
+    SUBFINAL( 8, "subfinal" ),
+    SUBINITIAL( 9, "subinitial" ),
+    SUBSTR( 10, "substr" ),  // Same as SUB
+    NONE( 11, "none" );
 
     /** The internal name */
     private String name;
     
+    /** The internal number */
+    private int number;
+    
     /**
      * A private constructor for this class
      */
-    private IndexTypeEnum( String name )
+    private DbIndexTypeEnum( int number, String name )
     {
         this.name = name;
+        this.number = number;
     }
 
+    
     /**
      * @return the name
      */
@@ -75,21 +80,64 @@ public enum IndexTypeEnum
 
     
     /**
-     * Return an instance of IndexTypeEnum from a String
+     * @return the number
+     */
+    public int getNumber()
+    {
+        return number;
+    }
+
+    
+    /**
+     * Return an instance of DbIndexTypeEnum from a String
      * 
      * @param name The indexType's name
-     * @return The associated IndexTypeEnum
+     * @return The associated DbIndexTypeEnum
      */
-    public static IndexTypeEnum getIndexType( String name )
+    public static DbIndexTypeEnum getIndexType( String name )
     {
-        for ( IndexTypeEnum indexType : values() )
+        for ( DbIndexTypeEnum indexType : values() )
         {
             if ( indexType.getName().equalsIgnoreCase( name ) )
             {
-                return indexType;
+                if ( SUBSTR.getName().equalsIgnoreCase( name ) )
+                {
+                    // SUB and SUBSTR are the same. Return SUB
+                    return SUB;
+                }
+                else
+                {
+                    return indexType;
+                }
             }
         }
         
         return NONE;
     }
+    
+    
+    /**
+     * Get the DbIndexTypeEnum instance from its number
+     * 
+     * @param number The number we are looking for
+     * @return The associated DbIndexTypeEnum instance
+     */
+    public static DbIndexTypeEnum getIndexType( int number )
+    {
+        switch ( number )
+        {
+            case 0 : return APPROX;
+            case 1 : return EQ;
+            case 2 : return NOLANG;
+            case 3 : return NOSUBTYPES;
+            case 4 : return NOTAGS;
+            case 5 : return PRES;
+            case 6 : return SUB;
+            case 7 : return SUBANY;
+            case 8 : return SUBFINAL;
+            case 9 : return SUBINITIAL;
+            case 10 : return SUBSTR;
+            default : return NONE;
+        }
+    }
 }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/BerkeleyDbDatabaseSpecificDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/BerkeleyDbDatabaseSpecificDetailsBlock.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/BerkeleyDbDatabaseSpecificDetailsBlock.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/BerkeleyDbDatabaseSpecificDetailsBlock.java Fri Jul  3 15:51:57 2015
@@ -223,7 +223,7 @@ public class BerkeleyDbDatabaseSpecificD
 
         // Indices Widget
         indicesWidget = new IndicesWidget( browserConnection );
-        indicesWidget.createWidget( databaseIndexesComposite, toolkit );
+        indicesWidget.createWidgetWithEdit( databaseIndexesComposite, toolkit );
         indicesWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
 
         // Linear Indexes Widget
@@ -377,7 +377,7 @@ public class BerkeleyDbDatabaseSpecificD
             sharedMemoryKeyText.setText( ( sharedMemoryKey == null ) ? "" : "" + sharedMemoryKey ); //$NON-NLS-1$
 
             // Indices Text
-            indicesWidget.setIndices( database.getOlcDbIndex() );
+            //indicesWidget.setIndices( database.getOlcDbIndex() );
 
             // Linear Index Widget
             linearIndexBooleanWithDefaultWidget.setValue( database.getOlcDbLinearIndex() );
@@ -544,10 +544,12 @@ public class BerkeleyDbDatabaseSpecificD
 
         // Indices Widget
         database.clearOlcDbIndex();
+        /*
         for ( String index : indicesWidget.getIndices() )
         {
             database.addOlcDbIndex( index );
         }
+        */
 
         // Linear Index Widget
         database.setOlcDbLinearIndex( linearIndexBooleanWithDefaultWidget.getValue() );

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabaseTypeEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabaseTypeEnum.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabaseTypeEnum.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabaseTypeEnum.java Fri Jul  3 15:51:57 2015
@@ -119,4 +119,5 @@ public enum DatabaseTypeEnum
     {
         return name;
     }
+    
 }
\ No newline at end of file

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabasesDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabasesDetailsPage.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabasesDetailsPage.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/DatabasesDetailsPage.java Fri Jul  3 15:51:57 2015
@@ -95,29 +95,6 @@ import org.eclipse.ui.forms.widgets.Sect
  */
 public class DatabasesDetailsPage implements IDetailsPage
 {
-    /** The editable database types array */
-    private static DatabaseTypeEnum[] EDITABLE_DATABASE_TYPES = new DatabaseTypeEnum[]
-        {
-            DatabaseTypeEnum.NONE,
-            DatabaseTypeEnum.FRONTEND,
-            DatabaseTypeEnum.CONFIG,
-            DatabaseTypeEnum.BDB,
-            DatabaseTypeEnum.DB_PERL,
-            DatabaseTypeEnum.DB_SOCKET,
-            DatabaseTypeEnum.HDB,
-            DatabaseTypeEnum.MDB,
-            DatabaseTypeEnum.LDAP,
-            DatabaseTypeEnum.LDIF,
-            DatabaseTypeEnum.META,
-            DatabaseTypeEnum.MONITOR,
-            DatabaseTypeEnum.NDB,
-            DatabaseTypeEnum.NULL,
-            DatabaseTypeEnum.PASSWD,
-            DatabaseTypeEnum.RELAY,
-            DatabaseTypeEnum.SHELL,
-            DatabaseTypeEnum.SQL
-    };
-
     /** The frontend database type array */
     private static DatabaseTypeEnum[] FRONTEND_DATABASE_TYPES = new DatabaseTypeEnum[]
         {
@@ -463,7 +440,12 @@ public class DatabasesDetailsPage implem
     /**
      * Creates the General Settings Section. This will expose the following attributes :
      * <ul>
-     * <li></li>
+     * <li>olcSuffix</li>
+     * <li>olcDirectory</li>
+     * <li>olcDbMode</li>
+     * <li>olcRootDN</li>
+     * <li>olcRootPW</li>
+     * <li>olcIndex</li>
      * </ul>
      *
      * @param parent the parent composite
@@ -1158,7 +1140,7 @@ public class DatabasesDetailsPage implem
             // OlcHdbConfig Type
             if ( database instanceof OlcHdbConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.HDB ) );
                 databaseSpecificDetailsBlock = new BerkeleyDbDatabaseSpecificDetailsBlock<OlcHdbConfig>( instance,
                     ( OlcHdbConfig ) database, browserConnection );
@@ -1166,7 +1148,7 @@ public class DatabasesDetailsPage implem
             // OlcBdbConfig Type
             else if ( database instanceof OlcBdbConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.BDB ) );
                 databaseSpecificDetailsBlock = new BerkeleyDbDatabaseSpecificDetailsBlock<OlcBdbConfig>( instance,
                     ( OlcBdbConfig ) database, browserConnection );
@@ -1174,7 +1156,7 @@ public class DatabasesDetailsPage implem
             // OlcMdbConfig Type
             else if ( database instanceof OlcMdbConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.MDB ) );
                 databaseSpecificDetailsBlock = new MdbDatabaseSpecificDetailsBlock( instance,
                     ( OlcMdbConfig ) database, browserConnection );
@@ -1182,7 +1164,7 @@ public class DatabasesDetailsPage implem
             // OlcLdifConfig Type
             else if ( database instanceof OlcLdifConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.LDIF ) );
                 databaseSpecificDetailsBlock = new LdifDatabaseSpecificDetailsBlock( instance,
                     ( OlcLdifConfig ) database );
@@ -1190,7 +1172,7 @@ public class DatabasesDetailsPage implem
             // OlcNullConfig Type
             else if ( database instanceof OlcNullConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.NULL ) );
                 databaseSpecificDetailsBlock = new NullDatabaseSpecificDetailsBlock( instance,
                     ( OlcNullConfig ) database );
@@ -1198,7 +1180,7 @@ public class DatabasesDetailsPage implem
             // OlcRelayConfig Type
             else if ( database instanceof OlcRelayConfig )
             {
-                databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                 databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.RELAY ) );
                 databaseSpecificDetailsBlock = new RelayDatabaseSpecificDetailsBlock( instance,
                     ( OlcRelayConfig ) database, browserConnection );
@@ -1224,7 +1206,7 @@ public class DatabasesDetailsPage implem
                 // Any other type of database
                 else
                 {
-                    databaseTypeComboViewer.setInput( EDITABLE_DATABASE_TYPES );
+                    databaseTypeComboViewer.setInput( DatabaseTypeEnum.values() );
                     databaseTypeComboViewer.setSelection( new StructuredSelection( DatabaseTypeEnum.NONE ) );
                     databaseSpecificDetailsBlock = null;
                 }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/MdbDatabaseSpecificDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/MdbDatabaseSpecificDetailsBlock.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/MdbDatabaseSpecificDetailsBlock.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/MdbDatabaseSpecificDetailsBlock.java Fri Jul  3 15:51:57 2015
@@ -22,9 +22,11 @@ package org.apache.directory.studio.open
 
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.common.ui.widgets.TableWidget;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.openldap.config.editor.wrappers.DbIndexDecorator;
+import org.apache.directory.studio.openldap.config.editor.wrappers.DbIndexWrapper;
 import org.apache.directory.studio.openldap.config.model.database.OlcMdbConfig;
-import org.apache.directory.studio.openldap.config.model.widgets.IndicesWidget;
 import org.apache.directory.studio.openldap.common.ui.widgets.BooleanWithDefaultWidget;
 import org.apache.directory.studio.openldap.common.ui.widgets.DirectoryBrowserWidget;
 import org.apache.directory.studio.openldap.common.ui.widgets.UnixPermissionsWidget;
@@ -45,9 +47,12 @@ import org.eclipse.ui.forms.widgets.Sect
  * .--------------------------------------------------------------------.
  * | Database Specific Settings                                         |
  * +--------------------------------------------------------------------+
- * | v Database Configuration                                           |
- * |  Directory : [                                     [v] (browse...) |
- * |  Mode :      [--------(0000)               ] (Edit Permissions...) |
+ * | .----------------------------------------------------------------. |
+ * | |v MDB Configuration                                             | |
+ * | +----------------------------------------------------------------+ |
+ * | | Directory : [////////////////////////////[v] (Browse)          | |
+ * | | Mode :      [--------(0000)               ] (Edit Permissions) | |
+ * | +----------------------------------------------------------------+ |
  * |                                                                    |
  * | v Database indices                                                 |
  * |  +----------------------------------------------+                  |
@@ -89,7 +94,7 @@ public class MdbDatabaseSpecificDetailsB
     private Text envFlagsText;
 
     /** The olcDbIndex attribute (String, multi-values) */
-    private IndicesWidget indicesWidget;
+    private TableWidget<DbIndexWrapper> indicesWidget;
 
     /** The olcMaxEntrySize attribute (Integer) No yet available (2.4.41) */
     private Text maxEntrySizeText;
@@ -155,6 +160,14 @@ public class MdbDatabaseSpecificDetailsB
      * <li>olcDbMode</li>
      * </ul>
      *
+     * <pre>
+     * .------------------------------------------------------------------.
+     * |v MDB Configuration                                               |
+     * +------------------------------------------------------------------+
+     * | Directory : [///////////////////////////////] (Browse)           |
+     * | Mode :      [///////////////////////////////] (Edit Permissions) |
+     * +------------------------------------------------------------------+
+     * </pre
      * @param parent the parent composite
      * @param toolkit the toolkit
      */
@@ -162,7 +175,7 @@ public class MdbDatabaseSpecificDetailsB
     {
         // Database Configuration Section
         Section databaseConfigurationSection = toolkit.createSection( parent, Section.TWISTIE );
-        databaseConfigurationSection.setText( "Database Configuration" );
+        databaseConfigurationSection.setText( Messages.getString( "OpenLDAPMDBConfiguration.Section" ) );
         databaseConfigurationSection.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite databaseConfigurationComposite = toolkit.createComposite( databaseConfigurationSection );
         toolkit.paintBordersFor( databaseConfigurationComposite );
@@ -170,7 +183,7 @@ public class MdbDatabaseSpecificDetailsB
         databaseConfigurationSection.setClient( databaseConfigurationComposite );
 
         // Directory Text
-        toolkit.createLabel( databaseConfigurationComposite, "Directory:" );
+        toolkit.createLabel( databaseConfigurationComposite, Messages.getString( "OpenLDAPMDBConfiguration.Directory" ) );
         Composite directoryComposite = toolkit.createComposite( databaseConfigurationComposite );
         GridLayout directoryCompositeGridLayout = new GridLayout( 2, false );
         directoryCompositeGridLayout.marginHeight = directoryCompositeGridLayout.marginWidth = 0;
@@ -181,7 +194,7 @@ public class MdbDatabaseSpecificDetailsB
         directoryBrowserWidget.createWidget( directoryComposite, toolkit );
 
         // Mode Text
-        toolkit.createLabel( databaseConfigurationComposite, "Mode:" );
+        toolkit.createLabel( databaseConfigurationComposite, Messages.getString( "OpenLDAPMDBConfiguration.Mode" ) );
         modeUnixPermissionsWidget = new UnixPermissionsWidget();
         modeUnixPermissionsWidget.create( databaseConfigurationComposite, toolkit );
         modeUnixPermissionsWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
@@ -202,7 +215,7 @@ public class MdbDatabaseSpecificDetailsB
     {
         // Database Indices Section
         Section databaseIndexesSection = toolkit.createSection( parent, Section.TWISTIE );
-        databaseIndexesSection.setText( "Database Indices" );
+        databaseIndexesSection.setText( Messages.getString( "OpenLDAPMDBConfiguration.IndicesSection" ) );
         databaseIndexesSection.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
         Composite databaseIndexesComposite = toolkit.createComposite( databaseIndexesSection );
         toolkit.paintBordersFor( databaseIndexesComposite );
@@ -210,8 +223,8 @@ public class MdbDatabaseSpecificDetailsB
         databaseIndexesSection.setClient( databaseIndexesComposite );
 
         // Indices Widget
-        indicesWidget = new IndicesWidget( browserConnection );
-        indicesWidget.createWidget( databaseIndexesComposite, toolkit );
+        indicesWidget = new TableWidget<DbIndexWrapper>( new DbIndexDecorator( null, browserConnection ) );
+        indicesWidget.createWidgetWithEdit( databaseIndexesComposite, toolkit );
         indicesWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
     }
 
@@ -322,7 +335,7 @@ public class MdbDatabaseSpecificDetailsB
             modeUnixPermissionsWidget.setValue( mode );
 
             // Indices Text
-            indicesWidget.setIndices( database.getOlcDbIndex() );
+            //indicesWidget.setIndices( database.getOlcDbIndex() );
 
             // Max Readers Text
             Integer maxReaders = database.getOlcDbMaxReaders();
@@ -435,10 +448,12 @@ public class MdbDatabaseSpecificDetailsB
         // Indices
         database.clearOlcDbIndex();
 
+        /*
         for ( String index : indicesWidget.getIndices() )
         {
             database.addOlcDbIndex( index );
         }
+        */
 
         // Max readers
         try

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/Messages.java?rev=1689040&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/Messages.java (added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/Messages.java Fri Jul  3 15:51:57 2015
@@ -0,0 +1,55 @@
+/*
+ *  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.openldap.config.editor.databases;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * This class get messages from the resources file for the databases OpenLDAP pages.
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class Messages
+{
+    /** The resource name */
+    private static final ResourceBundle RESOURCE_BUNDLE = 
+        ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
+    
+    /**
+     * Get back a message from the resource file given a key
+     * 
+     * @param key The key associated with the message
+     * @return The found message
+     */
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+}

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages.properties?rev=1689040&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages.properties (added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages.properties Fri Jul  3 15:51:57 2015
@@ -0,0 +1,29 @@
+# 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.
+#---------------------------------------------------------------------------------------
+# The MasterDetail block
+#---------------------------------------------------------------------------------------
+OpenLDAPMasterDetail.Title=Overview
+
+#---------------------------------------------------------------------------------------
+# The MDB specific block
+#---------------------------------------------------------------------------------------
+OpenLDAPMDBConfiguration.Section=MDB Configuration
+OpenLDAPMDBConfiguration.Directory=Directory :
+OpenLDAPMDBConfiguration.Mode=Mode :
+OpenLDAPMDBConfiguration.IndicesSection=Database Indices
+

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_de.properties?rev=1689040&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_de.properties (added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_de.properties Fri Jul  3 15:51:57 2015
@@ -0,0 +1,28 @@
+# 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.
+#---------------------------------------------------------------------------------------
+# The MasterDetail block
+#---------------------------------------------------------------------------------------
+OpenLDAPMasterDetail.Title=Overview
+
+#---------------------------------------------------------------------------------------
+# The MDB specific block
+#---------------------------------------------------------------------------------------
+OpenLDAPMDBConfiguration.Section=MDB Konfiguration
+OpenLDAPMDBConfiguration.Directory=R\u00E9pertoire :
+OpenLDAPMDBConfiguration.Mode=Mode :
+OpenLDAPMDBConfiguration.IndicesSection=Indexes

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_fr.properties?rev=1689040&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_fr.properties (added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/messages_fr.properties Fri Jul  3 15:51:57 2015
@@ -0,0 +1,28 @@
+# 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.
+#---------------------------------------------------------------------------------------
+# The MasterDetail block
+#---------------------------------------------------------------------------------------
+OpenLDAPMasterDetail.Title=G\u00E9n\u00E9ral
+
+#---------------------------------------------------------------------------------------
+# The MDB specific block
+#---------------------------------------------------------------------------------------
+OpenLDAPMDBConfiguration.Section=Configuration MDB
+OpenLDAPMDBConfiguration.Directory=R\u00E9pertoire :
+OpenLDAPMDBConfiguration.Mode=Mode :
+OpenLDAPMDBConfiguration.IndicesSection=Index de la base

Copied: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DbIndexDialog.java (from r1688864, directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/IndexDialog.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DbIndexDialog.java?p2=directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DbIndexDialog.java&p1=directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/IndexDialog.java&r1=1688864&r2=1689040&rev=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/IndexDialog.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/DbIndexDialog.java Fri Jul  3 15:51:57 2015
@@ -22,22 +22,19 @@ package org.apache.directory.studio.open
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
+import org.apache.directory.studio.common.ui.AddEditDialog;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.common.ui.widgets.TableWidget;
+import org.apache.directory.studio.common.ui.widgets.WidgetModifyEvent;
+import org.apache.directory.studio.common.ui.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
-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.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -45,13 +42,12 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-
-import org.apache.directory.studio.openldap.common.ui.dialogs.AttributeDialog;
+import org.apache.directory.studio.openldap.common.ui.model.DbIndexTypeEnum;
 import org.apache.directory.studio.openldap.config.OpenLdapConfigurationPlugin;
 import org.apache.directory.studio.openldap.config.OpenLdapConfigurationPluginConstants;
-import org.apache.directory.studio.openldap.config.model.OlcDbIndex;
-import org.apache.directory.studio.openldap.config.model.OlcDbIndexTypeEnum;
+import org.apache.directory.studio.openldap.config.editor.wrappers.DbIndexWrapper;
+import org.apache.directory.studio.openldap.config.editor.wrappers.StringValueDecorator;
+import org.apache.directory.studio.openldap.config.editor.wrappers.StringValueWrapper;
 
 
 /**
@@ -60,16 +56,17 @@ import org.apache.directory.studio.openl
  * +--------------------------------------------------+
  * |  Attributes                                      |
  * | .----------------------------------------------. |
- * | |   +------------------------------+           | |
- * | | o |                              | (Add...)  | |
- * | |   |                              | (Delete)  | |
- * | |   +------------------------------+           | |
- * | | o Default                                    | |
+ * | |     +----------------------------+           | |
+ * | | (o) |                            | (Add...)  | |
+ * | |     |                            | (Delete)  | |
+ * | |     +----------------------------+           | |
+ * | | (o) Default                                  | |
  * | '----------------------------------------------' |
  * |  Indices                                         |
  * | .----------------------------------------------. |
  * | | [] pres        [] eq          [] approx      | |
- * | | [] sub         [] nolang      [] nosubtypes  | |
+ * | | [] nolang      [] noSubtypes  [] notags      | |
+ * | | [] sub                                       | |
  * | |    [] subinitial                             | |
  * | |    [] subany                                 | |
  * | |    [] subfinal                               | |
@@ -79,112 +76,62 @@ import org.apache.directory.studio.openl
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class IndexDialog extends Dialog
+public class DbIndexDialog extends AddEditDialog<DbIndexWrapper>
 {
-    /** The index */
-    private OlcDbIndex index;
-
-    /** The new index */
-    private OlcDbIndex newIndex;
-
-    /** The connection */
-    private IBrowserConnection browserConnection;
-
     /** The attributes list */
     private List<String> attributes = new ArrayList<String>();
 
     // UI widgets
-    private Button okButton;
+    // The attribute's group
     private Button attributesCheckbox;
-    private Table table;
-    private TableViewer tableViewer;
-    private Button addButton;
-    private Button deleteButton;
+    private TableWidget<StringValueWrapper> attributeTable;
     private Button defaultCheckbox;
+    
+    // The index type section
     private Button presCheckbox;
     private Button eqCheckbox;
     private Button approxCheckbox;
     private Button subCheckbox;
     private Button noLangCheckbox;
     private Button noSubtypesCheckbox;
+    private Button noTagsCheckbox;
     private Button subInitialCheckbox;
     private Button subAnyCheckbox;
     private Button subFinalCheckbox;
-
+    
+    // The list of all the type buttons
+    private Button[] typeButtons = new Button[10];
+    
     /**
-     * Listeners for the Attributes radiobutton. It will enable the buttons accordingly
-     * to the content of the Attributes table : Add is always active, Delete is active if
-     * an attribute is selected.
+     * Listeners for the Attributes radioButton. It will enable the Attributes table.
      * */ 
     private SelectionListener attributesCheckboxSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            table.setEnabled( true );
-            addButton.setEnabled( true );
-            deleteButton.setEnabled( !tableViewer.getSelection().isEmpty() );
+            attributeTable.enable();
+            getEditedElement().setDefault( false );
             checkAndUpdateOkButtonEnableState();
         }
     };
     
-    /**
-     * A listener on the Attributes Table : if one attribute is selected, then the Delete
-     * button will be activated. 
-     */
-    private ISelectionChangedListener tableViewerSelectionChangedListener = new ISelectionChangedListener()
-    {
-        public void selectionChanged( SelectionChangedEvent event )
-        {
-            deleteButton.setEnabled( !tableViewer.getSelection().isEmpty() );
-        }
-    };
     
     /**
-     * A listener on the Attributes Add button. If selected, it opens a dialog that lists
-     * the possible attributes. The added attribute will be selected.
+     * The attribute table listener
      */
-    private SelectionListener addButtonSelectionListener = new SelectionAdapter()
+    private WidgetModifyListener attributeTableListener = new WidgetModifyListener()
     {
-        public void widgetSelected( SelectionEvent e )
+        public void widgetModified( WidgetModifyEvent e )
         {
-            AttributeDialog dialog = new AttributeDialog( addButton.getShell(), browserConnection );
+            getEditedElement().getAttributes().clear();
             
-            if ( dialog.open() == AttributeDialog.OK )
+            for ( StringValueWrapper attribute : attributeTable.getElements() )
             {
-                String attribute = dialog.getAttribute();
-
-                if ( !attributes.contains( attribute ) )
-                {
-                    attributes.add( attribute );
-                    tableViewer.refresh();
-                    tableViewer.setSelection( new StructuredSelection( attribute ) );
-                    checkAndUpdateOkButtonEnableState();
-                }
+                getEditedElement().getAttributes().add( attribute.getValue() );
             }
         }
     };
-    
-    /** 
-     * A listener on the Attributes Delete button. If an attribute is selected (which should
-     * always be the case, otherwise the button would be disabled!), then it will be removed
-     * from the table.
-     */
-    private SelectionListener deleteButtonSelectionListener = new SelectionAdapter()
-    {
-        public void widgetSelected( SelectionEvent e )
-        {
-            StructuredSelection selection = ( StructuredSelection ) tableViewer.getSelection();
-
-            if ( !selection.isEmpty() )
-            {
-                String selectedAttribute = ( String ) selection.getFirstElement();
 
-                attributes.remove( selectedAttribute );
-                tableViewer.refresh();
-                checkAndUpdateOkButtonEnableState();
-            }
-        }
-    };
     
     /**
      * A listener on the Default radio button. It will disable the Attributes table
@@ -194,42 +141,246 @@ public class IndexDialog extends Dialog
     {
         public void widgetSelected( SelectionEvent e )
         {
-            disableAttributesTableAndButtons();
+            attributeTable.disable();
+            getEditedElement().setDefault( true );
             checkAndUpdateOkButtonEnableState();
         }
     };
+
     
     /**
-     * A listener on the SUB indice check box
+     * A listener on one of the indexType checkboxes (but SUB and SUBxxx)
      */
-    private SelectionListener subCheckboxSelectionListener = new SelectionAdapter()
+    private SelectionListener typeButtonSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            setSelectionForSubCheckboxes( subCheckbox.getSelection() );
             checkAndUpdateOkButtonEnableState();
-        }
+            DbIndexWrapper indexWrapper = getEditedElement();
+            
+            // Update the edited element
+            Button selectedCheckbox = (Button)e.getSource();
+            
+            for ( int i = 0; i < typeButtons.length; i++ )
+            {
+                if ( typeButtons[i] == selectedCheckbox )
+                {
+                    DbIndexTypeEnum indexType = DbIndexTypeEnum.getIndexType( i );
+                    
+                    if ( selectedCheckbox.getSelection() )
+                    {
+                        indexWrapper.getTypes().add( indexType );
+                    }
+                    else
+                    {
+                        indexWrapper.getTypes().remove( indexType );
+                    }
+                    
+                    System.out.println( indexWrapper );
+                }
+            }
+        };
     };
+
     
     /**
-     * A listener on the OkButton
+     * A listener on the SUB indice check box. If it's selected, we will grey all the sub-sub indexes.
+     * If it's delected, we will remove all the sub-sub indexes
      */
-    private SelectionListener checkOkButtonSelectionListener = new SelectionAdapter()
+    private SelectionListener subCheckboxSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
+            DbIndexWrapper indexWrapper = getEditedElement();
+            
+            if ( subCheckbox.getSelection() )
+            {
+                indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUB );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                
+                subInitialCheckbox.setSelection( true );
+                subAnyCheckbox.setSelection( true );
+                subFinalCheckbox.setSelection( true );
+            }
+            else
+            {
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                
+                subInitialCheckbox.setSelection( false );
+                subAnyCheckbox.setSelection( false );
+                subFinalCheckbox.setSelection( false );
+            }
+            
+            System.out.println( indexWrapper );
+            
             checkAndUpdateOkButtonEnableState();
-        };
+        }
     };
+
     
     /**
-     * A listener on the SUB related indice check boxs
+     * A listener on the SUB related indices check boxes. We will disable the SUB checkbox, no matter what
      */
-    private SelectionListener checkSubCheckboxSelectionListener = new SelectionAdapter()
+    private SelectionListener subSubCheckboxSelectionListener = new SelectionAdapter()
     {
         public void widgetSelected( SelectionEvent e )
         {
-            checkAndUpdateSubCheckboxSelectionState();
+            // Check that we aren't coming from a modification of the SUB button
+            DbIndexWrapper indexWrapper = getEditedElement();
+            
+            Button button = (Button)e.getSource();
+            
+            // First, update the indexTypes set
+            if ( button == subAnyCheckbox )
+            {
+                if ( button.getSelection() )
+                {
+                    if ( subInitialCheckbox.getSelection() && subFinalCheckbox.getSelection() )
+                    {
+                        // The three subXXX indexes are selected : select the SUB checkbox
+                        subCheckbox.setSelection( true );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                    else if ( subInitialCheckbox.getSelection() || subFinalCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBANY );
+                    }
+                    else
+                    {
+                        // Gray the sub checkbox, and select it
+                        subCheckbox.setSelection( true );
+                        subCheckbox.setGrayed( true );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                }
+                else
+                {
+                    if ( !subInitialCheckbox.getSelection() && !subFinalCheckbox.getSelection() )
+                    {
+                        subCheckbox.setGrayed( false );
+                        subCheckbox.setSelection( false );
+                    }
+                    else if ( subInitialCheckbox.getSelection() && subFinalCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBINITIAL );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBFINAL );
+                        subCheckbox.setGrayed( true );
+                    }
+
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                }
+            }
+            else if ( button == subInitialCheckbox )
+            {
+                if ( button.getSelection() )
+                {
+                    if ( subAnyCheckbox.getSelection() && subFinalCheckbox.getSelection() )
+                    {
+                        // The three subXXX indexes are selected : select the SUB checkbox
+                        subCheckbox.setSelection( true );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                    else if ( subAnyCheckbox.getSelection() || subFinalCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBINITIAL );
+                    }
+                    else
+                    {
+                        // Gray the sub checkbox, and select it
+                        subCheckbox.setSelection( true );
+                        subCheckbox.setGrayed( true );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                }
+                else
+                {
+                    if ( !subAnyCheckbox.getSelection() && !subFinalCheckbox.getSelection() )
+                    {
+                        subCheckbox.setGrayed( false );
+                        subCheckbox.setSelection( false );
+                    }
+                    else if ( subAnyCheckbox.getSelection() && subFinalCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBFINAL );
+                        subCheckbox.setGrayed( true );
+                    }
+
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                }
+            }
+            else if ( button == subFinalCheckbox )
+            {
+                if ( button.getSelection() )
+                {
+                    if ( subAnyCheckbox.getSelection() && subInitialCheckbox.getSelection() )
+                    {
+                        // The three subXXX indexes are selected : select the SUB checkbox
+                        subCheckbox.setSelection( true );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBINITIAL );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                    else if ( subAnyCheckbox.getSelection() || subInitialCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBFINAL );
+                    }
+                    else
+                    {
+                        // Gray the sub checkbox, and select it
+                        subCheckbox.setSelection( true );
+                        subCheckbox.setGrayed( true );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBFINAL );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                        indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                    }
+                }
+                else
+                {
+                    if ( !subAnyCheckbox.getSelection() && !subInitialCheckbox.getSelection() )
+                    {
+                        subCheckbox.setGrayed( false );
+                        subCheckbox.setSelection( false );
+                    }
+                    else if ( subAnyCheckbox.getSelection() && subInitialCheckbox.getSelection() )
+                    {
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBANY );
+                        indexWrapper.getIndexTypes().add( DbIndexTypeEnum.SUBINITIAL );
+                        subCheckbox.setGrayed( true );
+                    }
+
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBFINAL );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUB );
+                    indexWrapper.getIndexTypes().remove( DbIndexTypeEnum.SUBSTR );
+                }
+            }
+            
+            System.out.println( indexWrapper );
+
+            // Last, update the subCheckbox state
             checkAndUpdateOkButtonEnableState();
         }
     };
@@ -239,15 +390,12 @@ public class IndexDialog extends Dialog
      * Creates a new instance of OverlayDialog.
      * 
      * @param parentShell the parent shell
-     * @param index the index
      * @param browserConnection the connection
      */
-    public IndexDialog( Shell parentShell, OlcDbIndex index, IBrowserConnection browserConnection )
+    public DbIndexDialog( Shell parentShell, IBrowserConnection browserConnection )
     {
         super( parentShell );
         super.setShellStyle( super.getShellStyle() | SWT.RESIZE );
-        this.index = index;
-        this.browserConnection = browserConnection;
     }
 
 
@@ -262,116 +410,22 @@ public class IndexDialog extends Dialog
 
 
     /**
-     * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
-     */
-    protected void createButtonsForButtonBar( Composite parent )
-    {
-        okButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
-        createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
-
-        checkAndUpdateOkButtonEnableState();
-    }
-
-
-    /**
-     * When the OK button is pressed, a list of actions is done :
-     * <ul>
-     * <li>- we create a new index</li>
-     * <li>- the attributes list is added to this instance</li>
-     * <li>- the index types are added</li>
-     * </ul>
-     * {@inheritDoc}
-     */
-    protected void okPressed()
-    {
-        // Creating the new index
-        newIndex = new OlcDbIndex();
-
-        // Default
-        if ( defaultCheckbox.getSelection() )
-        {
-            newIndex.setDefault( true );
-        }
-        else
-        {
-            // Attributes
-            if ( attributes.size() > 0 )
-            {
-                for ( String attribute : attributes )
-                {
-                    newIndex.addAttribute( attribute );
-                }
-            }
-        }
-
-        // Index types
-        if ( presCheckbox.getSelection() )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.PRES );
-        }
-        
-        if ( eqCheckbox.getSelection() )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.EQ );
-        }
-        
-        if ( approxCheckbox.getSelection() )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.APPROX );
-        }
-        
-        if ( ( subCheckbox.getSelection() ) && ( !subCheckbox.getGrayed() ) )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.SUB );
-        }
-        else
-        {
-            if ( subInitialCheckbox.getSelection() )
-            {
-                newIndex.addIndexType( OlcDbIndexTypeEnum.SUBINITIAL );
-            }
-            
-            if ( subAnyCheckbox.getSelection() )
-            {
-                newIndex.addIndexType( OlcDbIndexTypeEnum.SUBANY );
-            }
-            
-            if ( subFinalCheckbox.getSelection() )
-            {
-                newIndex.addIndexType( OlcDbIndexTypeEnum.SUBFINAL );
-            }
-        }
-        
-        if ( noLangCheckbox.getSelection() )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.NOLANG );
-        }
-        
-        if ( noSubtypesCheckbox.getSelection() )
-        {
-            newIndex.addIndexType( OlcDbIndexTypeEnum.NOSUBTYPES );
-        }
-
-        super.okPressed();
-    }
-
-
-    /**
      * Creates the IndexDialog, which has two groups : attributes and indices.
      * <pre>
      * +--------------------------------------------------+
      * |  Attributes                                      |
      * | .----------------------------------------------. |
-     * | |   +------------------------------+           | |
-     * | | o |                              | (Add...)  | |
-     * | |   |                              | (Delete)  | |
-     * | |   +------------------------------+           | |
-     * | | o Default                                    | |
+     * | |     +----------------------------+           | |
+     * | | (o) |                            | (Add...)  | |
+     * | |     |                            | (Delete)  | |
+     * | |     +----------------------------+           | |
+     * | | (o) Default                                  | |
      * | '----------------------------------------------' |
      * |  Indices                                         |
      * | .----------------------------------------------. |
      * | | [] pres        [] eq          [] approx      | |
-     * | | [] sub         [] nolang      [] nosubtypes  | |
+     * | | [] nolang      [] noSubtypes  [] notags      | |
+     * | | [] sub                                       | |
      * | |    [] subinitial                             | |
      * | |    [] subany                                 | |
      * | |    [] subfinal                               | |
@@ -393,7 +447,8 @@ public class IndexDialog extends Dialog
         createIndicesGroup( composite );
 
         // Load the dialog if this was an Edit call
-        initFromIndex();
+        initDialog();
+        //addListeners();
 
         applyDialogFont( composite );
         
@@ -406,11 +461,11 @@ public class IndexDialog extends Dialog
      * <pre>
      *   Attributes
      *  .----------------------------------------------.
-     *  |   +------------------------------+           |
-     *  | o |                              | (Add...)  |
-     *  |   |                              | (Delete)  |
-     *  |   +------------------------------+           |
-     *  | o Default                                    |
+     *  |     +----------------------------+           |
+     *  | (o) |                            | (Add...)  |
+     *  |     |                            | (Delete)  |
+     *  |     +----------------------------+           |
+     *  | (o) Default                                  |
      *  '----------------------------------------------'
      *
      * @param parent the parent composite
@@ -429,42 +484,15 @@ public class IndexDialog extends Dialog
         attributesCheckbox.setSelection( true );
         attributesCheckbox.addSelectionListener( attributesCheckboxSelectionListener );
 
-        Composite attributesComposite = new Composite( attributesGroup, SWT.NONE );
-        GridLayout attributesCompositeGridLayout = new GridLayout( 2, false );
-        attributesCompositeGridLayout.marginHeight = attributesCompositeGridLayout.marginWidth = 0;
-        attributesCompositeGridLayout.verticalSpacing = attributesCompositeGridLayout.horizontalSpacing = 0;
-        attributesComposite.setLayout( attributesCompositeGridLayout );
-        attributesComposite.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
-
-        // Table and Table Viewer
-        table = new Table( attributesComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
-        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 3 );
-        gd.heightHint = 20;
-        gd.widthHint = 100;
-        table.setLayoutData( gd );
-        tableViewer = new TableViewer( table );
-        tableViewer.setContentProvider( new ArrayContentProvider() );
-        tableViewer.setLabelProvider( new LabelProvider()
-        {
-            public Image getImage( Object element )
-            {
-                return OpenLdapConfigurationPlugin.getDefault().getImage(
-                    OpenLdapConfigurationPluginConstants.IMG_ATTRIBUTE );
-            }
-        } );
-        tableViewer.setInput( attributes );
-        tableViewer.addSelectionChangedListener( tableViewerSelectionChangedListener );
-
-        // Add Button
-        addButton = BaseWidgetUtils.createButton( attributesComposite, "Add...", 1 );
-        addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
-        addButton.addSelectionListener( addButtonSelectionListener );
-
-        // Delete Button
-        deleteButton = BaseWidgetUtils.createButton( attributesComposite, "Delete", 1 );
-        deleteButton.setEnabled( false );
-        deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );
-        deleteButton.addSelectionListener( deleteButtonSelectionListener );
+        // Attributes table
+        StringValueDecorator decorator = new StringValueDecorator( parent.getShell(), "Attribute" );
+        decorator.setImage( OpenLdapConfigurationPlugin.getDefault().getImage(
+                    OpenLdapConfigurationPluginConstants.IMG_ATTRIBUTE ) );
+        attributeTable = new TableWidget<StringValueWrapper>( decorator );
+
+        attributeTable.createWidgetNoEdit( attributesGroup, null );
+        attributeTable.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 1, 1 ) );
+        attributeTable.addWidgetModifyListener( attributeTableListener );
 
         // Attributes Checkbox
         defaultCheckbox = BaseWidgetUtils.createRadiobutton( attributesGroup, "  Default", 2 );
@@ -475,10 +503,11 @@ public class IndexDialog extends Dialog
     /**
      * Creates the indices group.
      * <pre>
-     *  Indices                                        
+     *  Indices
      * .----------------------------------------------.
      * | [] pres        [] eq          [] approx      |
-     * | [] sub         [] nolang      [] nosubtypes  |
+     * | [] nolang      [] noSubtypes  [] notags      |
+     * | [] sub                                       |
      * |    [] subinitial                             |
      * |    [] subany                                 |
      * |    [] subfinal                               |
@@ -497,27 +526,38 @@ public class IndexDialog extends Dialog
 
         // Pres Checkbox
         presCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "pres", 1 );
-        presCheckbox.addSelectionListener( checkOkButtonSelectionListener );
+        presCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.PRES.getNumber()] = presCheckbox;
 
         // Eq Checkbox
         eqCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "eq", 1 );
-        eqCheckbox.addSelectionListener( checkOkButtonSelectionListener );
+        eqCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.EQ.getNumber()] = eqCheckbox;
 
         // Approx Checkbox
         approxCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "approx", 1 );
-        approxCheckbox.addSelectionListener( checkOkButtonSelectionListener );
-
-        // Sub Checkbox
-        subCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "sub", 1 );
-        subCheckbox.addSelectionListener( subCheckboxSelectionListener );
+        approxCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.APPROX.getNumber()] = approxCheckbox;
 
         // NoLang Checkbox
         noLangCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "nolang", 1 );
-        noLangCheckbox.addSelectionListener( checkOkButtonSelectionListener );
+        noLangCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.NOLANG.getNumber()] = noLangCheckbox;
 
         // NoSybtypes Checkbox
         noSubtypesCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "nosubtypes", 1 );
-        noSubtypesCheckbox.addSelectionListener( checkOkButtonSelectionListener );
+        noSubtypesCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.NOSUBTYPES.getNumber()] = noSubtypesCheckbox;
+
+        // NoTags Checkbox
+        noTagsCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "notags", 1 );
+        noTagsCheckbox.addSelectionListener( typeButtonSelectionListener );
+        typeButtons[DbIndexTypeEnum.NOTAGS.getNumber()] = noTagsCheckbox;
+
+        // Sub Checkbox
+        subCheckbox = BaseWidgetUtils.createCheckbox( indicesGroup, "sub", 1 );
+        subCheckbox.addSelectionListener( subCheckboxSelectionListener );
+        typeButtons[DbIndexTypeEnum.SUB.getNumber()] = subCheckbox;
 
         // Sub Composite
         Composite subComposite = new Composite( indicesGroup, SWT.NONE );
@@ -529,28 +569,20 @@ public class IndexDialog extends Dialog
         // SubInitial Checkbox
         BaseWidgetUtils.createRadioIndent( subComposite, 1 );
         subInitialCheckbox = BaseWidgetUtils.createCheckbox( subComposite, "subinitial", 1 );
-        subInitialCheckbox.addSelectionListener( checkSubCheckboxSelectionListener );
+        subInitialCheckbox.addSelectionListener( subSubCheckboxSelectionListener );
+        typeButtons[DbIndexTypeEnum.SUBINITIAL.getNumber()] = subInitialCheckbox;
 
         // SubAny Checkbox
         BaseWidgetUtils.createRadioIndent( subComposite, 1 );
         subAnyCheckbox = BaseWidgetUtils.createCheckbox( subComposite, "subany", 1 );
-        subAnyCheckbox.addSelectionListener( checkSubCheckboxSelectionListener );
+        subAnyCheckbox.addSelectionListener( subSubCheckboxSelectionListener );
+        typeButtons[DbIndexTypeEnum.SUBANY.getNumber()] = subAnyCheckbox;
 
         // SubFinal Checkbox
         BaseWidgetUtils.createRadioIndent( subComposite, 1 );
         subFinalCheckbox = BaseWidgetUtils.createCheckbox( subComposite, "subfinal", 1 );
-        subFinalCheckbox.addSelectionListener( checkSubCheckboxSelectionListener );
-    }
-
-
-    /**
-     * Disables the attributes table and buttons.
-     */
-    private void disableAttributesTableAndButtons()
-    {
-        table.setEnabled( false );
-        addButton.setEnabled( false );
-        deleteButton.setEnabled( false );
+        subFinalCheckbox.addSelectionListener( subSubCheckboxSelectionListener );
+        typeButtons[DbIndexTypeEnum.SUBFINAL.getNumber()] = subFinalCheckbox;
     }
 
 
@@ -581,59 +613,114 @@ public class IndexDialog extends Dialog
         subCheckbox.setSelection( atLeastOneSelected );
     }
 
+    
+    private void initAttributeTable( Set<String> attributes )
+    {
+        List<StringValueWrapper> attributeWrappers = new ArrayList<StringValueWrapper>();
+
+        if ( attributes != null )
+        {
+            for ( String attribute : attributes )
+            {
+                attributeWrappers.add( new StringValueWrapper( attribute, false ) );
+            }
+        }
+
+        attributeTable.setElements( attributeWrappers );
+    }
+
 
     /**
-     * Inits the UI from the index
+     * Inits the UI from the DbIndexWrapper
      */
-    private void initFromIndex()
+    protected void initDialog()
     {
-        if ( index != null )
+        DbIndexWrapper editedElement = (DbIndexWrapper)getEditedElement();
+        
+        if ( editedElement != null )
         {
             // Attributes
-            List<String> attributes = index.getAttributes();
-
-            if ( ( attributes != null ) && ( attributes.size() > 0 ) )
-            {
-                this.attributes.addAll( attributes );
-                tableViewer.refresh();
-            }
+            initAttributeTable( editedElement.getAttributes() );
 
             // Default
-            if ( index.isDefault() )
+            if ( editedElement.isDefault() )
             {
                 attributesCheckbox.setSelection( false );
-                disableAttributesTableAndButtons();
+                attributeTable.disable();
                 defaultCheckbox.setSelection( true );
             }
 
             // Index types
-            List<OlcDbIndexTypeEnum> indexTypes = index.getIndexTypes();
+            Set<DbIndexTypeEnum> indexTypes = editedElement.getTypes();
 
             if ( ( indexTypes != null ) && ( indexTypes.size() > 0 ) )
             {
-                presCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.PRES ) );
-                eqCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.EQ ) );
-                approxCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.APPROX ) );
+                presCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.PRES ) );
+                eqCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.EQ ) );
+                approxCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.APPROX ) );
                 
-                if ( indexTypes.contains( OlcDbIndexTypeEnum.SUB ) )
+                if ( indexTypes.contains( DbIndexTypeEnum.SUB ) )
                 {
                     subCheckbox.setSelection( true );
-                    setSelectionForSubCheckboxes( indexTypes.contains( OlcDbIndexTypeEnum.SUB ) );
+                    setSelectionForSubCheckboxes( indexTypes.contains( DbIndexTypeEnum.SUB ) );
                 }
                 else
                 {
-                    subInitialCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.SUBINITIAL ) );
-                    subAnyCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.SUBANY ) );
-                    subFinalCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.SUBFINAL ) );
+                    subInitialCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.SUBINITIAL ) );
+                    subAnyCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.SUBANY ) );
+                    subFinalCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.SUBFINAL ) );
                     checkAndUpdateSubCheckboxSelectionState();
                 }
                 
-                noLangCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.NOLANG ) );
-                noSubtypesCheckbox.setSelection( indexTypes.contains( OlcDbIndexTypeEnum.NOSUBTYPES ) );
+                noLangCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.NOLANG ) );
+                noSubtypesCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.NOSUBTYPES ) );
+                noTagsCheckbox.setSelection( indexTypes.contains( DbIndexTypeEnum.NOTAGS ) );
             }
         }
     }
 
+    
+    /**
+     * Add a new Element that will be edited
+     */
+    protected void addNewElement( DbIndexWrapper editedElement )
+    {
+        DbIndexWrapper newElement = (DbIndexWrapper)editedElement.clone();
+        setEditedElement( newElement );
+    }
+
+
+    /**
+     * Add a new Element that will be edited
+     */
+    public void addNewElement()
+    {
+        setEditedElement( new DbIndexWrapper( "" ) );
+    }
+
+    
+    /**
+     * Overriding the createButton method. The OK button is not enabled until 
+     * 
+     * {@inheritDoc}
+     */
+    protected Button createButton(Composite parent, int id, String label, boolean defaultButton) 
+    {
+        Button button = super.createButton(parent, id, label, defaultButton);
+
+        if ( id == IDialogConstants.OK_ID ) 
+        {
+            DbIndexWrapper dbIndexWrapper = (DbIndexWrapper)getEditedElement();
+
+            if ( ( dbIndexWrapper == null ) || ( dbIndexWrapper.getAttributes().size() == 0 ) )
+            {
+                button.setEnabled( false );
+            }
+        }
+        
+        return button;
+    }
+
 
     /**
      * Checks and updates the OK button 'enable' state. For the OK button to be enabled, either
@@ -642,31 +729,25 @@ public class IndexDialog extends Dialog
      */
     private void checkAndUpdateOkButtonEnableState()
     {
-        boolean enableOkButton = true;
+        Button okButton = getButton( IDialogConstants.OK_ID );
 
         if ( defaultCheckbox.getSelection() )
         {
-            enableOkButton = presCheckbox.getSelection() || eqCheckbox.getSelection() || approxCheckbox.getSelection()
-                || subCheckbox.getSelection() || subInitialCheckbox.getSelection() || subAnyCheckbox.getSelection()
-                || subFinalCheckbox.getSelection() || noLangCheckbox.getSelection()
-                || noSubtypesCheckbox.getSelection();
+            okButton.setEnabled(
+                presCheckbox.getSelection() || 
+                eqCheckbox.getSelection() || 
+                approxCheckbox.getSelection() ||
+                subCheckbox.getSelection() || 
+                subInitialCheckbox.getSelection() || 
+                subAnyCheckbox.getSelection() ||
+                subFinalCheckbox.getSelection() || 
+                noLangCheckbox.getSelection() || 
+                noLangCheckbox.getSelection() ||
+                noSubtypesCheckbox.getSelection() );
         }
         else
         {
-            enableOkButton = attributes.size() > 0;
+            okButton.setEnabled( attributes.size() > 0 );
         }
-
-        okButton.setEnabled( enableOkButton );
-    }
-
-
-    /**
-     * Gets the new index.
-     *
-     * @return the new index
-     */
-    public OlcDbIndex getNewIndex()
-    {
-        return newIndex;
     }
 }

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/OrderedStringValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/OrderedStringValueDialog.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/OrderedStringValueDialog.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/OrderedStringValueDialog.java Fri Jul  3 15:51:57 2015
@@ -185,7 +185,6 @@ public class OrderedStringValueDialog ex
     }
 
 
-    @Override
     public void addNewElement( OrderedStringValueWrapper editedElement )
     {
         OrderedStringValueWrapper newElement = (OrderedStringValueWrapper)editedElement.clone();

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java Fri Jul  3 15:51:57 2015
@@ -394,9 +394,10 @@ public class SsfDialog extends AddEditDi
      */
     protected Button createButton(Composite parent, int id, String label, boolean defaultButton) 
     {
-        if (id == IDialogConstants.OK_ID) 
+        Button button = super.createButton( parent, id, label, defaultButton );
+
+        if ( id == IDialogConstants.OK_ID ) 
         {
-            Button okButton = super.createButton(parent, id, label, defaultButton);
             SsfWrapper ssfWrapper = (SsfWrapper)getEditedElement();
 
             if ( ssfWrapper != null )
@@ -405,17 +406,15 @@ public class SsfDialog extends AddEditDi
                 
                 if ( feature == SsfFeatureEnum.NONE )
                 {
-                    okButton.setEnabled( false );
+                    button.setEnabled( false );
                 }
             }
-            
-            return okButton;
-        }
-        else
-        {
-            return super.createButton(parent, id, label, defaultButton);
         }
+        
+        return button;
     }
+    
+    
     /**
      * Initializes the Dialog with the values
      */

Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java?rev=1689040&r1=1689039&r2=1689040&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java Fri Jul  3 15:51:57 2015
@@ -177,7 +177,6 @@ public class StringValueDialog extends A
     }
 
 
-    @Override
     public void addNewElement( StringValueWrapper editedElement )
     {
         StringValueWrapper newElement = (StringValueWrapper)editedElement.clone();

Added: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java?rev=1689040&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java (added)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java Fri Jul  3 15:51:57 2015
@@ -0,0 +1,103 @@
+/*
+ *  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.openldap.config.editor.wrappers;
+
+import org.apache.directory.studio.common.ui.TableDecorator;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.openldap.common.ui.model.DisallowFeatureEnum;
+import org.apache.directory.studio.openldap.config.editor.dialogs.DbIndexDialog;
+import org.apache.directory.studio.openldap.config.editor.dialogs.DisallowFeatureDialog;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A decorator for the DbIndex table.
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DbIndexDecorator extends TableDecorator<DbIndexWrapper>
+{
+    /**
+     * Create a new instance of DbIndexDecorator
+     * @param parentShell The parent Shell
+     */
+    public DbIndexDecorator( Shell parentShell, IBrowserConnection browserConnection )
+    {
+        setDialog( new DbIndexDialog( parentShell, browserConnection ) );
+    }
+
+    /**
+     * Construct the label for an DisallowFeature.
+     * 
+     */
+    public String getText( Object element )
+    {
+        if ( element instanceof DisallowFeatureEnum )
+        {
+            String disallowFeature = ( ( DisallowFeatureEnum ) element ).toString();
+
+            return disallowFeature;
+        }
+
+        return super.getText( element );
+    };
+
+
+    /**
+     * Get the image. We have none
+     * 
+     * {@inheritDoc}
+     */
+    public Image getImage( Object element )
+    {
+        return null;
+    };
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int compare( DbIndexWrapper e1, DbIndexWrapper e2 )
+    {
+        if ( e1 != null )
+        {
+            if ( e2 == null )
+            {
+                return 1;
+            }
+            else
+            {
+                return e1.compareTo( e2 );
+            }
+        }
+        else
+        {
+            if ( e2 == null )
+            {
+                return 0;
+            }
+            else
+            {
+                return 1;
+            }
+        }
+    }
+}



Mime
View raw message