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 2017/08/16 09:45:18 UTC
svn commit: r1805162 -
/directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
Author: elecharny
Date: Wed Aug 16 09:45:18 2017
New Revision: 1805162
URL: http://svn.apache.org/viewvc?rev=1805162&view=rev
Log:
o Switched to LDAP API Value branch
o Some sonar warning fixing
Modified:
directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
Modified: directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java?rev=1805162&r1=1805161&r2=1805162&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java Wed Aug 16 09:45:18 2017
@@ -236,7 +236,7 @@ public class NewEntryDnWizardPage extend
IValue[] values = attribute.getValues();
for ( int v = 0; v < values.length; v++ )
{
- if ( values[v].getStringValue().equals( atav.getValue().getNormValue() ) )
+ if ( values[v].getStringValue().equals( atav.getValue().getNormalized() ) )
{
attribute.deleteValue( values[v] );
}
@@ -295,7 +295,7 @@ public class NewEntryDnWizardPage extend
rdnAttribute = new Attribute( newEntry, atav.getType() );
newEntry.addAttribute( rdnAttribute );
}
- Object rdnValue = atav.getValue().getNormValue();
+ Object rdnValue = atav.getValue().getNormalized();
String[] stringValues = rdnAttribute.getStringValues();
if ( !Arrays.asList( stringValues ).contains( rdnValue ) )
{
@@ -342,6 +342,7 @@ public class NewEntryDnWizardPage extend
* doesn't call {@link #getNextPage()} to avoid unneeded
* invokings of {@link ReadEntryRunnable}s.
*/
+ @Override
public boolean canFlipToNextPage()
{
return isPageComplete();
@@ -354,6 +355,7 @@ public class NewEntryDnWizardPage extend
* This implementation invokes a {@link ReadEntryRunnable} to check if an
* entry with the composed Dn already exists.
*/
+ @Override
public IWizardPage getNextPage()
{
if ( !wizard.isNewContextEntry() )
@@ -374,9 +376,7 @@ public class NewEntryDnWizardPage extend
if ( parentEntry == null )
{
- getShell().getDisplay().syncExec( new Runnable()
- {
- public void run()
+ getShell().getDisplay().syncExec( () ->
{
MessageDialog
.openError( getShell(),
@@ -385,7 +385,7 @@ public class NewEntryDnWizardPage extend
.bind(
Messages.getString( "NewEntryDnWizardPage.ParentDoesNotExist" ), dnBuilderWidget.getParentDn().toString() ) ); //$NON-NLS-1$
}
- } );
+ );
return null;
}
@@ -397,16 +397,14 @@ public class NewEntryDnWizardPage extend
if ( entry != null )
{
- getShell().getDisplay().syncExec( new Runnable()
- {
- public void run()
+ getShell().getDisplay().syncExec( () ->
{
MessageDialog
.openError(
getShell(),
Messages.getString( "NewEntryDnWizardPage.Error" ), NLS.bind( Messages.getString( "NewEntryDnWizardPage.EntryAlreadyExists" ), dn.toString() ) ); //$NON-NLS-1$ //$NON-NLS-2$
}
- } );
+ );
return null;
}
@@ -428,16 +426,15 @@ public class NewEntryDnWizardPage extend
IEntry entry = readEntryRunnable2.getReadEntry();
if ( entry != null )
{
- getShell().getDisplay().syncExec( new Runnable()
- {
- public void run()
+ getShell().getDisplay().syncExec( () ->
{
MessageDialog
.openError(
getShell(),
Messages.getString( "NewEntryDnWizardPage.Error" ), NLS.bind( Messages.getString( "NewEntryDnWizardPage.EntryAlreadyExists" ), dn.toString() ) ); //$NON-NLS-1$ //$NON-NLS-2$
}
- } );
+ );
+
return null;
}
}
@@ -461,13 +458,7 @@ public class NewEntryDnWizardPage extend
// the combo
Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
contextEntryDnCombo = BaseWidgetUtils.createCombo( composite, ArrayUtils.EMPTY_STRING_ARRAY, 0, 1 );
- contextEntryDnCombo.addModifyListener( new ModifyListener()
- {
- public void modifyText( ModifyEvent e )
- {
- validate();
- }
- } );
+ contextEntryDnCombo.addModifyListener( event -> validate() );
// attach content proposal behavior
contextEntryDnComboCPA = new ContentProposalAdapter( contextEntryDnCombo, new ComboContentAdapter(), null,