Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » visbleWhen and enableWhen for opened files in editor
visbleWhen and enableWhen for opened files in editor [message #965827] Wed, 31 October 2012 14:34
Christian Kosmowski is currently offline Christian KosmowskiFriend
Messages: 5
Registered: October 2012
Junior Member
I'm currently developing an eclipse plugin which conains (among others) an "upload" command and a projectNature "myNature"

This command should be visible at the following places:

- In the context menu of the package explorer (if the surrounding project is of "myNature")

- In the context menu of an opened file in the JavaScript editor if (and only if) the currently opened file is a JavaScript file (can be assumed because its only displayed in JavaScript Editor) AND if this file is contained in a project of "myNature".

So the first part (Project Explorer context menu is working fine).

For the second part i added a menuContribution like this:

               <!-- a good solution is missing here -->

and a command like this:

         <enabledWhen><!-- this works -->
               <!-- make the context menu in javascript editor case working -->

What i can't figure out is how i can test the currently opened file in the enabledWhen or visbleWhen elements. I'd like to add an element to enabledWhen section of the command so that it is also enabled when the currentFile is contained in a "myNature" project. The "hasProjectnature" definition only works if there are selected elements in the Project Explorer view.

Can anyone help?
Previous Topic:breakpoint properties
Next Topic:Export plugin with dependencies
Goto Forum:

Current Time: Thu Jun 21 03:19:02 GMT 2018

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

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

Back to the top