Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Change the Label/Tooltip for MenuItem and ToolItem depended on Selection
Change the Label/Tooltip for MenuItem and ToolItem depended on Selection [message #1693355] Thu, 23 April 2015 08:49 Go to next message
Eclipse UserFriend
Hi everybody!

I have just been asked if it would be possible to change to label (or tooltip) of a MenuItem (or ToolItem) dependend on the current selection. These items could be anywhere including the main menu and/or context menus.

The thinking is to define the label like this:

"lorem ipsum ${<default>;MyItem.myAttribute} dolor"

and then recalculate the the text everytime the active selection changes. The replacement would be calculated using the bean pattern on the selection. If the selection is empty, does not fit the type, or contains multiple elements, the <default> would be used.

Any ideas on how to go about doing this? Would the new message extension be of any help implementing this?

Is there any interest in the community for a feature like this, as we might be able to put some time into this?

Smile
Christoph
Re: Change the Label/Tooltip for MenuItem and ToolItem depended on Selection [message #1693357 is a reply to message #1693355] Thu, 23 April 2015 09:00 Go to previous messageGo to next message
Eclipse UserFriend
On 23.04.15 14:49, Christoph Keimel wrote:
> Hi everybody!
>
> I have just been asked if it would be possible to change to label (or
> tooltip) of a MenuItem (or ToolItem) dependend on the current selection.
> These items could be anywhere including the main menu and/or context menus.
> The thinking is to define the label like this:
>
> "lorem ipsum ${<default>;MyItem.myAttribute} dolor"
>
> and then recalculate the the text everytime the active selection
> changes. The replacement would be calculated using the bean pattern on
> the selection. If the selection is empty, does not fit the type, or
> contains multiple elements, the <default> would be used.
>
> Any ideas on how to go about doing this? Would the new message extension
> be of any help implementing this?

It should not be too hard to implement this - generally you need to this
in our BaseRenderer#handleAttributeChange where you'll have to look at
the value returned from l.getLocalizedTooltip() - I think you need to
use a RAT for tracking value changes.

Generally this sounds like an cool feature and I'd happily merge this
into the codebase. I guess first step is to file a bugzilla and we go on
there with the discussion.

Tom
Re: Change the Label/Tooltip for MenuItem and ToolItem depended on Selection [message #1693366 is a reply to message #1693357] Thu, 23 April 2015 10:16 Go to previous message
Eclipse UserFriend
That looks nice. Thanks for the input!
I'll put this forward and will wait to see if our customer continues to be interessted.
Previous Topic:at.bestsolution.efxclipse.runtime.emf.databinding.edit on maven repo?
Next Topic:focus on window
Goto Forum:
  


Current Time: Mon Jun 16 19:14:30 EDT 2025

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

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

Back to the top