carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/188/1/.cp/cheatsheets/helloworld/helloworld-extension.xml
changeset 5 684bf18fdedf
equal deleted inserted replaced
4:4764c8c88759 5:684bf18fdedf
       
     1 <?xml version="1.0" encoding="UTF-8"?><!--
       
     2      Copyright (c) 2005, 2008 IBM Corporation and others.
       
     3      All rights reserved. This program and the accompanying materials
       
     4      are made available under the terms of the Eclipse Public License v1.0
       
     5      which accompanies this distribution, and is available at
       
     6      http://www.eclipse.org/legal/epl-v10.html
       
     7     
       
     8      Contributors:
       
     9          IBM Corporation - initial API and implementation
       
    10  -->
       
    11 
       
    12 <cheatsheet title="Create a plug-in extension">
       
    13    <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
       
    14       <description>
       
    15          This cheat sheet will demonstrate how to create and test a plug-in extension
       
    16          using PDE. 
       
    17          <br/>
       
    18          <br/>
       
    19          To learn more about using cheat sheets, click the help button
       
    20          in the top right corner (?).
       
    21       </description>
       
    22    </intro>
       
    23    <item title="Open the plug-in development perspective" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/views/views.htm">
       
    24       <description>
       
    25          To open the plug-in development perspective,
       
    26          select <b>Window-&gt;Open Perspective-&gt;Other...</b> 
       
    27          and choose <b>Plug-in Development</b>.
       
    28          <br/>
       
    29          <br/>
       
    30          Alternatively, click the following button to perform the task.
       
    31       </description>
       
    32       <command
       
    33             confirm="false"
       
    34             required="false"
       
    35             translate=""
       
    36             serialization="org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.pde.ui.PDEPerspective)">
       
    37       </command>
       
    38    </item>
       
    39    <item title="Open the plug-in editor" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/editor.htm">
       
    40       <description>
       
    41          To open the plug-in editor (if it is not already open),
       
    42          expand the <b>com.example.helloworld</b> tree dialog
       
    43          in the <b>Package Explorer</b> view and double-click
       
    44          on the <b>plugin.xml</b> file.
       
    45          <br/>
       
    46          <br/>
       
    47          Alternatively, click the following button to perform the task.
       
    48       </description>
       
    49       <command
       
    50             confirm="false"
       
    51             required="false"
       
    52             translate=""
       
    53             serialization="org.eclipse.ui.navigate.openResource(filePath=/com.example.helloworld/plugin.xml)">
       
    54       </command>
       
    55    </item>
       
    56    <item title="Define a view extension" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/extensions.htm">
       
    57       <description>
       
    58          To define a view extension, perform the following steps:
       
    59       </description>
       
    60       <subitem label="Select the &quot;Extensions&quot; tab within the plug-in editor to display the &quot;Extensions&quot; page" skip="false">
       
    61       </subitem>
       
    62       <subitem label="Click the &quot;Add&quot; button to open the &quot;New Extension&quot; wizard" skip="false">
       
    63       </subitem>
       
    64       <subitem label="Select &quot;org.eclipse.ui.views&quot; from the &quot;Extension Points&quot; list box and click &quot;Finish&quot;" skip="false">
       
    65       </subitem>
       
    66    </item>
       
    67    <item title="Add a view category" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/extensions.htm">
       
    68       <description>
       
    69          To define a view category, perform the following steps:
       
    70       </description>
       
    71       <subitem label="Select &quot;org.eclipse.ui.views&quot; in the list box under &quot;All Extensions&quot; heading in the &quot;Extensions&quot; page" skip="false">
       
    72       </subitem>
       
    73       <subitem label="Right-click and select &quot;New-&gt;category&quot; from the context menu" skip="false">
       
    74       </subitem>
       
    75       <subitem label="Replace the content of the &quot;id&quot; text box under &quot;Extension Element Details&quot; with &quot;com.example.helloworld.view.helloworldcategory&quot;" skip="false">
       
    76       </subitem>
       
    77       <subitem label="Replace the content of the &quot;name&quot; text box with &quot;Hello World!&quot;" skip="false">
       
    78       </subitem>
       
    79       <subitem label="Select &quot;File-&gt;Save&quot; from the main menu" skip="false">
       
    80       </subitem>
       
    81    </item>
       
    82    <item title="Add a view" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/extensions.htm">
       
    83       <description>
       
    84          To define a view, perform the following steps:
       
    85       </description>
       
    86       <subitem label="Select &quot;org.eclipse.ui.views&quot; in the list box under &quot;All Extensions&quot; heading in the &quot;Extensions&quot; page" skip="false">
       
    87       </subitem>
       
    88       <subitem label="Right-click and select &quot;New-&gt;view&quot; from the context menu" skip="false">
       
    89       </subitem>
       
    90       <subitem label="Replace the content of the &quot;id&quot; text box under &quot;Extension Element Details&quot; with &quot;com.example.helloworld.view.helloworldview&quot;" skip="false">
       
    91       </subitem>
       
    92       <subitem label="Replace the content of the &quot;name&quot; text box with &quot;Hello World!&quot;" skip="false">
       
    93       </subitem>
       
    94       <subitem label="Replace the content of the &quot;class&quot; text box with &quot;com.example.helloworld.view.SampleView&quot;" skip="false">
       
    95       </subitem>
       
    96       <subitem label="Replace the content of the &quot;category&quot; text box with &quot;com.example.helloworld.view.helloworldcategory&quot;" skip="false">
       
    97       </subitem>
       
    98       <subitem label="Select &quot;File-&gt;Save&quot; from the main menu" skip="false">
       
    99       </subitem>
       
   100    </item>
       
   101    <item title="Create a view class" dialog="true" skip="false">
       
   102       <description>
       
   103          To create a view class, perform the following steps:
       
   104       </description>
       
   105       <subitem label="Click the &quot;class&quot; hyperlink under &quot;Extension Element Details&quot; to start the &quot;New Java Class&quot; wizard" skip="false">
       
   106       </subitem>
       
   107       <subitem label="Accept the default values and click the &quot;Finish&quot; button to exit the wizard" skip="false">
       
   108       </subitem>
       
   109    </item>
       
   110    <item title="Add view class code" dialog="true" skip="false">
       
   111       <description>
       
   112          We are now going to add code to our view class to simply
       
   113          display a &quot;Hello, Eclipse world!&quot; message in the view when
       
   114          it is opened.
       
   115          <br/>
       
   116          <br/>
       
   117          The previous step should have opened the <b>SampleView</b> class
       
   118          in a Java editor.
       
   119          <br/>
       
   120          <br/>
       
   121          Add the following lines of code under the pre-generated 
       
   122          <b>createPartControl</b> method:
       
   123          <br/>
       
   124          <br/>
       
   125 		 Label label = new Label( parent, SWT.LEFT );
       
   126          <br/>
       
   127 		 label.setText( &quot;Hello, Eclipse world!&quot; );
       
   128          <br/>
       
   129          <br/>
       
   130          Note:  There will be two import errors to correct.
       
   131          <br/>
       
   132          Either add the following import statements manually or
       
   133          click on the lightbulb icons in the margin of the Java
       
   134          editor to add them:
       
   135          <br/>
       
   136          <br/>
       
   137 		 import org.eclipse.swt.widgets.Label;
       
   138          <br/>
       
   139 		 import org.eclipse.swt.SWT;
       
   140 		 <br/>
       
   141 		 <br/>
       
   142 		 Select &quot;File-&gt;Save&quot; from the main menu
       
   143       </description>
       
   144    </item>
       
   145    <item title="Test the plug-in" dialog="true" skip="false" href="/org.eclipse.pde.doc.user/guide/tools/launchers/eclipse_application_launcher.htm">
       
   146       <description>
       
   147          To test your Eclipse plug-in inside a target Eclipse platform,
       
   148          perform the following steps:
       
   149       </description>
       
   150       <subitem label="Open the plug-in editor" skip="false">
       
   151          <command
       
   152                confirm="false"
       
   153                required="false"
       
   154 	           translate=""
       
   155                serialization="org.eclipse.ui.navigate.openResource(filePath=/com.example.helloworld/plugin.xml)">
       
   156          </command>
       
   157       </subitem>
       
   158       <subitem label="Select the &quot;Overview&quot; tab to display the &quot;Overview&quot; page" skip="false">
       
   159       </subitem>
       
   160       <subitem label="Click the &quot;Launch an Eclipse application&quot; hyperlink under the &quot;Testing&quot; heading" skip="false">
       
   161       </subitem>
       
   162       <subitem label="Select &quot;Window-&gt;Show View-&gt;Other...&quot; from the main menu in the newly launched Eclipse platform" skip="false">
       
   163       </subitem>
       
   164       <subitem label="Note the &quot;Hello World!&quot; category and expand its tree dialog" skip="false">
       
   165       </subitem>
       
   166       <subitem label="Select the &quot;Hello World!&quot; view and click the &quot;OK&quot; button" skip="false">
       
   167       </subitem>
       
   168       <subitem label="Select &quot;File-&gt;Exit&quot; from the main menu to exit the target Eclipse platform" skip="false">
       
   169       </subitem>
       
   170    </item>
       
   171 </cheatsheet>