|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
|
3 <html> |
|
4 <head> |
|
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
|
6 <title>Adding items to the Carbide menu</title> |
|
7 <style> |
|
8 <!-- |
|
9 span.attr |
|
10 {color:green} |
|
11 --> |
|
12 </style> |
|
13 <link rel="StyleSheet" href="../../book.css" type="text/css"/> |
|
14 </head> |
|
15 |
|
16 <body> |
|
17 <h2>Adding items to the Carbide menu</h2> |
|
18 |
|
19 <p>If you are creating a plug-in specifically for use with Carbide.c++ we recommend that |
|
20 any menu items you create be added to existing Eclipse menus or to the <b>Carbide</b> menu. |
|
21 </p> |
|
22 <p>Following this guideline reduces the likelihood of menu clutter for uses with multiple Carbide extensions. |
|
23 It also provides users with a consistent place to look for extension commands. |
|
24 </p> |
|
25 <p>The standard Eclipse technique for adding items to a menu is the <code>org.eclipse.ui.actionSet</code> |
|
26 extension point. To add to the Carbide menu you use a standard action set, and specify the Carbide menu |
|
27 in the <code>menubarPath</code> attribute. Below is an example: |
|
28 </p> |
|
29 |
|
30 <pre class="listing"> |
|
31 <extension |
|
32 point=<span class="attr">"org.eclipse.ui.actionSets"</span>> |
|
33 <actionSet |
|
34 id=<span class="attr">"Example.actionSet1"</span> |
|
35 label=<span class="attr">"Example Actions"</span> |
|
36 visible=<span class="attr">"true"</span>> |
|
37 <menu |
|
38 id=<span class="attr">"com.nokia.carbide.cpp.ui.CarbideMenu"</span> |
|
39 label=<span class="attr">"&amp;Carbide"</span> |
|
40 path=<span class="attr">"additions"</span>> |
|
41 <groupMarker name=<span class="attr">"CarbideExtensions"</span>/> |
|
42 </menu> |
|
43 <action |
|
44 class=<span class="attr">"SampleItem"</span> |
|
45 id=<span class="attr">"example.actions.CarbideExample"</span> |
|
46 label=<span class="attr">"My Extension"</span> |
|
47 icon=<span class="attr">"icons/sample.gif"</span> |
|
48 toolbarPath=<span class="attr">"sampleGroup"</span> |
|
49 menubarPath=<span class="attr">"com.nokia.carbide.cpp.ui.CarbideMenu/CarbideExtensions"</span> |
|
50 /> |
|
51 </actionSet> |
|
52 </extension> |
|
53 </pre> |
|
54 |
|
55 <p>The <menu> element must be included because Eclipse 3.2 does not completely support |
|
56 declaring menus in one plugin and referencing them from another. Please include this element exactly as-is. |
|
57 </p> |
|
58 |
|
59 <p>Note that the <code>menubarPath</code> has two elements to the path:</p> |
|
60 <ul> |
|
61 <li><code>com.nokia.carbide.cpp.ui.CarbideMenu</code> - this specifies the Carbide menu itself. |
|
62 </li> |
|
63 <li><code>CarbideExtensions</code> - this specifies the particular group in the menu for |
|
64 extension commands. It's important to include this specific group for compatibility with future Carbide.c++ releases. |
|
65 </li> |
|
66 </ul> |
|
67 <p>Carbide defines two other named groups in this menu: <code>CarbideStart</code> and |
|
68 <code>CarbideEnd</code>. These are for internal use and should not be used by third-party plugins. |
|
69 </p> |
|
70 <div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div> |
|
71 </div></body> |
|
72 </html> |