diff -r 6552f6e77b1d editor.lib/src/org/netbeans/editor/Annotations.java --- a/editor.lib/src/org/netbeans/editor/Annotations.java Tue Mar 18 16:40:56 2008 +0100 +++ b/editor.lib/src/org/netbeans/editor/Annotations.java Wed Mar 19 00:31:26 2008 +0100 @@ -61,9 +61,12 @@ import javax.swing.JMenuItem; import javax.swing.JMenuItem; import javax.swing.SwingUtilities; import org.netbeans.editor.ext.ExtKit; +import org.openide.util.ContextAwareAction; +import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; import org.openide.util.actions.Presenter; +import org.openide.util.lookup.Lookups; /** Annotations class act as data model containing all annotations attached * to one document. Class uses instances of private class LineAnnotations for @@ -644,7 +647,10 @@ public class Annotations implements Docu /** Creates menu item for the given action. It must handle the BaseActions, which * have localized name stored not in Action.NAME property. */ - private JMenuItem createMenuItem(Action action, BaseKit kit) { + private JMenuItem createMenuItem(Action action, BaseKit kit, Lookup lookup) { + if (lookup != null && action instanceof ContextAwareAction) { + action = ((ContextAwareAction) action).createContextAwareInstance(lookup); + } JMenuItem item; if (action instanceof BaseAction) { item = new JMenuItem( ((BaseAction)action).getPopupMenuText(null) ); @@ -682,9 +688,10 @@ public class Annotations implements Docu if (anno != null) { actions = anno.getActions(); if (actions != null) { + Lookup lookup = (Lookup) anno.getAnnotationTypeInstance().getProp(Lookup.class.getName()); subMenu = new JMenu(anno.getAnnotationTypeInstance().getDescription()); for (int j=0; j 0) { orderedSubMenus.add(subMenu); @@ -701,9 +708,10 @@ public class Annotations implements Docu for (int i=0; i < pasiveAnnos.length; i++) { actions = pasiveAnnos[i].getActions(); if (actions != null) { + Lookup lookup = (Lookup) pasiveAnnos[i].getAnnotationTypeInstance().getProp(Lookup.class.getName()); subMenu = new JMenu(pasiveAnnos[i].getAnnotationTypeInstance().getDescription()); for (int j=0; j