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