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: | Misuse of @ActionReference in dlight.terminal | ||
---|---|---|---|
Product: | cnd | Reporter: | Jesse Glick <jglick> |
Component: | Terminalemulator | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | ARCH |
Priority: | P4 | ||
Version: | 7.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jesse Glick
2012-01-06 21:01:55 UTC
I don't quite understand, could you clarify please (I probably don't understand this path well enough). I see that 1) Utilities.actionsForPath return list, not a single action 2) many actions, say, in refactoring use equal paths (RenameAction, MoveAction, SafeDeleteAction) All these made me assume there could be multiple actions for path. As I understand, your plan is to make each of the above mentioned paths unique (and also add info that they should be unique into ActionReference java doc). Is this correct? (In reply to comment #1) > there could be multiple actions for path. Yes of course. But there should not be multiple paths (under Actions/) for one action. Each action should have exactly one registration (@ActionRegistration -> Actions/**.instance). It may have zero or more references (@ActionReference -> **.shadow) in various places (Menu/, Toolbars/, Shortcuts/, Editors/text/foo/Popup/, ad nauseam) loaded by various means such as actionsForPath, some of which expect an ordered list (hence ActionReference.position). If you ever use a path starting with "Actions/" in either @ActionReference or actionsForPath you are doing something wrong, because merely adding an action to the pool should not affect the GUI (other than the set of actions visible in Tools > Options > Keymap). The use of @ActionReference rather than manual layer.xml entries means that you can define a Java String constant for the path name you pick, and use it both in ActionReference.path and in the actionsForPath call, which protects against typos and assists IDE features like Find Usages. Clearer yet? Closing this bug. The issue was fixed while fixing other bugs. Now terminal's actions have path: TERMINAL_ACTIONS_PATH = "Terminal/Actions" |