Let the example having the following identifiers:
io-sarl-demos-myexample
io_sarl_demos_myexample
io.sarl.examples.myexample
- Create the folder
projects/io-sarl-demos-myexample
. - Copy the example's code into the created folder.
Add in the plugin.xml
file:
<!-- ========= io-sarl-demos-myexample Example ========= -->
<extension point="org.eclipse.ui.newWizards">
<wizard id="io.sarl.examples.myexample"
name="%io_sarl_demos_myexample_Name"
class="org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard"
category="org.eclipse.ui.Examples/io.sarl.Examples"
icon="platform:/plugin/org.eclipse.xtend.examples/icons/genproject.gif"
project="true">
<description>%io_sarl_demos_myexample_Description</description>
</wizard>
</extension>
<extension point="org.eclipse.ui.newWizards">
<wizard id="io.sarl.examples.myexample"
name="%io_sarl_demos_myexample_Name"
class="org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard"
category="io.sarl.eclipse.category.wizards/io.sarl.project.Examples"
icon="platform:/plugin/org.eclipse.xtend.examples/icons/genproject.gif"
project="true">
<description>%io_sarl_demos_myexample_Description</description>
</wizard>
</extension>
<extension point="org.eclipse.emf.common.ui.examples">
<example wizardID="io.sarl.examples.myexample" pageImage="platform:/plugin/org.eclipse.xtend.examples/icons/genproject.gif">
<projectDescriptor name="io-sarl-demos-basic-myexample" contentURI="contents/io-sarl-demos-myexample.zip" description="%io_sarl_demos_myexample_Description"/>
<fileToOpen location="io-sarl-demos-myexample/path/to/the/file/to/open"/>
</example>
</extension>
Replace path/to/the/file/to/open
by the path to the file to be opened after importing the example.
The update explained in the previous section uses two strings in the localized properties.
Add in the OSGI-INF/bundle.properties
file:
io_sarl_demos_myexample_Name = THE NAME OF THE EXAMPLE
io_sarl_demos_myexample_Description = THE DESCRIPTION OF THE EXAMPLE
In order to add a quick link to the example, you should add into the plugin.xml
file:
<!-- adding a new quicklink for the example -->
<extension
point="org.eclipse.ui.intro.quicklinks">
<command
id="org.eclipse.ui.newWizard(newWizardId=io.sarl.examples.myexample)"
description="%io_sarl_demos_myexample__Description"
label="%io_sarl_demos_myexample__Name"
icon="platform:/plugin/org.eclipse.ui.intro.universal/themes/circles/graphics/icons/ctool/sa_onesample48.gif">
</command>
</extension>
Add into the SARL-Example-Intro.xml
file:
<group style-id="quick-links" id="quick-links">
<link style-id="content-link" label="Description of the example in the welcome page"
url="http://org.eclipse.ui.intro/execute?command=org.eclipse.ui.newWizard%28newWizardId%3Dio.sarl.examples.myexample%29"
id="io.sarl.examples.myexample">
<text>
Detailed description of the example.
</text>
</link>
</group>
Add into the build.xml
file:
<zip_example name="io-sarl-demos-myexample" />