Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HEAD><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">@import url("../../book.css");</style>
<style type="text/css">@import url("../../schema.css");</style>
<H1 style="text-align:center">Samples</H1>
<h6 class="CaptionFigColumn SchemaHeader">Identifier: </h6>org.eclipse.pde.ui.samples<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Since: </h6>3.0

<h6 class="CaptionFigColumn SchemaHeader">Description: </h6><p>
This extension point should be used to register Eclipse code samples. A sample is one or more Eclipse projects that are packaged in a way suitable for subsequent import into the workspace. 
Each sample has a name, one or more project elements and a final perspective. The sample wizard will create a project for each <code>project</code> element, import the content from the archive, and open the final perspective if specified. Projects must be complete i.e. have correct nature and classpath (if Java or plug-in projects).
<p>If target view is specified and contains resource elements, it will be used to select and reveal those resources in the view after the sample has been created.
<p><b>This extension point is currently provided for internal Eclipse SDK usage only. It should not be used for anything else except Eclipse SDK examples.</b>
<h6 class="CaptionFigColumn SchemaHeader">Configuration Markup:</h6>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.sample">sample</a>+)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST extension</p>
<p class="code SchemaDtdAttlist">point&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p>
<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;CDATA #IMPLIED&gt;</p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>point</b> - extension point attribute - in this case <code>org.eclipse.pde.ui.samples</code>.</li>
<li><b>id</b> - not used.</li>
<li><b>name</b> - not used.</li>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.sample">sample</a> (<a href="#e.description">description</a> , <a href="#e.project">project</a>+ , <a href="#e.activity">activity</a>*)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST sample</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDREF #REQUIRED</p>
<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">perspectiveId&nbsp;IDREF #IMPLIED</p>
<p class="code SchemaDtdAttlist">launcher&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p>
<p class="code SchemaDtdAttlist">targetViewId&nbsp;&nbsp;IDREF #IMPLIED&gt;</p>
<p class="ConfigMarkupElementDesc">
an element that represents a single sample to be imported into the workspace.</p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - a unique identifier of the sample</li>
<li><b>name</b> - a translatable name of the sample</li>
<li><b>perspectiveId</b> - if specified, the sample wizard will switch to the perspective with the provided id at the end of the operation.</li>
<li><b>launcher</b> - an optional launch shortcut to be used to run the sample. If not specified, it will be assumed that a new Eclipse instance needs to be launched in order to see the sample. If specified, it needs to be the fully qualified name of the Java class that implements <code>org.eclipse.debug.ui.ILaunchShortcut</code> interface.</li>
<li><b>targetViewId</b> - an optional attribute that indicates that target view in the workbench that contains resources to select and reveal after the sample has been created. The view must implement <code>org.eclipse.ui.part.ISetSelectionTarget</code> interface. Resources listed in <code>project</code> elements will be selected and revealed in the target view.</li>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.project">project</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST project</p>
<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">archive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">shared&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(true | false) </p>
<p class="code SchemaDtdAttlist">selectReveal&nbsp;CDATA #IMPLIED&gt;</p>
<p class="ConfigMarkupElementDesc">
each project element will result in a workspace project being created with the content imported from the associated archive.</p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>name</b> - name of the project to be created in the workspace for this sample</li>
<li><b>archive</b> - relative path to the ZIP file containing the content of the project to import</li>
<li><b>shared</b> - shared projects may be listed in more than one sample. When this attribute is <code>true</code>, and the project with the same name already exists in the workspace, it will be silently skipped. Otherwise, users will be prompted for overwrite permission.</li>
<li><b>selectReveal</b> - a project-relative path of the resource to select and reveal in the target view after creation.</li>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.description">description</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST description</p>
<p class="code SchemaDtdAttlist">helpHref&nbsp;CDATA #IMPLIED&gt;</p>
<p class="ConfigMarkupElementDesc">
body text of this element should contain description of the sample.</p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>helpHref</b> - an optional reference to the topic in Help that provides more information about the sample.</li>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.activity">activity</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST activity</p>
<p class="code SchemaDtdAttlist">id&nbsp;CDATA #REQUIRED&gt;</p>
<p class="ConfigMarkupElementDesc">
specifies an activity that needs to be enabled for this sample</p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - activity identifier to be used to enable the activity for this sample</li>
<br><h6 class="CaptionFigColumn SchemaHeader">Examples: </h6><p>
The following is an example of the extension point:
<pre class="Example"><span class="code SchemaTag">
   &lt;extension point=</span><span class="code SchemaCstring">&quot;org.eclipse.pde.ui.samples&quot;</span><span class="code SchemaTag">&gt;
           id=</span><span class="code SchemaCstring">&quot;;</span><span class="code SchemaTag">
           name=</span><span class="code SchemaCstring">&quot;My Sample&quot;</span><span class="code SchemaTag">&gt;
         &lt;description helpHref=</span><span class="code SchemaCstring">&quot;/;</span><span class="code SchemaTag">&gt;
             A short description of the sample.
         &lt;project name=</span><span class="code SchemaCstring">&quot;;</span><span class="code SchemaTag">
                  archive=</span><span class="code SchemaCstring">&quot;samples/;</span><span class="code SchemaTag">/&gt;

<h6 class="CaptionFigColumn SchemaHeader">API Information: </h6><p>
If specified, the value of the attribute <code>launcher</code> must represent a fully qualified name of the Java class that implements <code>org.eclipse.debug.ui.ILaunchShortcut</code> interface.

<h6 class="CaptionFigColumn SchemaHeader">Supplied Implementation: </h6><p>
PDE UI supplies Runtime Workbench launcher for launching another instance of Eclipse.

<p class="note SchemaCopyright">
Copyright (c) 2004, 2013 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made 
available under the terms of the Eclipse Public License v1.0 which 
accompanies this distribution, and is available at 
<a href=""></a>.

New to GrepCode? Check out our FAQ X