Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Omit type string in item provider getText
Omit type string in item provider getText [message #661379] Thu, 24 March 2011 13:02 Go to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
The item provide getText code is usually generated as:

String label = ((Foo)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_Foo_type") :
getString("_UI_Foo_type") + " " + label;

that means the text is prefixed with the element's type in any case. Is
there any easy way to omit this type already at code generation time? I
did search various posts and blogs but could not find a suitable answer.
What about runtime, any chance to smoothly get rid of the prefix?

Thanks in advance
Jan
Re: Omit type string in item provider getText [message #661436 is a reply to message #661379] Thu, 24 March 2011 16:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
Jan,

No.


Jan Mauersberger wrote:
> The item provide getText code is usually generated as:
>
> String label = ((Foo)object).getName();
> return label == null || label.length() == 0 ?
> getString("_UI_Foo_type") :
> getString("_UI_Foo_type") + " " + label;
>
> that means the text is prefixed with the element's type in any case.
> Is there any easy way to omit this type already at code generation
> time? I did search various posts and blogs but could not find a
> suitable answer. What about runtime, any chance to smoothly get rid of
> the prefix?
>
> Thanks in advance
> Jan
Re: Omit type string in item provider getText [message #661447 is a reply to message #661436] Thu, 24 March 2011 17:18 Go to previous message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Ed,

what a pity...

> Jan,
>
> No.
>
>
> Jan Mauersberger wrote:
>> The item provide getText code is usually generated as:
>>
>> String label = ((Foo)object).getName();
>> return label == null || label.length() == 0 ?
>> getString("_UI_Foo_type") :
>> getString("_UI_Foo_type") + " " + label;
>>
>> that means the text is prefixed with the element's type in any case.
>> Is there any easy way to omit this type already at code generation
>> time? I did search various posts and blogs but could not find a
>> suitable answer. What about runtime, any chance to smoothly get rid of
>> the prefix?
>>
>> Thanks in advance
>> Jan
Previous Topic:[EMF] ID-IDREF resolution
Next Topic:Export from GenModel to XSD missing lots of details
Goto Forum:
  


Current Time: Fri Oct 18 02:25:23 GMT 2019

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

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

Back to the top