Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Core Expression for "ITextEditor.isEditable"?(Disabling menu entries...)
Core Expression for "ITextEditor.isEditable"? [message #879253] Wed, 30 May 2012 17:17 Go to next message
Peter Dell is currently offline Peter Dell
Messages: 10
Registered: September 2011
Junior Member
Hello,

I would like to disable (context and normal) menu entries based on the fact that the current editor is text editor but not editable. I tried and searched a lot to find an example which works without implementing an owner PropertyTester or something similar. Is there a way to achieve this via Core Expressions?

Besides this I have the effect that new menu and toolbar items are can be disabled based on the current selection, but when the IDE starts, they are enabled first. Only by clicking them they become disabled. I have even debugged this but found no way of having dynamic enabling work correcty (in fact they are disabled first but in the same call they are statically enabled again because the contribution states they are "enabled").

Cheers, Peter.
Re: Core Expression for "ITextEditor.isEditable"? [message #882866 is a reply to message #879253] Thu, 07 June 2012 06:49 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 30.05.2012 23:18, Peter Dell wrote:
> Hello,
>
> I would like to disable (context and normal) menu entries based on the
> fact that the current editor is text editor but not editable. I tried
> and searched a lot to find an example which works without implementing
> an owner PropertyTester or something similar. Is there a way to
> achieve this via Core Expressions?
No.

Dani
>
> Besides this I have the effect that new menu and toolbar items are can
> be disabled based on the current selection, but when the IDE starts,
> they are enabled first. Only by clicking them they become disabled. I
> have even debugged this but found no way of having dynamic enabling
> work correcty (in fact they are disabled first but in the same call
> they are statically enabled again because the contribution states they
> are "enabled").
>
> Cheers, Peter.
>
Re: Core Expression for "ITextEditor.isEditable"? [message #884041 is a reply to message #882866] Sat, 09 June 2012 20:26 Go to previous message
Peter Dell is currently offline Peter Dell
Messages: 10
Registered: September 2011
Junior Member
Thanks Dani for the precise answer - it made me go an implement a property tester for activeSelection and now it works as expected. The only inconsistency is that if block selection is active, the property test gets an ITextSelection but the corresponding commend handler receives a IBlockTextSelection when really clicked.

Also the second part of the question is still open. Probably it'd be best to file a bug for it and the selection thing.

Peter.
Previous Topic:Eclipse wont build project properly!
Next Topic:Java 1.7 Indigo Problems
Goto Forum:
  


Current Time: Fri Apr 18 10:20:26 EDT 2014

Powered by FUDForum. Page generated in 0.06013 seconds