|
6 | 6 | <!-- =========================================================================== --> |
7 | 7 | <extension |
8 | 8 | point="org.eclipse.ui.editors.templates"> |
9 | | - <contextTypeRegistry |
10 | | - id="org.eclipse.jdt.ui.CompilationUnitEditor"> |
11 | | - </contextTypeRegistry> |
12 | | - <contextType |
13 | | - name="Java ContextType" |
14 | | - class="org.eclipse.jdt.internal.corext.template.java.JavaContextType" |
15 | | - id="java" |
16 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
17 | | - </contextType> |
18 | | - <contextType |
19 | | - name="Statements" |
20 | | - class="org.eclipse.jdt.internal.corext.template.java.JavaContextType" |
21 | | - id="java-statements" |
22 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
23 | | - </contextType> |
24 | | - <contextType |
25 | | - name="Members" |
26 | | - class="org.eclipse.jdt.internal.corext.template.java.JavaContextType" |
27 | | - id="java-members" |
28 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
29 | | - </contextType> |
30 | | - <contextType |
31 | | - name="SWT Context Type" |
32 | | - class="org.eclipse.jdt.internal.corext.template.java.SWTContextType" |
33 | | - id="swt" |
34 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
35 | | - </contextType> |
36 | | - <contextType |
37 | | - name="SWT Statements" |
38 | | - class="org.eclipse.jdt.internal.corext.template.java.SWTContextType" |
39 | | - id="swt-statements" |
40 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
41 | | - </contextType> |
42 | | - <contextType |
43 | | - name="SWT Members" |
44 | | - class="org.eclipse.jdt.internal.corext.template.java.SWTContextType" |
45 | | - id="swt-members" |
46 | | - registryId="org.eclipse.jdt.ui.CompilationUnitEditor"> |
47 | | - </contextType> |
48 | 9 | <include |
49 | 10 | file="templates/additional-swttemplates.xml" |
50 | 11 | > |
51 | 12 | </include> |
52 | 13 | <include |
53 | 14 | file="templates/additional-templates.xml"> |
54 | 15 | </include> |
55 | | - <resolver |
56 | | - class="org.eclipse.jdt.internal.corext.template.java.LocalVarResolver" |
57 | | - contextTypeId="e4-members" |
58 | | - description="<b>${<i>id</i>:localVar(type[,type]*)}</b><br>Evaluates |
59 | | -to a local variable or parameter visible in the current scope that is |
60 | | -a subtype of any of the given types. If no type is specified, any |
61 | | -non-primitive local variable |
62 | | -matches.<br><br><b>Example:</b><br><code>${iterable:localVar(java.lang.Iterable)}</code>" |
63 | | - name="Local Variable" |
64 | | - type="localVar"/> |
65 | | - <resolver |
66 | | - class="org.eclipse.jdt.internal.corext.template.java.VarResolver" |
67 | | - contextTypeId="e4-members" |
68 | | - description="<b>${<i>id</i>:var(type[,type]*)}</b><br>Evaluates |
69 | | -to a field, local variable or parameter visible in the current scope |
70 | | -that is a subtype of any of the given types. If no type is specified, |
71 | | -any non-primitive variable |
72 | | -matches.<br><br><b>Example:</b><br><code>${array:var('java.lang.Object[]')}</code>" |
73 | | - name="Variable" |
74 | | - type="var"/> |
75 | | - <resolver |
76 | | - class="org.eclipse.jdt.internal.corext.template.java.NameResolver" |
77 | | - contextTypeId="e4-members" |
78 | | - description="<b>${<i>id</i>:newName(reference)}</b><br>Evaluates |
79 | | -to an non-conflicting name for a new local variable of the type |
80 | | -specified by the reference. The reference may either be a Java type |
81 | | -name or the name of another template variable. The generated name |
82 | | -respects the code style |
83 | | -settings.<br><br><b>Example:</b><br><code>${index:newName(int)}</code> |
84 | | -" |
85 | | - name="New Name" |
86 | | - type="newName"/> |
87 | | - <resolver |
88 | | - class="org.eclipse.jdt.internal.corext.template.java.TypeResolver" |
89 | | - contextTypeId="e4-members" |
90 | | - description="<b>${<i>id</i>:newType(fullyQualifiedType)}</b><br>Evaluates |
91 | | -to a type name given the fully qualified Java type name. Evaluates to |
92 | | -a simple type name and an import if no conflicting type exists. |
93 | | -Evaluates to a fully qualified type name |
94 | | -otherwise.<br><br><b>Example:</b><br><code>${type:newType(java.util.Iterator)}</code>" |
95 | | - name="New Type" |
96 | | - type="newType"/> |
97 | | - <resolver |
98 | | - class="org.eclipse.jdt.internal.corext.template.java.ElementTypeResolver" |
99 | | - contextTypeId="e4-members" |
100 | | - description="<b>${<i>id</i>:elemType(variable)}</b><br>Evaluates |
101 | | -to the element type of the referenced template variable. The reference |
102 | | -should be the name of another template variable that resolves to an |
103 | | -array or an instance of |
104 | | -<code>java.lang.Iterable</code>.<br><br><b>Example:</b><br><code>${t:elemType(a)} |
105 | | -elem = ${a:array};</code>" |
106 | | - name="Element Type" |
107 | | - type="elemType"/> |
108 | | - <resolver |
109 | | - class="org.eclipse.jdt.internal.corext.template.java.TypeVariableResolver" |
110 | | - contextTypeId="e4-members" |
111 | | - description="<b>${<i>id</i>:argType(variable, |
112 | | -n)}</b><br> Evaluates to the <em>nth</em> type |
113 | | -argument of the referenced template variable. The reference should be |
114 | | -the name of another template variable. Resolves to |
115 | | -<code>java.lang.Object</code> if the referenced variable |
116 | | -cannot be found or is not a parameterized |
117 | | -type.<br><br><b>Example:</b><br><code>${type:argType(vector, |
118 | | -0)} ${first:name(type)} = |
119 | | -${vector:var(java.util.Vector)}.get(0);</code>;" |
120 | | - name="Argument Type" |
121 | | - type="argType"/> |
122 | | - <resolver |
123 | | - class="org.eclipse.jdt.internal.corext.template.java.LinkResolver" |
124 | | - contextTypeId="e4-members" |
125 | | - description="<b>${<i>id</i>:link([proposal[,proposal]*])}</b><br>Evaluates |
126 | | -to <i>id</i> if the list of proposals is empty, evaluates |
127 | | -to the first proposal otherwise. The evaluated value is put into |
128 | | -linked mode. A proposal window shows all the given |
129 | | -proposals.<br><br><b>Example1:</b><br><code>java.util.Collections.${kind:link(EMPTY_SET, |
130 | | -EMPTY_LIST, 'EMPTY_MAP.entrySet()')}</code><br><br><b>Example2:</b><br><code>int |
131 | | -${integer:link}; ${integer}= 0;</code>" |
132 | | - name="Linked Mode" |
133 | | - type="link"/> |
134 | | - <resolver |
135 | | - class="org.eclipse.jdt.internal.corext.template.java.ImportsResolver" |
136 | | - contextTypeId="e4-members" |
137 | | - description="<b>${:import([type[,type]*])}</b><br>Adds |
138 | | -an import statement for each type that is not already imported. Does |
139 | | -nothing if a conflicting import exists. Evaluates to |
140 | | -nothing.<br><br><b>Example:</b><br><code>${:import(java.util.List, |
141 | | -java.util.Collection)}</code> |
142 | | -" |
143 | | - name="Import" |
144 | | - type="import"/> |
145 | | - <resolver |
146 | | - class="org.eclipse.jdt.internal.corext.template.java.StaticImportResolver" |
147 | | - contextTypeId="e4-members" |
148 | | - description="<b>${:importStatic([qualifiedName[,qualifiedName]*])}</b><br>Adds |
149 | | -a static import statement for each qualified name that is not already |
150 | | -imported. The <code>qualifiedName</code> is the fully |
151 | | -qualified name of a static field or method, or it is the qualified |
152 | | -name of a type plus a <code>.*</code> suffix, enclosed in |
153 | | -single quotes <code>'\u0027</code>. Does nothing if a |
154 | | -conflicting import exists. Evaluates to |
155 | | -nothing.<br><br><b>Example:</b><br><code>${:importStatic(java.util.Collections.EMPTY_SET, |
156 | | -'java.lang.System.*')}</code> |
157 | | -" |
158 | | - name="Import Static" |
159 | | - type="importStatic"/> |
160 | | - <resolver |
161 | | - class="org.eclipse.jdt.internal.corext.template.java.ExceptionVariableNameResolver" |
162 | | - contextTypeId="e4-members" |
163 | | - description="Exception variable name in catch blocks" |
164 | | - name="Exception Variable Name" |
165 | | - type="exception_variable_name"> |
166 | | - </resolver> |
167 | 16 | </extension> |
168 | 17 |
|
169 | 18 | </plugin> |
0 commit comments