Breadcrumb
- Sabre Red 360 Software Development Kit Help
- Desktop Red Apps
- Workbench or UI Elements
- Basic Menus
- Sample plugin.xml with Menu Contributions
Sample plugin.xml with Menu Contributions
The following plugin.xml
file represents the sample menu contributions that are built in Creating Basic Menu Contributions.
After you create the sample menu contributions, your plugin.xml
file should be similar to the following sample.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.6"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="com.sabre.redapp.example.editor.basic.SampleEditor"
default="false"
icon="images/sample_icon.png"
id="com.sabre.redapp.example.editor.basic.SampleEditor"
name="Sample Editor">
</editor>
</extension>
<extension
point="org.eclipse.ui.elementFactories">
<factory
class="com.sabre.redapp.example.editor.basic.SampleElementFactory"
id="com.sabre.redapp.example.editor.basic.SampleElementFactory">
</factory>
</extension>
<extension
point="com.sabre.edge.platform.core.editor.editorApp">
<editorApp
class="com.sabre.redapp.example.editor.basic.SampleEditor"
editorId="com.sabre.redapp.example.editor.basic.SampleEditor"
inputClass="com.sabre.redapp.example.editor.basic.SampleEditorInput"
name="Sample Editor"
toolTipText="Sample Editor">
</editorApp>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="com.sabre.redapp.example.editor.basic.OpenSampleEditorCommand"
name="Sample Command">
<commandParameter
id="editorId" <!--This value is required.-->
name="editorId" <!-- You can choose this name. -->
optional="true">
</commandParameter>
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.sabre.edge.platform.core.editor.commands.handlers.FocusOrOpenEditorHandler"
commandId="com.sabre.redapp.example.editor.basic.OpenSampleEditorCommand">
</handler>
</extension>
<!-- The following lines add a contribution to the main menu -->
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:edit?before=edit.top">
<command
commandId="com.sabre.redapp.example.editor.basic.OpenSampleEditorCommand"
icon="images/sample_icon.png"
label="Sample App Editor"
style="push">
<parameter
name="editorId"
value="com.sabre.redapp.example.editor.basic.SampleEditor">
</parameter>
</command>
</menuContribution>
</extension>
<!-- The following lines add a contribution to the launcher bar -->
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:com.sabre.edge.toolbar.launcher.agency">
<command
commandId="com.sabre.redapp.example.editor.basic.OpenSampleEditorCommand"
icon="images/sample_icon.png"
label="Sample App Editor"
style="push">
<parameter
name="editorId"
value="com.sabre.redapp.example.editor.basic.SampleEditor">
</parameter>
</command>
</menuContribution>
</extension>
</plugin>