This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Utility methods to create context menus from a custom extension point in the layer file | ||
---|---|---|---|
Product: | platform | Reporter: | puce <puce> |
Component: | -- Other -- | Assignee: | issues@platform <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | Windows Vista | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
puce
2009-03-13 11:45:53 UTC
I tried to debug why the menu items created by org.openide.util.Utilities.actionsToPopup(Action[], Lookup) don't synchronize with the enable-property of their associated action and as far I could see up to now the call sequence is: Utilities.actionsToPopup(Action[], Lookup) AWTBridge.getDefault().createPopupPresenter(action) org.netbeans.modules.openide.awt.DefaultAWTBridge.createPopupPresenter(Action) org.openide.awt.Actions.MenuItem (action, false) org.openide.awt.Actions.connect(this, aAction, !useMnemonic) org.openide.awt.Actions.MenuBridge(item, action, popup) MenuBridge extends ButtonBridge, which extends Bridge. Unfortunatly it seems that ButtonBridge does not set the action property of the button. Furthermore MenuBridge calls: if (item instanceof Actions.MenuItem) { // addnotify/remove notify doens't make sense for menus and // popups. MenuBridge.this.comp.removePropertyChangeListener(listener); } I don't see the reason for this. I think this could be the cause why the item is not updated! (Though I think using the action property rather than adding a propertyChangeListener would be the cleaner solution.) And why is this only need if the item (JMenuItem) is an instance of Actions.MenuItem (if it's needed at all)??? |