[Bug 455977] Allow enablement expressions for menu/toolbar contributions
Bugzilla Link | 455977 |
Status | UNCONFIRMED |
Importance | P3 normal |
Reported | Dec 22, 2014 12:08 EDT |
Modified | Jan 24, 2017 09:30 EDT |
Version | 0.2.0 |
See also | Gerrit change https://git.eclipse.org/r/89135, Git commit 4a738b24 |
Reporter | Nicolas Rouquette |
Description
Due to recent refactoring of the EASE Core plugins, the EASE script metadata format has changed.
Before, we had something like this:
Code: [Select all] [Show/ hide]\
/*
* Menu: Examples > Modeling > UML > Show all classes (java)
* License: EDL 1.0
* VisibleWhen:[And {
* With activeEditor {
* Equal "org.eclipse.papyrus.infra.core.papyrusEditor"
* },
* With selection {
* Iterable {
* AdaptTo "org.eclipse.emf.ecore.EObject"{
* InstanceOf "org.eclipse.uml2.uml.Namespace"
* }
* }
* }
* }]
* Description: {This script finds and prints all the UML classes contained inside the selected element,
directly or indirectly.}\
*/
This old format is still used in the modeling examples.
The new format is different.
There is some description here: https://wiki.eclipse.org/EASE/Scripts
However, it seems that we've lost a couple of things in this refactoring:
- we used to be able to specify a menu path with ">" as a path segment separator.
With the new code, it seems that the intention is to use something that
can be parsed as an Eclipse IPath -- i.e., using "/" as a path segment separator.
- The old format used the Eclipse Expression XML syntax for specifying enabling logic. The wiki page only mentions "enableFor()" as an example.
It is completely unclear to me what kind of things we can specify in the new tags,
particularly 'popup', 'toolbar' and 'menu'
For example, where is this "enableFor(...)" defined? I can't find it in the doc: