Issue with Extension point for action [message #1060706] |
Tue, 28 May 2013 07:01 |
Yossi Balan Messages: 10 Registered: May 2013 |
Junior Member |
|
|
Hi
I created an editor and I added the functionality of folding.
I added a menu of folding with sub menu : enable,expend, collapse.
I want that the value of enable we come from the preference value of enable folding.
The problem that the logic of the enable folding is working only when I press on the second time on the mouse.
This is the extension point
<extension point="org.eclipse.ui.popupMenus">
<viewerContribution
id="Plugin.ui.RulerPopupActions"
targetID="#EditorContext">
<menu
label="Label1"
path="additions"
id="Plugin.Ruler.EditorMenu">
<separator
name="group">
</separator>
</menu>
<action
id="Action1"
label="EnableFolding"
class="classl"
menubarPath="Plugin.Ruler.EditorMenu/group">
</action>
<
</viewerContribution>
</extension>
The framework call to this action
protected final void rulerContextMenuAboutToShow(final IMenuManager menu) {
super.rulerContextMenuAboutToShow(menu);
MenuItem[] menus = ((MenuManager) menu).getMenu().getItems();
}
in the first time the menus are = [] and in the second time I got values
Do you have any idea why it is not working ?
|
|
|
Powered by
FUDForum. Page generated in 0.03054 seconds