[Emf Forms] Tooltips in Views [message #1723503] |
Tue, 16 February 2016 08:44  |
Eclipse User |
|
|
|
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 #1723697 is a reply to message #1723503] |
Wed, 17 February 2016 09:42   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
|
|
|
Re: [Emf Forms] Tooltips in Views [message #1791336 is a reply to message #1723699] |
Thu, 28 June 2018 08:28   |
Nikola Veber Messages: 31 Registered: December 2017 |
Member |
|
|
Hello everyone,
I am on the same path, trying to customize the tooltips in my app. The proposed solution with property description is working fine.
However, I was hoping to utilize EcoreUtil.getDocumentation(eStructuralFeature) method, as I have this information in the XSD Schema the models are generated from.
After implementing ECPStringModifier and extending "org.eclipse.emf.ecp.ui.view.tooltipModifier", I get the same error as Oliver described.
Is this still the intended way of modifying tooltips? If not (this is more a general EMF question...) is there a way to set genmodel->documentation annotation as feature description?
Thanks and best regards
Nikola
P.S.
Debugging shows that the values passed represent values of the model features. Will try implementing EMFFormsLabelProvider, as getDescription() methods seem promising.
[Updated on: Thu, 28 June 2018 09:18] Report message to a moderator
|
|
|
|
|
|
|
|
Re: [Emf Forms] Tooltips in Views [message #1792484 is a reply to message #1792039] |
Wed, 18 July 2018 14:13   |
Nikola Veber Messages: 31 Registered: December 2017 |
Member |
|
|
Hi Eugen,
thanks for the tip! I managed to overwrite the EMFFormsLabelProviderImpl without messing everything up.
First I tried registering it via extension point:
<extension
point="org.eclipse.emf.ecp.ui.labelProvider">
<labelProvider
class="customizations.services.MyLabelProvider">
</labelProvider>
</extension>
Didn't work for me. Then I saw that the EMFFormsLabelProviderImpl and EMFFormsLabelProviderDefaultImpl have corresponding OSGi service definitions. Once added, works like a charm!
What I am still missing: For Boolean Control, there is a default label "No boolean set! Click to set boolean."
I checked the source code:
protected String getUnsetText() {
return LocalizationServiceHelper
.getString(getClass(), MessageKeys.BooleanControl_NoBooleanSetClickToSetBoolean);
I tried adding bundle.properties in /OSGI-INF/l10n with the appropriate key/value pair, but that does not seem to work. Is there a way to override the bundle properties of the renderer bundle? Or should I consider implementing own LocalizationService?
Best regards
Nikola
P.S.
I have just tried adding
Bundle-Localisation: OSGI-INF/l10n/bundle.properties
to my manifest file, as suggested in https://eclipsesource.com/blogs/tutorials/how-to-customize-emf-forms/#localization
File contains one line
BooleanControl_NoBooleanSetClickToSetBoolean=Testnobooelan
Still no success...
P.P.S.
Implementing localization service solved this problem!
(registered as OSGi service in my bundle)
[Updated on: Thu, 19 July 2018 07:07] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02315 seconds