directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1499028 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/
Date Tue, 02 Jul 2013 17:27:07 GMT
Author: pamarcelot
Date: Tue Jul  2 17:27:06 2013
New Revision: 1499028

URL: http://svn.apache.org/r1499028
Log:
Fix for DIRSTUDIO-932 (NPE while importing an ApacheDS 2.0 configuration from within the editor)

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationMasterDetailsBlock.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/KerberosServerPage.java
Tue Jul  2 17:27:06 2013
@@ -486,50 +486,53 @@ public class KerberosServerPage extends 
      */
     protected void refreshUI()
     {
-        removeListeners();
-
-        // Kerberos Server
-        KdcServerBean kdcServerBean = getKdcServerBean();
-        setSelection( enableKerberosCheckbox, kdcServerBean.isEnabled() );
-        setEnabled( kerberosPortText, enableKerberosCheckbox.getSelection() );
-        setText( kerberosPortText, "" + getKdcServerTransportBean().getSystemPort() ); //$NON-NLS-1$
-
-        // Change Password Checkbox
-        ChangePasswordServerBean changePasswordServerBean = getChangePasswordServerBean();
-        setSelection( enableChangePasswordCheckbox, changePasswordServerBean.isEnabled()
);
-        setEnabled( changePasswordPortText, enableChangePasswordCheckbox.getSelection() );
-        setText( changePasswordPortText, "" + getChangePasswordServerTransportBean().getSystemPort()
); //$NON-NLS-1$
-
-        // Kerberos Settings
-        setText( primaryKdcRealmText, kdcServerBean.getKrbPrimaryRealm() );
-        setText( kdcSearchBaseDnText, kdcServerBean.getSearchBaseDn().toString() );
-
-        // Encryption Types
-        List<String> encryptionTypesNames = kdcServerBean.getKrbEncryptionTypes();
-        List<EncryptionType> encryptionTypes = new ArrayList<EncryptionType>();
-        for ( String encryptionTypesName : encryptionTypesNames )
+        if ( isInitialized() )
         {
-            EncryptionType encryptionType = EncryptionType.getByName( encryptionTypesName
);
+            removeListeners();
 
-            if ( !EncryptionType.UNKNOWN.equals( encryptionType ) )
+            // Kerberos Server
+            KdcServerBean kdcServerBean = getKdcServerBean();
+            setSelection( enableKerberosCheckbox, kdcServerBean.isEnabled() );
+            setEnabled( kerberosPortText, enableKerberosCheckbox.getSelection() );
+            setText( kerberosPortText, "" + getKdcServerTransportBean().getSystemPort() );
//$NON-NLS-1$
+
+            // Change Password Checkbox
+            ChangePasswordServerBean changePasswordServerBean = getChangePasswordServerBean();
+            setSelection( enableChangePasswordCheckbox, changePasswordServerBean.isEnabled()
);
+            setEnabled( changePasswordPortText, enableChangePasswordCheckbox.getSelection()
);
+            setText( changePasswordPortText, "" + getChangePasswordServerTransportBean().getSystemPort()
); //$NON-NLS-1$
+
+            // Kerberos Settings
+            setText( primaryKdcRealmText, kdcServerBean.getKrbPrimaryRealm() );
+            setText( kdcSearchBaseDnText, kdcServerBean.getSearchBaseDn().toString() );
+
+            // Encryption Types
+            List<String> encryptionTypesNames = kdcServerBean.getKrbEncryptionTypes();
+            List<EncryptionType> encryptionTypes = new ArrayList<EncryptionType>();
+            for ( String encryptionTypesName : encryptionTypesNames )
             {
-                encryptionTypes.add( encryptionType );
+                EncryptionType encryptionType = EncryptionType.getByName( encryptionTypesName
);
+
+                if ( !EncryptionType.UNKNOWN.equals( encryptionType ) )
+                {
+                    encryptionTypes.add( encryptionType );
+                }
             }
-        }
-        encryptionTypesTableViewer.setCheckedElements( encryptionTypes.toArray() );
+            encryptionTypesTableViewer.setCheckedElements( encryptionTypes.toArray() );
 
-        // Ticket Settings
-        setSelection( verifyBodyChecksumCheckbox, kdcServerBean.isKrbBodyChecksumVerified()
);
-        setSelection( allowEmptyAddressesCheckbox, kdcServerBean.isKrbEmptyAddressesAllowed()
);
-        setSelection( allowForwardableAddressesCheckbox, kdcServerBean.isKrbForwardableAllowed()
);
-        setSelection( requirePreAuthByEncryptedTimestampCheckbox, kdcServerBean.isKrbPaEncTimestampRequired()
);
-        setSelection( allowPostdatedTicketsCheckbox, kdcServerBean.isKrbPostdatedAllowed()
);
-        setSelection( allowRenewableTicketsCheckbox, kdcServerBean.isKrbRenewableAllowed()
);
-        setText( maximumRenewableLifetimeText, kdcServerBean.getKrbMaximumRenewableLifetime()
+ "" ); //$NON-NLS-1$
-        setText( maximumTicketLifetimeText, kdcServerBean.getKrbMaximumTicketLifetime() +
"" ); //$NON-NLS-1$
-        setText( allowableClockSkewText, kdcServerBean.getKrbAllowableClockSkew() + "" );
//$NON-NLS-1$
+            // Ticket Settings
+            setSelection( verifyBodyChecksumCheckbox, kdcServerBean.isKrbBodyChecksumVerified()
);
+            setSelection( allowEmptyAddressesCheckbox, kdcServerBean.isKrbEmptyAddressesAllowed()
);
+            setSelection( allowForwardableAddressesCheckbox, kdcServerBean.isKrbForwardableAllowed()
);
+            setSelection( requirePreAuthByEncryptedTimestampCheckbox, kdcServerBean.isKrbPaEncTimestampRequired()
);
+            setSelection( allowPostdatedTicketsCheckbox, kdcServerBean.isKrbPostdatedAllowed()
);
+            setSelection( allowRenewableTicketsCheckbox, kdcServerBean.isKrbRenewableAllowed()
);
+            setText( maximumRenewableLifetimeText, kdcServerBean.getKrbMaximumRenewableLifetime()
+ "" ); //$NON-NLS-1$
+            setText( maximumTicketLifetimeText, kdcServerBean.getKrbMaximumTicketLifetime()
+ "" ); //$NON-NLS-1$
+            setText( allowableClockSkewText, kdcServerBean.getKrbAllowableClockSkew() + ""
); //$NON-NLS-1$
 
-        addListeners();
+            addListeners();
+        }
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/LdapLdapsServersPage.java
Tue Jul  2 17:27:06 2013
@@ -1122,111 +1122,116 @@ public class LdapLdapsServersPage extend
      */
     protected void refreshUI()
     {
-        removeListeners();
-
-        // LDAP Server
-        TransportBean ldapServerTransportBean = getLdapServerTransportBean();
-        setSelection( enableLdapCheckbox, ldapServerTransportBean.isEnabled() );
-        setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
-        setText( ldapPortText, ldapServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
-
-        // LDAPS Server
-        TransportBean ldapsServerTransportBean = getLdapsServerTransportBean();
-        setSelection( enableLdapsCheckbox, ldapsServerTransportBean.isEnabled() );
-        setEnabled( enableLdapsCheckbox, enableLdapsCheckbox.getSelection() );
-        setText( ldapsPortText, ldapsServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
-
-        // SASL Properties
-        LdapServerBean ldapServerBean = getLdapServerBean();
-        setText( saslHostText, ldapServerBean.getLdapServerSaslHost() );
-        setText( saslPrincipalText, ldapServerBean.getLdapServerSaslPrincipal() );
-        setText( saslSearchBaseDnText, ldapServerBean.getSearchBaseDn().toString() );
-
-        // Keystore Properties
-        setText( keystoreFileText, ldapServerBean.getLdapServerKeystoreFile() );
-        setText( keystorePasswordText, ldapServerBean.getLdapServerCertificatePassword()
);
-
-        // Supported Auth Mechanisms
-        List<SaslMechHandlerBean> saslMechHandlers = ldapServerBean.getSaslMechHandlers();
-        uncheckAllSupportedAuthenticationMechanisms();
-        for ( SaslMechHandlerBean saslMechHandler : saslMechHandlers )
+        if ( isInitialized() )
         {
-            if ( SASL_MECHANISMS_SIMPLE.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
-            {
-                setSelection( authMechSimpleCheckbox, saslMechHandler.isEnabled() );
-            }
-            else if ( SupportedSaslMechanisms.GSSAPI.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
-            {
-                setSelection( authMechGssapiCheckbox, saslMechHandler.isEnabled() );
-            }
-            else if ( SupportedSaslMechanisms.CRAM_MD5.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
-            {
-                setSelection( authMechCramMd5Checkbox, saslMechHandler.isEnabled() );
-            }
-            else if ( SupportedSaslMechanisms.DIGEST_MD5.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
-            {
-                setSelection( authMechDigestMd5Checkbox, saslMechHandler.isEnabled() );
-            }
-            else if ( SupportedSaslMechanisms.GSS_SPNEGO.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
-            {
-                setSelection( authMechGssSpnegoCheckbox, saslMechHandler.isEnabled() );
-                setEnabled( authMechGssSpnegoText, saslMechHandler.isEnabled() );
-                setText( authMechGssSpnegoText, saslMechHandler.getNtlmMechProvider() );
-            }
-            else if ( SupportedSaslMechanisms.NTLM.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+            removeListeners();
+
+            // LDAP Server
+            TransportBean ldapServerTransportBean = getLdapServerTransportBean();
+            setSelection( enableLdapCheckbox, ldapServerTransportBean.isEnabled() );
+            setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
+            setText( ldapPortText, ldapServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+
+            // LDAPS Server
+            TransportBean ldapsServerTransportBean = getLdapsServerTransportBean();
+            setSelection( enableLdapsCheckbox, ldapsServerTransportBean.isEnabled() );
+            setEnabled( enableLdapsCheckbox, enableLdapsCheckbox.getSelection() );
+            setText( ldapsPortText, ldapsServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+
+            // SASL Properties
+            LdapServerBean ldapServerBean = getLdapServerBean();
+            setText( saslHostText, ldapServerBean.getLdapServerSaslHost() );
+            setText( saslPrincipalText, ldapServerBean.getLdapServerSaslPrincipal() );
+            setText( saslSearchBaseDnText, ldapServerBean.getSearchBaseDn().toString() );
+
+            // Keystore Properties
+            setText( keystoreFileText, ldapServerBean.getLdapServerKeystoreFile() );
+            setText( keystorePasswordText, ldapServerBean.getLdapServerCertificatePassword()
);
+
+            // Supported Auth Mechanisms
+            List<SaslMechHandlerBean> saslMechHandlers = ldapServerBean.getSaslMechHandlers();
+            uncheckAllSupportedAuthenticationMechanisms();
+            for ( SaslMechHandlerBean saslMechHandler : saslMechHandlers )
             {
-                setSelection( authMechNtlmCheckbox, saslMechHandler.isEnabled() );
-                setEnabled( authMechNtlmText, saslMechHandler.isEnabled() );
-                setText( authMechNtlmText, saslMechHandler.getNtlmMechProvider() );
+                if ( SASL_MECHANISMS_SIMPLE.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechSimpleCheckbox, saslMechHandler.isEnabled() );
+                }
+                else if ( SupportedSaslMechanisms.GSSAPI.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechGssapiCheckbox, saslMechHandler.isEnabled() );
+                }
+                else if ( SupportedSaslMechanisms.CRAM_MD5.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechCramMd5Checkbox, saslMechHandler.isEnabled() );
+                }
+                else if ( SupportedSaslMechanisms.DIGEST_MD5.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechDigestMd5Checkbox, saslMechHandler.isEnabled()
);
+                }
+                else if ( SupportedSaslMechanisms.GSS_SPNEGO.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechGssSpnegoCheckbox, saslMechHandler.isEnabled()
);
+                    setEnabled( authMechGssSpnegoText, saslMechHandler.isEnabled() );
+                    setText( authMechGssSpnegoText, saslMechHandler.getNtlmMechProvider()
);
+                }
+                else if ( SupportedSaslMechanisms.NTLM.equalsIgnoreCase( saslMechHandler.getSaslMechName()
) )
+                {
+                    setSelection( authMechNtlmCheckbox, saslMechHandler.isEnabled() );
+                    setEnabled( authMechNtlmText, saslMechHandler.isEnabled() );
+                    setText( authMechNtlmText, saslMechHandler.getNtlmMechProvider() );
+                }
             }
-        }
 
-        // Limits
-        setText( maxTimeLimitText, "" + ldapServerBean.getLdapServerMaxTimeLimit() ); //$NON-NLS-1$
-        setText( maxSizeLimitText, "" + ldapServerBean.getLdapServerMaxSizeLimit() ); //$NON-NLS-1$
-
-        // Enable TLS Checkbox
-        setSelection( enableTlsCheckbox, getTlsExtendedOpHandlerBean().isEnabled() );
-
-        // Hashing Password widgets
-        InterceptorBean hashingMethodInterceptor = getHashingPasswordInterceptor();
-        if ( hashingMethodInterceptor == null )
-        {
-            // No hashing method interceptor
-            setSelection( enableServerSidePasswordHashingCheckbox, false );
-            setEnabled( hashingMethodComboViewer.getCombo(), enableServerSidePasswordHashingCheckbox.getSelection()
);
-            setSelection( hashingMethodComboViewer, LdapSecurityConstants.HASH_METHOD_SSHA
);
-        }
-        else
-        {
-            LdapSecurityConstants hashingMethod = getHashingMethodFromInterceptor( hashingMethodInterceptor
);
-            if ( hashingMethod != null )
+            // Limits
+            setText( maxTimeLimitText, "" + ldapServerBean.getLdapServerMaxTimeLimit() );
//$NON-NLS-1$
+            setText( maxSizeLimitText, "" + ldapServerBean.getLdapServerMaxSizeLimit() );
//$NON-NLS-1$
+
+            // Enable TLS Checkbox
+            setSelection( enableTlsCheckbox, getTlsExtendedOpHandlerBean().isEnabled() );
+
+            // Hashing Password widgets
+            InterceptorBean hashingMethodInterceptor = getHashingPasswordInterceptor();
+            if ( hashingMethodInterceptor == null )
             {
-                // Setting selection for the hashing method
-                setSelection( enableServerSidePasswordHashingCheckbox, hashingMethodInterceptor.isEnabled()
);
+                // No hashing method interceptor
+                setSelection( enableServerSidePasswordHashingCheckbox, false );
                 setEnabled( hashingMethodComboViewer.getCombo(), enableServerSidePasswordHashingCheckbox.getSelection()
);
-                setSelection( hashingMethodComboViewer, hashingMethod );
+                setSelection( hashingMethodComboViewer, LdapSecurityConstants.HASH_METHOD_SSHA
);
             }
             else
             {
-                // Couldn't determine which hashing method is used
-                setSelection( enableServerSidePasswordHashingCheckbox, false );
-                setEnabled( hashingMethodComboViewer.getCombo(), enableServerSidePasswordHashingCheckbox.getSelection()
);
-                setSelection( hashingMethodComboViewer, LdapSecurityConstants.HASH_METHOD_SSHA
);
+                LdapSecurityConstants hashingMethod = getHashingMethodFromInterceptor( hashingMethodInterceptor
);
+                if ( hashingMethod != null )
+                {
+                    // Setting selection for the hashing method
+                    setSelection( enableServerSidePasswordHashingCheckbox, hashingMethodInterceptor.isEnabled()
);
+                    setEnabled( hashingMethodComboViewer.getCombo(),
+                        enableServerSidePasswordHashingCheckbox.getSelection() );
+                    setSelection( hashingMethodComboViewer, hashingMethod );
+                }
+                else
+                {
+                    // Couldn't determine which hashing method is used
+                    setSelection( enableServerSidePasswordHashingCheckbox, false );
+                    setEnabled( hashingMethodComboViewer.getCombo(),
+                        enableServerSidePasswordHashingCheckbox.getSelection() );
+                    setSelection( hashingMethodComboViewer, LdapSecurityConstants.HASH_METHOD_SSHA
);
+                }
             }
-        }
 
-        // SSL/Start TLS Cipher Suites
-        cipherSuitesTableViewer.setInput( ldapServerBean.getEnabledCipherSuites() );
-        cipherSuitesTableViewer.refresh();
+            // SSL/Start TLS Cipher Suites
+            cipherSuitesTableViewer.setInput( ldapServerBean.getEnabledCipherSuites() );
+            cipherSuitesTableViewer.refresh();
 
-        // Replication Pinger Sleep
-        setText( replicationPingerSleepText, "" + ldapServerBean.getReplPingerSleep() );
//$NON-NLS-1$
+            // Replication Pinger Sleep
+            setText( replicationPingerSleepText, "" + ldapServerBean.getReplPingerSleep()
); //$NON-NLS-1$
 
-        // Disk Synchronization Delay
-        setText( diskSynchronizationDelayText, "" + getDirectoryServiceBean().getDsSyncPeriodMillis()
); //$NON-NLS-1$
+            // Disk Synchronization Delay
+            setText( diskSynchronizationDelayText, "" + getDirectoryServiceBean().getDsSyncPeriodMillis()
); //$NON-NLS-1$
 
-        addListeners();
+            addListeners();
+        }
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
Tue Jul  2 17:27:06 2013
@@ -512,53 +512,57 @@ public class OverviewPage extends Server
      */
     protected void refreshUI()
     {
-        removeListeners();
-
-        DirectoryServiceBean directoryServiceBean = getDirectoryServiceBean();
-
-        // LDAP Server
-        TransportBean ldapServerTransportBean = LdapLdapsServersPage.getLdapServerTransportBean(
directoryServiceBean );
-        setSelection( enableLdapCheckbox, ldapServerTransportBean.isEnabled() );
-        setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
-        setText( ldapPortText, ldapServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
-
-        // LDAPS Server
-        TransportBean ldapsServerTransportBean = LdapLdapsServersPage
-            .getLdapsServerTransportBean( directoryServiceBean );
-        setSelection( enableLdapsCheckbox, ldapsServerTransportBean.isEnabled() );
-        setEnabled( ldapsPortText, enableLdapsCheckbox.getSelection() );
-        setText( ldapsPortText, ldapsServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
-
-        // Kerberos Server
-        KdcServerBean kdcServerBean = KerberosServerPage.getKdcServerBean( directoryServiceBean
);
-        setSelection( enableKerberosCheckbox, kdcServerBean.isEnabled() );
-        setEnabled( kerberosPortText, enableKerberosCheckbox.getSelection() );
-        setText( kerberosPortText, "" + kdcServerBean.getTransports()[0].getSystemPort()
); //$NON-NLS-1$
-
-        // Change Password Server
-        ChangePasswordServerBean changePasswordServerBean = KerberosServerPage
-            .getChangePasswordServerBean( directoryServiceBean );
-        setSelection( enableChangePasswordCheckbox, changePasswordServerBean.isEnabled()
);
-        setEnabled( changePasswordPortText, enableChangePasswordCheckbox.getSelection() );
-        setText( changePasswordPortText, "" + changePasswordServerBean.getTransports()[0].getSystemPort()
); //$NON-NLS-1$
-
-        // Partitions
-        List<PartitionBean> partitions = directoryServiceBean.getPartitions();
-        if ( partitions.size() == 1 )
-        {
-            partitionsLabel.setText( Messages.getString( "OverviewPage.ThereIsOnePartitionDefined"
) ); //$NON-NLS-1$
-        }
-        else
+        if ( isInitialized() )
         {
-            partitionsLabel.setText( NLS.bind(
-                Messages.getString( "OverviewPage.ThereAreXPartitionsDefined" ), partitions.size()
) ); //$NON-NLS-1$
-        }
-        partitionsTableViewer.setInput( partitions.toArray() );
+            removeListeners();
+
+            DirectoryServiceBean directoryServiceBean = getDirectoryServiceBean();
 
-        // Options
-        allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess()
);
-        enableAccessControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled()
);
+            // LDAP Server
+            TransportBean ldapServerTransportBean = LdapLdapsServersPage
+                .getLdapServerTransportBean( directoryServiceBean );
+            setSelection( enableLdapCheckbox, ldapServerTransportBean.isEnabled() );
+            setEnabled( ldapPortText, enableLdapCheckbox.getSelection() );
+            setText( ldapPortText, ldapServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+
+            // LDAPS Server
+            TransportBean ldapsServerTransportBean = LdapLdapsServersPage
+                .getLdapsServerTransportBean( directoryServiceBean );
+            setSelection( enableLdapsCheckbox, ldapsServerTransportBean.isEnabled() );
+            setEnabled( ldapsPortText, enableLdapsCheckbox.getSelection() );
+            setText( ldapsPortText, ldapsServerTransportBean.getSystemPort() + "" ); //$NON-NLS-1$
+
+            // Kerberos Server
+            KdcServerBean kdcServerBean = KerberosServerPage.getKdcServerBean( directoryServiceBean
);
+            setSelection( enableKerberosCheckbox, kdcServerBean.isEnabled() );
+            setEnabled( kerberosPortText, enableKerberosCheckbox.getSelection() );
+            setText( kerberosPortText, "" + kdcServerBean.getTransports()[0].getSystemPort()
); //$NON-NLS-1$
+
+            // Change Password Server
+            ChangePasswordServerBean changePasswordServerBean = KerberosServerPage
+                .getChangePasswordServerBean( directoryServiceBean );
+            setSelection( enableChangePasswordCheckbox, changePasswordServerBean.isEnabled()
);
+            setEnabled( changePasswordPortText, enableChangePasswordCheckbox.getSelection()
);
+            setText( changePasswordPortText, "" + changePasswordServerBean.getTransports()[0].getSystemPort()
); //$NON-NLS-1$
+
+            // Partitions
+            List<PartitionBean> partitions = directoryServiceBean.getPartitions();
+            if ( partitions.size() == 1 )
+            {
+                partitionsLabel.setText( Messages.getString( "OverviewPage.ThereIsOnePartitionDefined"
) ); //$NON-NLS-1$
+            }
+            else
+            {
+                partitionsLabel.setText( NLS.bind(
+                    Messages.getString( "OverviewPage.ThereAreXPartitionsDefined" ), partitions.size()
) ); //$NON-NLS-1$
+            }
+            partitionsTableViewer.setInput( partitions.toArray() );
+
+            // Options
+            allowAnonymousAccessCheckbox.setSelection( directoryServiceBean.isDsAllowAnonymousAccess()
);
+            enableAccessControlCheckbox.setSelection( directoryServiceBean.isDsAccessControlEnabled()
);
 
-        addListeners();
+            addListeners();
+        }
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsMasterDetailsBlock.java
Tue Jul  2 17:27:06 2013
@@ -156,6 +156,16 @@ public class PartitionsMasterDetailsBloc
 
 
     /**
+     * Refreshes the UI.
+     */
+    public void refreshUI()
+    {
+        initFromInput();
+        viewer.refresh();
+    }
+
+
+    /**
      * Add listeners to UI fields.
      */
     private void addListeners()

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PartitionsPage.java
Tue Jul  2 17:27:06 2013
@@ -44,6 +44,9 @@ public class PartitionsPage extends Serv
 
     /** The Page Title */
     private static final String TITLE = Messages.getString( "PartitionsPage.Partitions" );
//$NON-NLS-1$
+    
+    /** The Master Details Block */
+    private PartitionsMasterDetailsBlock masterDetailsBlock;
 
     /** The label provider for partition table viewers */
     public static LabelProvider PARTITIONS_LABEL_PROVIDER = new LabelProvider()
@@ -124,7 +127,7 @@ public class PartitionsPage extends Serv
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        PartitionsMasterDetailsBlock masterDetailsBlock = new PartitionsMasterDetailsBlock(
this );
+        masterDetailsBlock = new PartitionsMasterDetailsBlock( this );
         masterDetailsBlock.createContent( getManagedForm() );
     }
 
@@ -134,7 +137,10 @@ public class PartitionsPage extends Serv
      */
     protected void refreshUI()
     {
-        // Nothing to do.
+        if ( isInitialized() )
+        {
+            masterDetailsBlock.refreshUI();
+        }
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesMasterDetailsBlock.java
Tue Jul  2 17:27:06 2013
@@ -69,9 +69,6 @@ public class PasswordPoliciesMasterDetai
     /** The Details Page */
     private PasswordPolicyDetailsPage detailsPage;
 
-    /** The authentication interceptor */
-    private AuthenticationInterceptorBean authenticationInterceptor;
-
     // UI Fields
     private TableViewer viewer;
     private Button addButton;
@@ -240,26 +237,33 @@ public class PasswordPoliciesMasterDetai
 
 
     /**
+     * Refreshes the UI.
+     */
+    public void refreshUI()
+    {
+        initFromInput();
+        viewer.refresh();
+    }
+
+
+    /**
      * Gets the authentication interceptor.
      *
      * @return the authentication interceptor
      */
     private AuthenticationInterceptorBean getAuthenticationInterceptor()
     {
-        if ( authenticationInterceptor == null )
+        // Looking for the authentication interceptor
+        for ( InterceptorBean interceptor : page.getConfigBean().getDirectoryServiceBean().getInterceptors()
)
         {
-            // Looking for the authentication interceptor
-            for ( InterceptorBean interceptor : page.getConfigBean().getDirectoryServiceBean().getInterceptors()
)
+            if ( AUTHENTICATION_INTERCEPTOR_ID.equalsIgnoreCase( interceptor.getInterceptorId()
)
+                && ( interceptor instanceof AuthenticationInterceptorBean ) )
             {
-                if ( AUTHENTICATION_INTERCEPTOR_ID.equalsIgnoreCase( interceptor.getInterceptorId()
)
-                    && ( interceptor instanceof AuthenticationInterceptorBean ) )
-                {
-                    authenticationInterceptor = ( AuthenticationInterceptorBean ) interceptor;
-                }
+                return ( AuthenticationInterceptorBean ) interceptor;
             }
         }
 
-        return authenticationInterceptor;
+        return null;
     }
 
 
@@ -343,7 +347,7 @@ public class PasswordPoliciesMasterDetai
 
         // Adding the new password policy to the authentication interceptor
         getAuthenticationInterceptor().addPasswordPolicies( newPasswordPolicy );
-        
+
         // Updating the UI and editor
         viewer.refresh();
         viewer.setSelection( new StructuredSelection( newPasswordPolicy ) );

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/PasswordPoliciesPage.java
Tue Jul  2 17:27:06 2013
@@ -44,6 +44,9 @@ public class PasswordPoliciesPage extend
     /** The Page Title */
     private static final String TITLE = Messages.getString( "PasswordPoliciesPage.PasswordPolicies"
); //$NON-NLS-1$
 
+    /** The Master Details Block */
+    private PasswordPoliciesMasterDetailsBlock masterDetailsBlock;
+
 
     /**
      * Creates a new instance of GeneralPage.
@@ -62,7 +65,7 @@ public class PasswordPoliciesPage extend
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        PasswordPoliciesMasterDetailsBlock masterDetailsBlock = new PasswordPoliciesMasterDetailsBlock(
this );
+        masterDetailsBlock = new PasswordPoliciesMasterDetailsBlock( this );
         masterDetailsBlock.createContent( getManagedForm() );
     }
 
@@ -72,7 +75,10 @@ public class PasswordPoliciesPage extend
      */
     protected void refreshUI()
     {
-        // Nothing to do.
+        if ( isInitialized() )
+        {
+            masterDetailsBlock.refreshUI();
+        }
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationMasterDetailsBlock.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationMasterDetailsBlock.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationMasterDetailsBlock.java
Tue Jul  2 17:27:06 2013
@@ -201,6 +201,15 @@ public class ReplicationMasterDetailsBlo
 
 
     /**
+     * Refreshes the UI.
+     */
+    public void refreshUI()
+    {
+        initFromInput();
+        viewer.refresh();
+    }
+
+    /**
      * Initializes the page with the Editor input.
      */
     private void initFromInput()

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ReplicationPage.java
Tue Jul  2 17:27:06 2013
@@ -37,6 +37,9 @@ public class ReplicationPage extends Ser
     /** The Page Title */
     private static final String TITLE = Messages.getString( "ReplicationPage.Replication"
); //$NON-NLS-1$
 
+    /** The Master Details Block */
+    private ReplicationMasterDetailsBlock masterDetailsBlock;
+
 
     /**
      * Creates a new instance of ReplicationPage.
@@ -55,7 +58,7 @@ public class ReplicationPage extends Ser
      */
     protected void createFormContent( Composite parent, FormToolkit toolkit )
     {
-        ReplicationMasterDetailsBlock masterDetailsBlock = new ReplicationMasterDetailsBlock(
this );
+        masterDetailsBlock = new ReplicationMasterDetailsBlock( this );
         masterDetailsBlock.createContent( getManagedForm() );
     }
 
@@ -65,6 +68,9 @@ public class ReplicationPage extends Ser
      */
     protected void refreshUI()
     {
-        // TODO Auto-generated method stub
+        if ( isInitialized() )
+        {
+            masterDetailsBlock.refreshUI();
+        }
     }
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java?rev=1499028&r1=1499027&r2=1499028&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorPage.java
Tue Jul  2 17:27:06 2013
@@ -66,6 +66,9 @@ public abstract class ServerConfiguratio
 {
     protected static final Color GRAY_COLOR = new Color( null, 120, 120, 120 );
     protected static final String TABULATION = "      "; //$NON-NLS-1$
+    
+    /** A flag to indicate if the page is initialized */
+    protected boolean isInitialized = false;
 
     // Dirty listeners
     private ModifyListener dirtyModifyListener = new ModifyListener()
@@ -206,6 +209,8 @@ public abstract class ServerConfiguratio
         toolbarManager.update( true );
 
         createFormContent( parent, toolkit );
+        
+        isInitialized = true;
     }
 
 
@@ -224,6 +229,17 @@ public abstract class ServerConfiguratio
      * Refreshes the UI.
      */
     protected abstract void refreshUI();
+    
+    /**
+     * Indicates if the page is initialized.
+     *
+     * @return <code>true</code> if the page is initialized,
+     *         <code>false</code> if not.
+     */
+    public boolean isInitialized()
+    {
+        return isInitialized;
+    }
 
 
     /**



Mime
View raw message