directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1786286 - /directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/TextValueEditor.java
Date Fri, 10 Mar 2017 05:20:00 GMT
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;
     }
-
 }



Mime
View raw message