Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Emf Forms] Tooltips in Views
[Emf Forms] Tooltips in Views [message #1723503] Tue, 16 February 2016 08:44 Go to next message
Eclipse UserFriend
Hello,

is there a way to change the tooltip within the Forms-views?

I mean the tooltip that appears over the Attribute-Name-Lables ...
Currently it shows : _UI_PropertyDescriptor_description from
plugin.properties (in generated edit-Plugin) resulting in

"The <attribute> of the <class>"

But I want to defined a custom tooltip for each eClass and for each of
its Attributes...

Best regards
Oliver
Re: [Emf Forms] Tooltips in Views [message #1723658 is a reply to message #1723503] Wed, 17 February 2016 06:48 Go to previous messageGo to next message
Annamalai Chockalingam is currently offline Annamalai ChockalingamFriend
Messages: 117
Registered: July 2009
Senior Member
Hi Oliver

I was recently trying out an Extension point from ECP :
org.eclipse.emf.ecp.ui.view.tooltipModifier
This extension point is mention for changing the tooltip on the controls
rendered by ECP. Not sure if this can be used for Label Tooltips also.

I have documented my learning in an article. You may find a link to the
article below.
http://www.ancitconsulting.com/tutorials/ecp/4_ECP%20-%20Custom%20Tooltip%20to%20EMF%20Forms%20Editor.pdf

Regards
Malai

On 2/16/2016 2:14 PM, Geith, Oliver wrote:
> Hello,
>
> is there a way to change the tooltip within the Forms-views?
>
> I mean the tooltip that appears over the Attribute-Name-Lables ...
> Currently it shows : _UI_PropertyDescriptor_description from
> plugin.properties (in generated edit-Plugin) resulting in
>
> "The <attribute> of the <class>"
>
> But I want to defined a custom tooltip for each eClass and for each of
> its Attributes...
>
> Best regards
> Oliver
Re: [Emf Forms] Tooltips in Views [message #1723680 is a reply to message #1723658] Wed, 17 February 2016 08:49 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 127
Registered: May 2015
Senior Member
Hi Oliver,
the text you see is the default text that is generated by emf. You can find it in the generated plugin.properties of your edit bundle. There is this entry:
Quote:
_UI_PropertyDescriptor_description = The {0} of the {1}

Now you can of course customize this. Open the GenModel Editor, select the feature you want to change, and in the properties view add the description you want to the property "Property Description".
If you now generate the edit bundle again, you will find an extra entry at the bottom.
Something like this:
_UI_Task_name_description = The name of the task should not be longer then 72 characters

The TooltipModifier is used to modify prepared tooltips, eg if you have a very long description but want the tooltip to be 50 chars wide, you can provide a modifier that adds line breaks to the provided text so the resulting tooltip will not be to wide.
You can also replace magic keys using your own modifier.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [Emf Forms] Tooltips in Views [message #1723697 is a reply to message #1723503] Wed, 17 February 2016 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Update:

I got a hint to use the Extensionpoint
"org.eclipse.emf.ecp.ui.view.tooltipModifier"

This is not exactly what I was looking for, but perhaps a good
workaround. :-)

So I implemented a Class to modify the tooltip for the rendered
controls. This works as far as I can see...BUT:
....now I get lots of messageboxs for each "number" Attribute saying :

"Invalid Number"
"The Number you have entered is invalid. The value will be unset."

Unfortunately there is no stacktrace, no nothing....
I traced this back to NumberControlSWTRenderer, but then I lost
orientation while debugging in all those classes...

Is this a bug ? How to avoid this?!

regards
Oliver




Am 16.02.2016 um 09:44 schrieb Geith, Oliver:
> Hello,
>
> is there a way to change the tooltip within the Forms-views?
>
> I mean the tooltip that appears over the Attribute-Name-Lables ...
> Currently it shows : _UI_PropertyDescriptor_description from
> plugin.properties (in generated edit-Plugin) resulting in
>
> "The <attribute> of the <class>"
>
> But I want to defined a custom tooltip for each eClass and for each of
> its Attributes...
>
> Best regards
> Oliver
Re: [Emf Forms] Tooltips in Views [message #1723699 is a reply to message #1723680] Wed, 17 February 2016 09:58 Go to previous message
Eclipse UserFriend
Hi Eugen,

this is exactly what I was looking for! Thanks a lot!

> Now you can of course customize this. Open the GenModel Editor, select
> the feature you want to change, and in the properties view add the
> description you want to the property "Property Description".
> If you now generate the edit bundle again, you will find an extra entry
> at the bottom. Something like this:
> _UI_Task_name_description = The name of the task should not be longer
> then 72 characters
>

regards
Oliver
Previous Topic:[EMFStore] cleaning up deleted projects
Next Topic:[EEF] Preview EEF Version 2.0.0
Goto Forum:
  


Current Time: Fri Nov 24 20:40:58 GMT 2017

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

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