diff --git a/basics/action_system.md b/basics/action_system.md index 858fe620a..560c347fe 100644 --- a/basics/action_system.md +++ b/basics/action_system.md @@ -150,19 +150,17 @@ Registering actions in `plugin.xml` is demonstrated in the following reference e > **Tip** Beginning in 2020.1, an alternate version of an action's menu text can be declared for use depending on where an action appears. -By using the `override-text` element introduced in v2020.1 of the IntelliJ Platform, the menu text for an action can be different depending on context: menu location, toolbar, etc. -In the `action` element reference example (below) with `id` attribute `VssIntegration.GarbageCollection`, the default is to use the verbose text "Garbage Collector: Collect _Garbage." -The `add-to-group` element declares the action is to be added to the Tools Menu. +By using the `` element introduced in 2020.1 of the IntelliJ Platform, the menu text for an action can be different depending on context: menu location, toolbar, etc. -However, the `override-text` element declares that text for `VssIntegration.GarbageCollection` displayed anywhere in the Main Menu system should be the compact text version "Collect _Garbage." +In the `action` element reference example (below) with `id` attribute `VssIntegration.GarbageCollection`, the default is to use the menu text "Garbage Collector: Collect _Garbage." +The `add-to-group` element declares the action is added to the Tools Menu. + +However, the `override-text` element declares that text for `VssIntegration.GarbageCollection` displayed anywhere in the Main Menu system should be the alternate text "Collect _Garbage." The Tools Menu is part of the Main Menu, so the displayed menu text is "Collect _Garbage." -A different context, such as searching for the action using **Help \| Find Action...**, displays the verbose text "Garbage Collector: Collect _Garbage" to give the user additional information about the action. +A different context, such as searching for the action using **Help \| Find Action...**, displays the default text "Garbage Collector: Collect _Garbage" to give the user additional information about the action. -The example uses `MainMenu` for the `place` attribute in the `override-text` element, which is broad in scope. -The `place` attribute could be finer granularity if the action is to be added to more than one location in the main menu. -For example, the `override-text` element for `VssIntegration.GarbageCollection` might only specify a `place` element of `ToolsMenu`. -Then additional `add-to-group` elements could specify other `group-id` attributes, such as `HelpMenu`. -For each `add-to-group` unique `group-id` attribute, an additional `override-text` element could be added with a matching `place` attribute. +A second `override-text` element uses `place` and `use-text-of-place` attributes to declare the same version of the text used in the Main Menu is also used in the Editor Popup Menu. +Additional `override-text` elements could be used to specify additional places where the Main Menu text should be used. #### Action Declaration Reference The places where actions can appear are defined by constants in [`ActionPlaces`](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java). @@ -189,11 +187,15 @@ This, and additional information can also be found by using the [Code Completion + version should be used. + The second element uses the alternate attribute "use-text-of-place" to define + a location (EditorPopup) to use the same text as is used in MainMenu. It is a way to specify + use of alternate menu text in multiple discrete menu groups. --> + SDK: Action Sample Project - - 2.0.0 - - - - com.intellij.modules.platform @@ -45,7 +38,6 @@ - @@ -75,4 +67,4 @@ - \ No newline at end of file + diff --git a/reference_guide/api_notable/api_notable_list_2020.md b/reference_guide/api_notable/api_notable_list_2020.md index 03f911b05..ff3852559 100644 --- a/reference_guide/api_notable/api_notable_list_2020.md +++ b/reference_guide/api_notable/api_notable_list_2020.md @@ -26,8 +26,8 @@ Refactoring dialog: builtin "Open in editor" option Configurable status bar widgets : Use extension point `com.intellij.statusBarWidgetFactory` to provide widgets that can be disabled or reordered. -Override text presentation for actions depending on context. -: Set the [`override-text`](/basics/action_system.md#setting-the-override-text-element-for-an-action) element within the `action` declaration in `plugin.xml`. +Override text presentation for actions depending on menu context. +: Set the `` element within the `` declaration in `plugin.xml`. ## Notable Changes in IntelliJ IDEA diff --git a/tutorials/action_system/working_with_custom_actions.md b/tutorials/action_system/working_with_custom_actions.md index d7c8659f6..db394fb56 100644 --- a/tutorials/action_system/working_with_custom_actions.md +++ b/tutorials/action_system/working_with_custom_actions.md @@ -112,9 +112,9 @@ The full declaration is: ``` #### Using Override-Text for an Action -By using the `override-text` element introduced in v2020.1 of the IntelliJ Platform, the action text can be different depending on the context of where the action appears: menu, toolbar, etc. -The example above uses this element to ensure the more terse text "Pop Dialog Action" is shown anywhere the action appears in the Main Menu structure. -Otherwise, the default verbose text "Action Basics Plugin: Pop Dialog Action" is shown. +By using the `override-text` element introduced in 2020.1 of the IntelliJ Platform, the action text can be different depending on the context of where the action appears: menu, toolbar, etc. +The example above uses this element to ensure the shorter text "Pop Dialog Action" is shown anywhere the action appears in the Main Menu structure. +Otherwise, the default, more explanatory text "Action Basics Plugin: Pop Dialog Action" is shown. For more information, see [Setting the Override-Text Element for an Action](/basics/action_system.md#setting-the-override-text-element-for-an-action) ## Testing the Minimal Custom Action Implementation