Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Edit ItemProvider getText method always returns a default string?
EMF Edit ItemProvider getText method always returns a default string? [message #1468052] Mon, 10 November 2014 14:35 Go to next message
Jan Rosczak is currently offline Jan RosczakFriend
Messages: 53
Registered: July 2009
Location: Hamburg, Germany
Member
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 14:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33251
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Reloading Genmodel overrides URIs
Next Topic:[CDO] Import from XMI throws DanglingReferenceException
Goto Forum:
  


Current Time: Thu Oct 31 23:19:20 GMT 2024

Powered by FUDForum. Page generated in 0.03490 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top