directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <m...@stefan-seelmann.de>
Subject Re: [Studio] Assigning String to Text widget even if it's null
Date Tue, 04 Aug 2015 17:18:24 GMT
That's ok from my side, but Kirans ideas also sounds good.

On 08/04/2015 12:19 PM, Emmanuel L├ęcharny wrote:
> Hi,
> 
> a Text widget does not accept null values. It forces us to test if the
> value is null, and if so, we inject a "".
> 
> I'm willing to add a method in common-ui CommonUIUtils class that do
> this check instead of having to test that all over the code. May be
> tehre is already such a method spmewhere else ?
> 
> Here is what I want to add :
> 
>    
>    
>     /**
>      * An utility method that return a String which is never null.
>      *
>      * @param value The incoming value, which can be null
>      * @return The String if it's not null, "" otherwise
>      */
>     public static String getTextvalue( String value )
>     {
>         if ( value == null )
>         {
>             return "";
>         }
>         else
>         {
>             return value;
>         }
>     }
> 
> Dead simple...
> 
> Let me konw if it's ok.
> 
> Thanks !
> 


Mime
View raw message