EMF Edit ItemProvider getText method always returns a default string? [message #1468052] |
Mon, 10 November 2014 09:35  |
Eclipse User |
|
|
|
Hello,
I a have an Xcore (1.3) model and I am generating Edit code from it, too.
When I look in one of the generated ItemProvider classes the method getText is generated as follows:
@Override
public String getText(Object object) {
String label = ((GroupViewMappingDescription)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_GroupViewMappingDescription_type") :
getString("_UI_GroupViewMappingDescription_type") + " " + label;
}
When the label is empty a default string is return which is fine, but why is the label prefixed with a default string in the other case?
Can I do something about that behaviour (which I find strange by the way) without touching the generated classes?
Thanks
Jan Rosczak
|
|
|
Re: EMF Edit ItemProvider getText method always returns a default string? [message #1468063 is a reply to message #1468052] |
Mon, 10 November 2014 09:45  |
Eclipse User |
|
|
|
Jan,
No, that's just the way it is...
On 10/11/2014 3:35 PM, Jan Rosczak wrote:
> Hello,
>
> I a have an Xcore (1.3) model and I am generating Edit code from it, too.
> When I look in one of the generated ItemProvider classes the method
> getText is generated as follows:
>
>
> @Override
> public String getText(Object object) {
> String label = ((GroupViewMappingDescription)object).getName();
> return label == null || label.length() == 0 ?
> getString("_UI_GroupViewMappingDescription_type") :
> getString("_UI_GroupViewMappingDescription_type") + " " +
> label;
> }
>
>
> When the label is empty a default string is return which is fine, but
> why is the label prefixed with a default string in the other case?
>
> Can I do something about that behaviour (which I find strange by the
> way) without touching the generated classes?
>
> Thanks
> Jan Rosczak
|
|
|
Powered by
FUDForum. Page generated in 0.05469 seconds