directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1675833 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/databases/
Date Fri, 24 Apr 2015 13:17:01 GMT
Author: elecharny
Date: Fri Apr 24 13:17:01 2015
New Revision: 1675833

URL: http://svn.apache.org/r1675833
Log:
o Used the BaseWidgetUtils.createIntegerText() method
o Added the support of the olcSchemaDN, olcMonitoring and olcMaxDerefDepth attributes

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

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=1675833&r1=1675832&r2=1675833&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 Apr 24 13:17:01 2015
@@ -24,13 +24,12 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.api.util.Strings;
+import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -200,7 +199,7 @@ public class BerkeleyDbDatabaseSpecificD
 
         // Shared Memory Key Text
         toolkit.createLabel( databaseConfigurationComposite, "Shared Memory Key:" );
-        sharedMemoryKeyText = createIntegerText( toolkit, databaseConfigurationComposite
);
+        sharedMemoryKeyText = BaseWidgetUtils.createIntegerText( toolkit, databaseConfigurationComposite
);
         sharedMemoryKeyText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
     }
 
@@ -255,22 +254,22 @@ public class BerkeleyDbDatabaseSpecificD
 
         // Cache Size Text
         toolkit.createLabel( databaseCacheComposite, "Cache Size:" );
-        cacheSizeText = createIntegerText( toolkit, databaseCacheComposite );
+        cacheSizeText = BaseWidgetUtils.createIntegerText( toolkit, databaseCacheComposite
);
         cacheSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Cache Free Text
         toolkit.createLabel( databaseCacheComposite, "Cache Free:" );
-        cacheFreeText = createIntegerText( toolkit, databaseCacheComposite );
+        cacheFreeText = BaseWidgetUtils.createIntegerText( toolkit, databaseCacheComposite
);
         cacheFreeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // DN Cache Size Text
         toolkit.createLabel( databaseCacheComposite, "DN Cache Size:" );
-        dnCacheSizeText = createIntegerText( toolkit, databaseCacheComposite );
+        dnCacheSizeText = BaseWidgetUtils.createIntegerText( toolkit, databaseCacheComposite
);
         dnCacheSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // IDL Cache Size Text
         toolkit.createLabel( databaseCacheComposite, "IDL Cache Size:" );
-        idlCacheSizeText = createIntegerText( toolkit, databaseCacheComposite );
+        idlCacheSizeText = BaseWidgetUtils.createIntegerText( toolkit, databaseCacheComposite
);
         idlCacheSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
     }
 
@@ -294,7 +293,7 @@ public class BerkeleyDbDatabaseSpecificD
 
         // Search Stack Depth Text
         toolkit.createLabel( databaseLimitsComposite, "Search Stack Depth:" );
-        searchStackDepthText = createIntegerText( toolkit, databaseLimitsComposite );
+        searchStackDepthText = BaseWidgetUtils.createIntegerText( toolkit, databaseLimitsComposite
);
         searchStackDepthText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
 
         // Page Size Text
@@ -485,31 +484,6 @@ public class BerkeleyDbDatabaseSpecificD
     }
 
 
-    /**
-     * Creates a Text that can be used to enter an integer.
-     *
-     * @param toolkit the toolkit
-     * @param parent the parent
-     * @return a Text that can be used to enter a port number
-     */
-    protected Text createIntegerText( FormToolkit toolkit, Composite parent )
-    {
-        Text integerText = toolkit.createText( parent, "" ); //$NON-NLS-1$
-        integerText.addVerifyListener( new VerifyListener()
-        {
-            public void verifyText( VerifyEvent e )
-            {
-                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
-                {
-                    e.doit = false;
-                }
-            }
-        } );
-
-        return integerText;
-    }
-
-
     /**
      * {@inheritDoc}
      */

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=1675833&r1=1675832&r2=1675833&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 Apr 24 13:17:01 2015
@@ -23,13 +23,23 @@ package org.apache.directory.studio.open
 /**
  * The various Database types. One of :
  * <ul>
- * <li>DBD</li>
+ * <li>None</li>
+ * <li>Frontend DB</li>
+ * <li>Config DB</li>
+ * <li>BDB</li>
+ * <li>DB Perl</li>
+ * <li>DB_Socket</li>
  * <li>HDB</li>
  * <li>MDB</li>
  * <li>LDAP</li>
  * <li>LDIF</li>
+ * <li>META</li>
  * <li>MONITOR</li>
+ * <li>NDB</li>
+ * <li>PASSWORD</li>
  * <li>RELAY</li>
+ * <li>SHELL</li>
+ * <li>SQL DB</li>
  * <li>NULL</li>
  * </ul>
  *

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=1675833&r1=1675832&r2=1675833&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 Apr 24 13:17:01 2015
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.studio.common.ui.CommonUIUtils;
+import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
@@ -66,6 +67,7 @@ import org.eclipse.jface.viewers.TableVi
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -157,6 +159,9 @@ public class DatabasesDetailsPage implem
     /** The olcRootPW attribute */
     private PasswordWidget rootPasswordWidget;
 
