Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Dynamic description for the delete button/context menu
Dynamic description for the delete button/context menu [message #1237833] Thu, 30 January 2014 18:23 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

I wrote an XXXDeleteFeature and I would like to provide a dynamic description for the delete button / context menu option depending on the business object state of the selected picture element.

This way, I would have the possibility to give the user an explanation when deletion is not allowed (typically in case of a 'LOCK' state...).

I tried to dynamically process a description while executing #canDelete() so that #getDescription() would simply have to return it.

But, surprisingly, #getDescription() is executed before #canDelete().

Is this normal ? Any idea how I could achieve this dynamic display ?

Kind regards,

Laurent
Re: Dynamic description for the delete button/context menu [message #1239174 is a reply to message #1237833] Mon, 03 February 2014 15:00 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Laurent,

yes, that's normal. The content menu entry is first added and then set to
enabled/disabled.

You could check the state already in getDescription and return and
appropriate text.

Michael
Re: Dynamic description for the delete button/context menu [message #1239289 is a reply to message #1239174] Mon, 03 February 2014 21:30 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi Michael,

Thanks for the explanation about the internal cinematic.
And how can I get access to my business object (to check its state) in #getDesciption ?
This method doesn't have any IDeleteContext parameter like in #canDelete...

Laurent
Re: Dynamic description for the delete button/context menu [message #1239463 is a reply to message #1239289] Tue, 04 February 2014 09:01 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
hm, right. That's a good point... :-(

Besides some dirty tricks, I only see the option for an enhancement of that
method. But I'm not sure if it is possible to provide the context
information in all cases, because the getDescription method is called from
various spots and at some the information on the context might not yet be
available.

Anyhow, would you file an enhancement request for that?

Thanks,
Michael
Re: Dynamic description for the delete button/context menu [message #1239490 is a reply to message #1239463] Tue, 04 February 2014 09:58 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
It's done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=427346

Regards,

Laurent
Previous Topic:Additional WizardPage for Graphiti
Next Topic:Run task after any modification
Goto Forum:
  


Current Time: Fri Apr 19 16:37:07 GMT 2024

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

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

Back to the top