You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/06/22 12:30:04 UTC
svn commit: r1686830 - in /directory/studio/trunk/plugins:
common.ui/src/main/java/org/apache/directory/studio/common/ui/
openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/
Author: elecharny
Date: Mon Jun 22 10:30:04 2015
New Revision: 1686830
URL: http://svn.apache.org/r1686830
Log:
o Added the Boolean parameters to the Options page
o Added the setValue() method in the COmmonUIUtils class
Modified:
directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIUtils.java
directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties
directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties
directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties
Modified: directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIUtils.java?rev=1686830&r1=1686829&r2=1686830&view=diff
==============================================================================
--- directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIUtils.java (original)
+++ directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIUtils.java Mon Jun 22 10:30:04 2015
@@ -26,6 +26,7 @@ import org.eclipse.jface.dialogs.Message
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
@@ -217,4 +218,24 @@ public class CommonUIUtils
return text;
}
+
+
+ /**
+ * Set a value in a Button, if it's not null
+ *
+ * @param value The Value to set
+ * @param checkBox The Button which will be checked if teh value is not null and set to True
+ */
+ public static void setValue( Boolean value, Button checkBox )
+ {
+ if ( value != null )
+ {
+ checkBox.setSelection( value );
+ }
+ else
+ {
+ checkBox.setSelection( false );
+ }
+
+ }
}
Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java?rev=1686830&r1=1686829&r2=1686830&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/OptionsPage.java Mon Jun 22 10:30:04 2015
@@ -52,6 +52,7 @@ import org.eclipse.swt.layout.GridLayout
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -297,6 +298,7 @@ public class OptionsPage extends OpenLDA
}
};
+
/**
* The olcReferral listener
*/
@@ -310,6 +312,18 @@ public class OptionsPage extends OpenLDA
/**
+ * The olcRootDSE listener
+ */
+ private ModifyListener rootDseTextListener = new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ getConfiguration().getGlobal().setOlcRootDSE( rootDseText.getText() );
+ }
+ };
+
+
+ /**
* The olcAuthzPolicy listener
*/
private SelectionListener authzPolicyComboListener = new SelectionAdapter()
@@ -322,6 +336,42 @@ public class OptionsPage extends OpenLDA
/**
+ * The olcGentleHup listener
+ */
+ private SelectionListener gentleHupCheckboxSelectionListener = new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ getConfiguration().getGlobal().setOlcGentleHUP( gentleHupCheckbox.getSelection() );
+ }
+ };
+
+
+ /**
+ * The olcReadOnly listener
+ */
+ private SelectionListener readOnlyCheckboxSelectionListener = new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ getConfiguration().getGlobal().setOlcReadOnly( readOnlyCheckbox.getSelection() );
+ }
+ };
+
+
+ /**
+ * The olcReverseLookup listener
+ */
+ private SelectionListener reverseLookupCheckboxSelectionListener = new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ getConfiguration().getGlobal().setOlcGentleHUP( reverseLookupCheckbox.getSelection() );
+ }
+ };
+
+
+ /**
* Creates a new instance of OptionsPage.
*
* @param editor the associated editor
@@ -609,11 +659,12 @@ public class OptionsPage extends OpenLDA
{
Section section = createSection( toolkit, parent,
Messages.getString( "OpenLDAPOptionsPage.Miscellaneous" ) );
- Composite composite = createSectionComposite( toolkit, section, 4, false );
+ Composite composite = createSectionComposite( toolkit, section, 5, false );
// The olcArgFile parameter.
argsFileText = CommonUIUtils.createText( toolkit, composite,
Messages.getString( "OpenLDAPOptionsPage.ArgsFile" ), "", -1, argsFileTextListener );
+ toolkit.createLabel( composite, "" );
// The olcPluginLogFile parameter.
pluginLogFileText = CommonUIUtils.createText( toolkit, composite,
@@ -622,11 +673,33 @@ public class OptionsPage extends OpenLDA
// The olcReferral parameter.
referralText = CommonUIUtils.createText( toolkit, composite,
Messages.getString( "OpenLDAPOptionsPage.Referral" ), "", -1, referralTextListener );
+ toolkit.createLabel( composite, "" );
// The authzPolocy parameter
toolkit.createLabel( composite, Messages.getString( "OpenLDAPSecurityPage.AuthzPolicy" ) ); //$NON-NLS-1$
authzPolicyCombo = BaseWidgetUtils.createCombo( composite, AuthzPolicyEnum.getNames(), -1, 1 );
authzPolicyCombo.addSelectionListener( authzPolicyComboListener );
+
+ // The olcRootDSE parameter.
+ rootDseText = CommonUIUtils.createText( toolkit, composite,
+ Messages.getString( "OpenLDAPOptionsPage.RootDSE" ), "", -1, rootDseTextListener );
+ toolkit.createLabel( composite, "" );
+
+ // The olcGentleHUP Button
+ gentleHupCheckbox = BaseWidgetUtils.createCheckbox( composite,
+ Messages.getString( "OpenLDAPOptionsPage.GentleHUP" ), 2 );
+ gentleHupCheckbox.addSelectionListener( gentleHupCheckboxSelectionListener );
+
+ // The olcReadOnly Button
+ readOnlyCheckbox = BaseWidgetUtils.createCheckbox( composite,
+ Messages.getString( "OpenLDAPOptionsPage.ReadOnly" ), 2 );
+ readOnlyCheckbox.addSelectionListener( readOnlyCheckboxSelectionListener );
+ toolkit.createLabel( composite, "" );
+
+ // The olcReverseLookup Button
+ reverseLookupCheckbox = BaseWidgetUtils.createCheckbox( composite,
+ Messages.getString( "OpenLDAPOptionsPage.ReverseLookup" ), 2 );
+ reverseLookupCheckbox.addSelectionListener( reverseLookupCheckboxSelectionListener );
}
@@ -643,6 +716,10 @@ public class OptionsPage extends OpenLDA
addDirtyListener( pluginLogFileText );
addDirtyListener( referralText );
addDirtyListener( authzPolicyCombo );
+ addDirtyListener( rootDseText );
+ addDirtyListener( gentleHupCheckbox );
+ addDirtyListener( readOnlyCheckbox );
+ addDirtyListener( reverseLookupCheckbox );
}
@@ -659,6 +736,10 @@ public class OptionsPage extends OpenLDA
removeDirtyListener( pluginLogFileText );
removeDirtyListener( referralText );
removeDirtyListener( authzPolicyCombo );
+ removeDirtyListener( rootDseText );
+ removeDirtyListener( gentleHupCheckbox );
+ removeDirtyListener( readOnlyCheckbox );
+ removeDirtyListener( reverseLookupCheckbox );
}
@@ -818,6 +899,27 @@ public class OptionsPage extends OpenLDA
authzPolicyCombo.setText( AuthzPolicyEnum.UNKNOWN.getName() );
}
+ // Update the RootDSEText
+ String rootDse = getConfiguration().getGlobal().getOlcRootDSE();
+
+ if ( rootDse != null )
+ {
+ rootDseText.setText( rootDse );
+ }
+ else
+ {
+ rootDseText.setText( "" );
+ }
+
+ // Update the GentleHupCheckbox
+ CommonUIUtils.setValue( global.getOlcGentleHUP(), gentleHupCheckbox );
+
+ // Update the ReadOnlyCheckbox
+ CommonUIUtils.setValue( global.getOlcReadOnly(), readOnlyCheckbox );
+
+ // Update the GentleHupCheckbox
+ CommonUIUtils.setValue( global.getOlcReverseLookup(), reverseLookupCheckbox );
+
addListeners();
}
}
Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/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/pages/messages.properties?rev=1686830&r1=1686829&r2=1686830&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages.properties Mon Jun 22 10:30:04 2015
@@ -159,6 +159,10 @@ OpenLDAPOptionsPage.ArgsFile=Arguments F
OpenLDAPOptionsPage.PluginLogFile=Plugin Log File :
OpenLDAPOptionsPage.Referral=URL's Referral :
OpenLDAPSecurityPage.AuthzPolicy=Proxy Authorization :
+OpenLDAPOptionsPage.RootDSE=RootDSE file :
+OpenLDAPOptionsPage.GentleHUP=GentleHUP
+OpenLDAPOptionsPage.ReadOnly=Read Only
+OpenLDAPOptionsPage.ReverseLookup=Reverse Lookup
#---------------------------------------------------------------------------------------
# The Database page
Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/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/pages/messages_de.properties?rev=1686830&r1=1686829&r2=1686830&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_de.properties Mon Jun 22 10:30:04 2015
@@ -159,6 +159,10 @@ OpenLDAPOptionsPage.ArgsFile=Args file :
OpenLDAPOptionsPage.PluginLogFile=Plugin Log File :
OpenLDAPOptionsPage.Referral=URL's Referral :
OpenLDAPSecurityPage.AuthzPolicy=Proxy Authorization :
+OpenLDAPOptionsPage.RootDSE=RootDSE file :
+OpenLDAPOptionsPage.GentleHUP=GentleHUP
+OpenLDAPOptionsPage.ReadOnly=Read Only
+OpenLDAPOptionsPage.ReverseLookup=Reverse Lookup
#---------------------------------------------------------------------------------------
# The Database page
Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/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/pages/messages_fr.properties?rev=1686830&r1=1686829&r2=1686830&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties (original)
+++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/pages/messages_fr.properties Mon Jun 22 10:30:04 2015
@@ -159,6 +159,10 @@ OpenLDAPOptionsPage.ArgsFile=Fichier lig
OpenLDAPOptionsPage.PluginLogFile=Fichier de log des plugins :
OpenLDAPOptionsPage.Referral=URL de referral
OpenLDAPSecurityPage.AuthzPolicy=Authorisation d\u00E9l\u00E9gu\u00E9e :
+OpenLDAPOptionsPage.RootDSE=Fichier RootDSE :
+OpenLDAPOptionsPage.GentleHUP=Arr\u00EAt contr\u00F4l\u00E9
+OpenLDAPOptionsPage.ReadOnly=Lecture Seule
+OpenLDAPOptionsPage.ReverseLookup=Reverse Lookup
#---------------------------------------------------------------------------------------
# The Database page