Saturday, August 10, 2013

Re: PropertyAcess : Define condition values for label in PropertyAcess

Why can't you just simply define your getter method as follows:

public String getLabelProp() {
    return getLabel() == null ? getId() : getLabel();
}

I think it's pretty legal to implement getter in a such way.

пятница, 9 августа 2013 г., 1:37:21 UTC+4 пользователь Chulbul Pandey написал:

I have a model called Field which has id and label.

I have defined PropertyAcess as below and it works. I would like to change it in such a way that I can show label based on condition ie if field.getLabel() is null, use field.getId() as label else use field.getLabel() as label. How can I acheieve that

interface FieldProperties extends PropertyAccess<Field> {    ModelKeyProvider<Field> id();      LabelProvider<Field> label();      @Path("label")    ValueProvider<Field, String> labelProp();   }  

Thanks

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment