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