You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/Menu_Contributions/Populating_a_dynamic_submenu.md
+6-5
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ Menu Contributions/Populating a dynamic submenu
4
4
Add a dynamic submenu to the ProblemView menu
5
5
=============================================
6
6
7
-
In [Menu Contributions/Problems View Example](./Menu_Contributions/Problems_View_Example.md"Menu Contributions/Problems View Example") we added 2 dynamic menus. You then have to extend the abstract [CompoundContributionItem](http://help.eclipse.org/latest/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/actions/CompoundContributionItem.html) class in your provided class.
7
+
In [Menu Contributions/Problems View Example](./Problems_View_Example.md"Menu Contributions/Problems View Example") we added 2 dynamic menus.
8
+
You then have to extend the abstract [CompoundContributionItem](http://help.eclipse.org/latest/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/actions/CompoundContributionItem.html) class in your provided class.
Copy file name to clipboardexpand all lines: docs/Menu_Contributions/Problems_View_Example.md
+18-9
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,15 @@ Contents
13
13
Add ProblemView menus
14
14
=====================
15
15
16
-
Add the Problems view menus. The Problems view has one toolbar action and in the view menu, 3 actions and 2 dynamic submenus. It also has a dynamic menu and another bunch of actions in its context menu.
16
+
Add the Problems view menus.
17
+
The Problems view has one toolbar action and in the view menu, 3 actions and 2 dynamic submenus.
18
+
It also has a dynamic menu and another bunch of actions in its context menu.
17
19
18
20
Commands
19
21
--------
20
22
21
-
First define commands that are specific to the view. Since these are view commands, we can specify a default handler ... we're unlikely to replace it.
23
+
First define commands that are specific to the view.
24
+
Since these are view commands, we can specify a default handler ... we're unlikely to replace it.
22
25
23
26
<extension point="org.eclipse.ui.commands">
24
27
<category id="org.eclipse.ui.views.problems"
@@ -60,7 +63,9 @@ First define commands that are specific to the view. Since these are view comman
60
63
Handlers
61
64
--------
62
65
63
-
We can also use a number of global commands, like copy, paste, delete, quick fix, and properties. For these, we just need to define our handlers. We need to add them with <activeWhen/> clauses to restrict them to being active when the view is active.
66
+
We can also use a number of global commands, like copy, paste, delete, quick fix, and properties.
67
+
For these, we just need to define our handlers.
68
+
We need to add them with `<activeWhen/>` clauses to restrict them to being active when the view is active.
64
69
65
70
<extension point="org.eclipse.ui.handlers">
66
71
<handler commandId="org.eclipse.ui.edit.copy"
@@ -145,16 +150,19 @@ We can also use a number of global commands, like copy, paste, delete, quick fix
145
150
146
151
Or we can programmatically activate them through the IHandlerService which we would retrieve from the ProblemView site.
Using the ProblemView site to access the IHandlerService handles the <activeWhen/> clause for us, and our programmatic handler would manage its own enablement state.
157
+
Using the ProblemView site to access the IHandlerService handles the `<activeWhen/>` clause for us, and our programmatic handler would manage its own enablement state.
153
158
154
159
Menus
155
160
-----
156
161
157
-
Then we would define the ProblemView menu structures. We are using 3 **roots**: the view menu, the view toolbar, and the view context menu. This is an example of an "in-place" menu definition. The <menuContribution/> location attribute is a URI that defines the starting point for inserting the menu elements. The XML hierarchy mirrors the menu hierarchy, in that you can define items and menus within the body of other menus.
162
+
Then we would define the ProblemView menu structures.
163
+
We are using 3 **roots**: the view menu, the view toolbar, and the view context menu.
164
+
This is an example of an "in-place" menu definition. The `<menuContribution/>` location attribute is a URI that defines the starting point for inserting the menu elements.
165
+
The XML hierarchy mirrors the menu hierarchy, in that you can define items and menus within the body of other menus.
The `AbstractContributionFactory` creates new contribution items every time `createContributionItems(List)` is called. The factory location tells the framework where to insert the contributions when populating `ContributionManager`s.
360
+
The `AbstractContributionFactory` creates new contribution items every time `createContributionItems(List)` is called.
361
+
The factory location tells the framework where to insert the contributions when populating `ContributionManager`s.
0 commit comments