+    /** The olcSchemaDN attribute */
+    private EntryWidget schemaDnEntryWidget;
+
     /** The olcReadOnly attribute */
     private BooleanWithDefaultWidget readOnlyBooleanWithDefaultWidget;
 
@@ -186,12 +191,18 @@ public class DatabasesDetailsPage implem
     /** The olcAddContentAcl flag */
     private BooleanWithDefaultWidget addContentAclBooleanWithDefaultWidget;
     
+    /** The olMonitoring flag */
+    private BooleanWithDefaultWidget monitoringBooleanWithDefaultWidget;
+    
     /** The Syncrepl consumer part */
     private TableViewer replicationConsumersTableViewer;
     private Button addReplicationConsumerButton;
     private Button editReplicationConsumerButton;
     private Button deleteReplicationConsumerButton;
 
+    /** The olcMaxDerefDepth parameter */
+    private Text maxDerefDepthText;
+
     // Listeners
     /**
      * A listener for changes on the Overlay table 
@@ -327,6 +338,7 @@ public class DatabasesDetailsPage implem
                         databaseSpecificDetailsBlock = new BerkeleyDbDatabaseSpecificDetailsBlock<OlcBdbConfig>(
                             instance, newBdbDatabase, browserConnection );
                         break;
+                        
                     case HDB:
                         OlcHdbConfig newHdbDatabase = new OlcHdbConfig();
                         copyDatabaseProperties( database, newHdbDatabase );
@@ -357,6 +369,7 @@ public class DatabasesDetailsPage implem
                     //                        databaseWrapper.setDatabase( newLdapDatabase
);
                     //                        // databaseSpecificDetailsBlock = new LdapDatabaseSpecificDetailsBlock(
newLdapDatabase ); // TODO
                     //                        break;
+                        
                     case NULL:
                         OlcNullConfig newNullDatabase = new OlcNullConfig();
                         copyDatabaseProperties( database, newNullDatabase );
@@ -364,6 +377,7 @@ public class DatabasesDetailsPage implem
                         databaseSpecificDetailsBlock = new NullDatabaseSpecificDetailsBlock(
instance,
                             newNullDatabase );
                         break;
+                        
                     case RELAY:
                         OlcRelayConfig newRelayDatabase = new OlcRelayConfig();
                         copyDatabaseProperties( database, newRelayDatabase );
@@ -371,12 +385,14 @@ public class DatabasesDetailsPage implem
                         databaseSpecificDetailsBlock = new RelayDatabaseSpecificDetailsBlock(
instance,
                             newRelayDatabase, browserConnection );
                         break;
+                        
                     case NONE:
                         OlcDatabaseConfig newNoneDatabase = new OlcDatabaseConfig();
                         copyDatabaseProperties( database, newNoneDatabase );
                         databaseWrapper.setDatabase( newNoneDatabase );
                         databaseSpecificDetailsBlock = null;
                         break;
+                        
                     default:
                         break;
                 }
@@ -398,6 +414,17 @@ public class DatabasesDetailsPage implem
             setEditorDirty();
         }
     };
+    
+    /**
+     * A modify listener for text zones when they have been modified
+     */
+    protected ModifyListener dirtyModifyListener = new ModifyListener()
+    {
+        public void modifyText( ModifyEvent e )
+        {
+            setEditorDirty();
+        }
+    };
 
 
     /**
@@ -515,6 +542,19 @@ public class DatabasesDetailsPage implem
         rootPasswordTextDecoration
             .setDescriptionText( "The password for the the Root DN." );
 
+        // Schema DN
+        toolkit.createLabel( composite, "Schema DN:" );
+        schemaDnEntryWidget = new EntryWidget( browserConnection, null, true );
+        schemaDnEntryWidget.createWidget( composite, toolkit );
+        schemaDnEntryWidget.getControl().setLayoutData( new GridData( SWT.FILL, SWT.NONE,
true, false ) );
+        ControlDecoration schemaDnTextDecoration = new ControlDecoration( schemaDnEntryWidget.getControl(),
SWT.CENTER
+            | SWT.RIGHT );
+        schemaDnTextDecoration.setImage( OpenLdapConfigurationPlugin.getDefault().getImageDescriptor(
+            OpenLdapConfigurationPluginConstants.IMG_INFORMATION ).createImage() );
+        schemaDnTextDecoration.setMarginWidth( 4 );
+        schemaDnTextDecoration.setDescriptionText( 
+            "Specify the distinguished name for the subschema subentry that controls the
entries on this server" );
+
         // Read Only
         toolkit.createLabel( composite, "Read Only:" );
         readOnlyBooleanWithDefaultWidget = new BooleanWithDefaultWidget();
@@ -586,7 +626,7 @@ public class DatabasesDetailsPage implem
         lastModCheckboxDecoration.setDescriptionText( "Controls whether slapd will automatically
maintain the modifiersName, modifyTimestamp, creatorsName, and createTimestamp attributes
for entries" );
         
         // The olcAddAclContent parameter : Controls whether Add operations will perform
ACL checks on the content of the entry being added
-        toolkit.createLabel( composite, "Last Modifier:" );
+        toolkit.createLabel( composite, "Add Acl Check:" );
         addContentAclBooleanWithDefaultWidget = new BooleanWithDefaultWidget();
         addContentAclBooleanWithDefaultWidget.create( composite, toolkit );
         addContentAclBooleanWithDefaultWidget.setValue( false );
@@ -597,6 +637,25 @@ public class DatabasesDetailsPage implem
             OpenLdapConfigurationPluginConstants.IMG_INFORMATION ).createImage() );
         addAclContentCheckboxDecoration.setMarginWidth( 4 );
         addAclContentCheckboxDecoration.setDescriptionText( "Controls whether Add operations
will perform ACL checks on the content of the entry being added" );
+        
+        // The olcMonitoring parameter
+        toolkit.createLabel( composite, "Monitoring:" );
+        monitoringBooleanWithDefaultWidget = new BooleanWithDefaultWidget();
+        monitoringBooleanWithDefaultWidget.create( composite, toolkit );
+        monitoringBooleanWithDefaultWidget.setValue( false );
+        monitoringBooleanWithDefaultWidget.getControl().setLayoutData( new GridData( SWT.FILL,
SWT.NONE, true, false ) );
+        ControlDecoration monitoringCheckboxDecoration = new ControlDecoration(
+            monitoringBooleanWithDefaultWidget.getControl(), SWT.CENTER | SWT.RIGHT );
+        monitoringCheckboxDecoration.setImage( OpenLdapConfigurationPlugin.getDefault().getImageDescriptor(
+            OpenLdapConfigurationPluginConstants.IMG_INFORMATION ).createImage() );
+        monitoringCheckboxDecoration.setMarginWidth( 4 );
+        monitoringCheckboxDecoration.setDescriptionText( "Controls whether monitoring is
enabled for this database" );
+        
+        // The olcMaxDerefDepth parameter
+        toolkit.createLabel( composite, "Max Deref. Depth:" );
+        maxDerefDepthText = BaseWidgetUtils.createIntegerText( toolkit, composite, 
+                "Specifies the maximum number of aliases to dereference when trying to resolve
an entry" );
+        maxDerefDepthText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false )
);
     }
 
 
@@ -849,6 +908,9 @@ public class DatabasesDetailsPage implem
             {
                 database.setOlcRootPW( rootPassword );
             }
+            
+            // Schema DN
+            database.setOlcSchemaDN( schemaDnEntryWidget.getDn() );
 
             // Read Only
             database.setOlcReadOnly( readOnlyBooleanWithDefaultWidget.getValue() );
@@ -876,6 +938,18 @@ public class DatabasesDetailsPage implem
             
             // AddAclContent
             database.setOlcAddContentAcl( addContentAclBooleanWithDefaultWidget.getValue()
);
+            
+            // Monitoring
+            if ( ( database instanceof OlcHdbConfig ) || ( database instanceof OlcBdbConfig
) )
+            {
+                database.setOlcMonitoring( monitoringBooleanWithDefaultWidget.getValue()
);
+            }
+            
+            // MaxDerefDepth
+            if ( ( maxDerefDepthText.getText() != null ) && ( maxDerefDepthText.getText().length()
> 0 ) )
+            {
+                database.setOlcMaxDerefDepth( Integer.parseInt( maxDerefDepthText.getText()
) );
+            }
         }
     }
 
@@ -952,6 +1026,7 @@ public class DatabasesDetailsPage implem
                 suffixEntryWidget.setEnabled( false );
                 rootDnEntryWidget.setEnabled( false );
                 rootPasswordWidget.setEnabled( false );
+                schemaDnEntryWidget.setEnabled( false );
                 readOnlyBooleanWithDefaultWidget.setEnabled( false );
                 hiddenBooleanWithDefaultWidget.setEnabled( false );
                 mirrorModeBooleanWithDefaultWidget.setEnabled( false );
@@ -964,6 +1039,8 @@ public class DatabasesDetailsPage implem
 
                 lastModBooleanWithDefaultWidget.setEnabled( false );
                 addContentAclBooleanWithDefaultWidget.setEnabled( false );
+                monitoringBooleanWithDefaultWidget.setEnabled( false );
+                maxDerefDepthText.setEnabled( false );
             }
             else if ( isConfigDatabase( database ) )
             {
@@ -971,6 +1048,7 @@ public class DatabasesDetailsPage implem
                 suffixEntryWidget.setEnabled( false );
                 rootDnEntryWidget.setEnabled( true );
                 rootPasswordWidget.setEnabled( true );
+                schemaDnEntryWidget.setEnabled( true );
                 readOnlyBooleanWithDefaultWidget.setEnabled( false );
                 hiddenBooleanWithDefaultWidget.setEnabled( false );
                 mirrorModeBooleanWithDefaultWidget.setEnabled( true );
@@ -983,6 +1061,8 @@ public class DatabasesDetailsPage implem
                 
                 lastModBooleanWithDefaultWidget.setEnabled( false );
                 addContentAclBooleanWithDefaultWidget.setEnabled( false );
+                monitoringBooleanWithDefaultWidget.setEnabled( false );
+                maxDerefDepthText.setEnabled( false );
             }
             else
             {
@@ -990,6 +1070,7 @@ public class DatabasesDetailsPage implem
                 suffixEntryWidget.setEnabled( true );
                 rootDnEntryWidget.setEnabled( true );
                 rootPasswordWidget.setEnabled( true );
+                schemaDnEntryWidget.setEnabled( true );
                 readOnlyBooleanWithDefaultWidget.setEnabled( true );
                 hiddenBooleanWithDefaultWidget.setEnabled( true );
                 mirrorModeBooleanWithDefaultWidget.setEnabled( true );
@@ -1002,6 +1083,17 @@ public class DatabasesDetailsPage implem
                 
                 lastModBooleanWithDefaultWidget.setEnabled( true );
                 addContentAclBooleanWithDefaultWidget.setEnabled( true );
+                
+                if ( ( database instanceof OlcHdbConfig ) || ( database instanceof OlcBdbConfig
) )
+                {
+                    monitoringBooleanWithDefaultWidget.setEnabled( true );
+                }
+                else
+                {
+                    monitoringBooleanWithDefaultWidget.setEnabled( false );
+                }
+                
+                maxDerefDepthText.setEnabled( true );
             }
 
             // Suffixes
@@ -1045,6 +1137,14 @@ public class DatabasesDetailsPage implem
             // AddAclContent
             addContentAclBooleanWithDefaultWidget.setValue( database.getOlcAddContentAcl()
);
 
+            // Monitoring
+            if ( ( database instanceof OlcHdbConfig ) || ( database instanceof OlcBdbConfig
) )
+            {
+                monitoringBooleanWithDefaultWidget.setValue( database.getOlcMonitoring()
);
+            }
+            
+            maxDerefDepthText.setText( database.getOlcMaxDerefDepth() == null ? "" : Integer.toString(
database.getOlcMaxDerefDepth() ) );
+
             // Overlays
             refreshOverlaysTableViewer();
 
@@ -1204,6 +1304,7 @@ public class DatabasesDetailsPage implem
         addModifyListener( suffixEntryWidget, dirtyWidgetModifyListener );
         addModifyListener( rootDnEntryWidget, dirtyWidgetModifyListener );
         addModifyListener( rootPasswordWidget, dirtyWidgetModifyListener );
+        addModifyListener( schemaDnEntryWidget, dirtyWidgetModifyListener );
         addModifyListener( readOnlyBooleanWithDefaultWidget, dirtyWidgetModifyListener );
         addModifyListener( hiddenBooleanWithDefaultWidget, dirtyWidgetModifyListener );
         addModifyListener( mirrorModeBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
@@ -1215,6 +1316,8 @@ public class DatabasesDetailsPage implem
 
         addModifyListener( lastModBooleanWithDefaultWidget, dirtyWidgetModifyListener );
         addModifyListener( addContentAclBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
+        addModifyListener( monitoringBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
+        maxDerefDepthText.addModifyListener( dirtyModifyListener );
 
         addSelectionChangedListener( databaseTypeComboViewer, databaseTypeComboViewerSelectionChangedListener
);
 
@@ -1241,6 +1344,7 @@ public class DatabasesDetailsPage implem
         removeModifyListener( suffixEntryWidget, dirtyWidgetModifyListener );
         removeModifyListener( rootDnEntryWidget, dirtyWidgetModifyListener );
         removeModifyListener( rootPasswordWidget, dirtyWidgetModifyListener );
+        removeModifyListener( schemaDnEntryWidget, dirtyWidgetModifyListener );
         removeModifyListener( readOnlyBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
         removeModifyListener( hiddenBooleanWithDefaultWidget, dirtyWidgetModifyListener );
         removeModifyListener( mirrorModeBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
@@ -1252,6 +1356,8 @@ public class DatabasesDetailsPage implem
 
         removeModifyListener( lastModBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
         removeModifyListener( addContentAclBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
+        removeModifyListener( monitoringBooleanWithDefaultWidget, dirtyWidgetModifyListener
);
+        maxDerefDepthText.removeModifyListener( dirtyModifyListener );
 
         removeSelectionChangedListener( databaseTypeComboViewer, databaseTypeComboViewerSelectionChangedListener
);
 

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=1675833&r1=1675832&r2=1675833&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 Apr 24 13:17:01 2015
@@ -21,6 +21,7 @@ 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.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.openldap.config.model.database.OlcMdbConfig;
 import org.apache.directory.studio.openldap.config.model.widgets.IndicesWidget;
@@ -28,8 +29,6 @@ import org.apache.directory.studio.openl
 import org.apache.directory.studio.openldap.common.ui.widgets.DirectoryBrowserWidget;
 import org.apache.directory.studio.openldap.common.ui.widgets.UnixPermissionsWidget;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -244,25 +243,25 @@ public class MdbDatabaseSpecificDetailsB
 
         // Max Readers Text
         toolkit.createLabel( databaseLimitsComposite, "Maximum Readers:" );
-        maxReadersText = createIntegerText( toolkit, databaseLimitsComposite );
+        maxReadersText = BaseWidgetUtils.createIntegerText( toolkit, databaseLimitsComposite
);
         maxReadersText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Max Size Text
         toolkit.createLabel( databaseLimitsComposite, "Maximum Size:" );
-        maxSizeText = createIntegerText( toolkit, databaseLimitsComposite );
+        maxSizeText = BaseWidgetUtils.createIntegerText( toolkit, databaseLimitsComposite
);
         maxSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         if ( browserConnection.getSchema().hasAttributeTypeDescription( "olcDbMaxEntrySize"
) )
         {
             // Max Entry Size Text
             toolkit.createLabel( databaseLimitsComposite, "Maximum Entry Size:" );
-            maxEntrySizeText = createIntegerText( toolkit, databaseLimitsComposite );
+            maxEntrySizeText = BaseWidgetUtils.createIntegerText( toolkit, databaseLimitsComposite
);
             maxEntrySizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
         }
 
         // Search Stack Depth Text
         toolkit.createLabel( databaseLimitsComposite, "Search Stack Depth:" );
-        searchStackDepthText = createIntegerText( toolkit, databaseLimitsComposite );
+        searchStackDepthText = BaseWidgetUtils.createIntegerText( toolkit, databaseLimitsComposite
);
         searchStackDepthText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
 
         // Checkpoint Text
@@ -399,31 +398,6 @@ public class MdbDatabaseSpecificDetailsB
     }
 
 
-    /**
-     * Creates a Text that can be used to enter an integer.
-     *
-     * @param toolkit the toolkit
-     * @param parent the parent
-     * @return a Text that can be used to enter a port number
-     */
-    protected Text createIntegerText( FormToolkit toolkit, Composite parent )
-    {
-        Text integerText = toolkit.createText( parent, "" ); //$NON-NLS-1$
-        integerText.addVerifyListener( new VerifyListener()
-        {
-            public void verifyText( VerifyEvent e )
-            {
-                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
-                {
-                    e.doit = false;
-                }
-            }
-        } );
-
-        return integerText;
-    }
-
-
     /**
      * {@inheritDoc}
      */



Mime
View raw message