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/03/10 05:20:00 UTC

svn commit: r1786286 - /directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java

Author: elecharny
Date: Fri Mar 10 05:20:00 2017
New Revision: 1786286

URL: http://svn.apache.org/viewvc?rev=1786286&view=rev
Log:
Slight cleanup

Modified:
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java?rev=1786286&r1=1786285&r2=1786286&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java (original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java Fri Mar 10 05:20:00 2017
@@ -32,25 +32,29 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class TextValueEditor extends AbstractDialogStringValueEditor
 {
-
     /**
      * {@inheritDoc}
      * 
      * This implementation opens the TextDialog.
      */
+    @Override
     public boolean openDialog( Shell shell )
     {
         Object value = getValue();
+        
         if ( value instanceof String )
         {
             TextDialog dialog = new TextDialog( shell, ( String ) value );
-            if ( dialog.open() == TextDialog.OK && !"".equals( dialog.getText() ) ) //$NON-NLS-1$
+            String text = dialog.getText();
+            
+            if ( ( dialog.open() == TextDialog.OK ) && ( text != null ) && ( text.length() != 0 ) )
             {
-                setValue( dialog.getText() );
+                setValue( text );
+                
                 return true;
             }
         }
+        
         return false;
     }
-
 }