LocalTerminalAction and RemoteTerminalAction specify
which is an incorrect idiom. Actions/*/*.instance is the actions pool, i.e. a set of all available actions, without reference to where they are shown. Each action must appear once and only once in the actions pool. Particular presentations of actions (zero or more per action) must be in some other layer folder.
TerminalContainerTopComponent.getToolbarActions seems to be the consuming code. It should pick some other folder - say, "org-netbeans-modules-dlight-terminal/toolbar" - define a public constant for this path, and have this be used in @ActionReference's.
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.
Closing this bug. The issue was fixed while fixing other bugs.
Now terminal's actions have path:
TERMINAL_ACTIONS_PATH = "Terminal/Actions"