Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Dynamically add ViewMenu
Dynamically add ViewMenu [message #1278422] Thu, 27 March 2014 10:15 Go to next message
Dmitriy Shishkin is currently offline Dmitriy ShishkinFriend
Messages: 20
Registered: May 2012
Junior Member
Hi all,
I want to Dynamically add ViewMenu to Part from PartDescriptor
Here is my code in Xtend:
@Inject
MPart part

...

descriptor = modelService.getPartDescriptor(id)
...
val menuCopy = EcoreUtil.copyAll(descriptor.menus)
part.menus.clear
part.menus += menuCopy

but after adding menus to part nothing happen.
What is right way to add ViewMenu to Part dynamically?

Best regards,
Dmitriy.
Re: Dynamically add ViewMenu [message #1278432 is a reply to message #1278422] Thu, 27 March 2014 10:27 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Adding to the descriptor will only have an effect when the part is
opened the next time from this PartDescriptor. To show up as a ViewMenu
you also have to have the Menu-Entry tagged with "ViewMenu".

You need to update the menu of the current part to have an immediate
effect on the current part.

Looking at the code I see that we are not yet tracking the update to the
part menu currently so adding a ViewMenu entry dynamically we are not
reacting on that change.

So file a bugzilla and we'll fix this in 1.0.0!

Tom

On 27.03.14 11:15, Dmitriy Shishkin wrote:
> Hi all,
> I want to Dynamically add ViewMenu to Part from PartDescriptor
> Here is my code in Xtend:
>
> @Inject
> MPart part
>
> ..
>
> descriptor = modelService.getPartDescriptor(id)
> ..
> val menuCopy = EcoreUtil.copyAll(descriptor.menus)
> part.menus.clear
> part.menus += menuCopy
>
> but after adding menus to part nothing happen.
> What is right way to add ViewMenu to Part dynamically?
>
> Best regards,
> Dmitriy.
Re: Dynamically add ViewMenu [message #1278452 is a reply to message #1278422] Thu, 27 March 2014 11:03 Go to previous message
Dmitriy Shishkin is currently offline Dmitriy ShishkinFriend
Messages: 20
Registered: May 2012
Junior Member
Thank for quick reply)

Bug 431338

Best regards,
Dmitriy
Previous Topic:Tool for Luna 4.4-I 2014-03-18
Next Topic:Problems in Installing e(fx)clipse In Eclipse Kepler
Goto Forum:
  


Current Time: Fri Apr 19 10:06:48 GMT 2024

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

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

Back to the top