Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Enable/Disable a Menu Element in a Processor(Is it possible to enable/disable a menu command label in a Processor)
Enable/Disable a Menu Element in a Processor [message #756495] Sun, 13 November 2011 21:42 Go to next message
St Clair Clarke is currently offline St Clair Clarke
Messages: 118
Registered: March 2010
Senior Member
Hello,

I am learning how to use an E4AP Processor with the two tutorials:
1. http://www.vogella.de/articles/EclipseE4/article.html#contribute_processors
2. http://www.toedter.com/blog/?p=154

I have an Admin menu command that I would like to enable/disable if someone logs onto the database, but IS NOT authenticated as an admin role.

I know how to make the Admin command label visible/invisible, BUT I would rather disable/enable it instead.

There is no such mechanism in any of the *Element classes I have seen in E4AP.

How can I do this?

If such a enable/disable and element does not exist, would it be possible for the team to implement one?

Thanks
Re: Enable/Disable a Menu Element in a Processor [message #756640 is a reply to message #756495] Mon, 14 November 2011 09:49 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Your handler should implement a @CanExecute method that could check if the user is logged in and has the admin role. You would probably want to have that information cached in a manager, so the @CanExecute check is quick and the manager deals with the database.

PW


Previous Topic:Starting birt from e4 application
Next Topic:e4 closes with EXCEPTION_ACCESS_VIOLATION
Goto Forum:
  


Current Time: Tue Jul 29 06:55:47 EDT 2014

Powered by FUDForum. Page generated in 0.01591 seconds