Skip to main content
summaryrefslogtreecommitdiffstats
blob: e35caa5631ac3d42f2f50b039c5843aab87febe9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ui.cheatsheets">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.ui.cheatsheets" id="cheatSheetItemExtension" name="Cheat Sheet Item Extension"/>
      </appInfo>
      <documentation>
         This extension point should be used when an extra button needs to be added to a step in the cheat sheet.
You can put a new attribute into the &quot;item&quot; tag in the cheat sheet content file, and when that value is read by the cheat sheet framework,
it will check to see if there is a class registered through this extension point that will handle this attribute.  The attribute name found in the
cheat sheet content file is matched against all of the values found in the &quot;itemAttribute&quot; attribute of all of the registered cheatsheetItemExtension point implementations.  If there is a match, the class specified to handle this item attribute is loaded by the cheat sheet framework and is called to handle the attribute specified in the cheat sheet content file.

After having parsed the value of the item attribute, the class remains available to the cheat sheets framework.  When the item is rendered for the cheat sheets view, the class is once again called to handle the addition of components to a Composite.  The items that are added to this composite are displayed in the cheat sheet step (currently, beside the help icon).  It is displayed only for the step that is described by the &quot;item&quot; tag that the attribute appeared in the cheat sheet content file.

The suggested use of this extension point is adding a small (16x16) button with a graphic that opens a dialog box when pressed.
      </documentation>
   </annotation>

   <element name="extension">
      <complexType>
         <choice minOccurs="0" maxOccurs="unbounded">
            <element ref="itemExtension"/>
         </choice>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified identifier of the target extension point
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  an optional identifier of the extension instance
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  an optional name of the extension instance
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="itemExtension">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="name"/>
         </appInfo>
         <documentation>
            Use this item extension to add elements to cheat sheet steps.  You can use this extension point to add icons and buttons (currently, beside the
help icon) for a step in the cheat sheet.
You specify the name of an attribute that you will put into the cheat sheet item tag.  You also specify a class that will handle the parsing of the attribute value from the cheat sheet content file when the cheat sheet is loaded.  The attribute valuemust be a string. The specified class must subclass &lt;code&gt;org.eclipse.ui.cheatsheets.AbstractItemExtensionElement&lt;/code&gt;.  After the cheat sheet content file is parsed and loaded, the class specified in the extension point is called again through the interface to add graphics or buttons to the step in the cheat sheet (currently, next to the help button).
         </documentation>
      </annotation>
      <complexType>
         <attribute name="itemAttribute" type="string" use="required">
            <annotation>
               <documentation>
                  This attribute value must be the string value of an attribute name that is put into an item tag in the cheat sheet content file.  If this attribute string matches an attribute parsed from the item tag in the cheat sheet content file, the class specified will be loaded and will be called to parse the full value of the attribute using the w3 DOM specification.  It will later be called to add controls to a Composite, and the added components (usually graphics or buttons) will appear in the step of the cheat sheet for the item specified (currently, beside the help icon for that step).
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  The fully qualified class name of the class that subclasses &lt;code&gt;org.eclipse.ui.cheatsheets.AbstractItemExtensionElement&lt;/code&gt; to handle unknown attributes in the cheat sheet content file and extend the steps in the cheat sheet. The class must be public, and have a public 1-argument constructor that accepts the attribute name
(a &lt;code&gt;String&lt;/code&gt;).
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn="org.eclipse.ui.cheatsheets.AbstractItemExtensionElement"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         3.0
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         Here is an example implementation of this extension point:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.ui.cheatsheets.cheatSheetItemExtension&quot;&gt;
 &lt;itemExtension
   itemAttribute=&quot;xyzButton&quot;
   class=&quot;com.example.HandleParsingAndAddButton&quot;&gt;
 &lt;/itemExtension&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
And here is the item attribute for that extension:
&lt;p&gt;
&lt;pre&gt;
&lt;item title=&quot;XYZ Title&quot; xyzButton=&quot;/icon/button.gif&quot;/&gt;
&lt;/pre&gt;
&lt;/p&gt;
Note that the value of the attribute in the item tag can be ANYTHING. It can be anything because
the class that parses that attribute is the class HandleParsingAndAddButton, which in this example parses
a string /icon/button.gif from the attribute.  It later will use that info to load the gif and use it as the icon
for a new button.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         See the Javadoc information for org.eclipse.ui.cheatsheets.AbstractItemExtensionElement for API details.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         There is no supplied implementation at this time.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2004 IBM Corporation and others.&lt;br&gt;
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 
&lt;a 
href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
      </documentation>
   </annotation>

</schema>

Back to the top