-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.xml
More file actions
382 lines (359 loc) · 14.1 KB
/
plugin.xml
File metadata and controls
382 lines (359 loc) · 14.1 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<!-- Editor extension for .jl lexer descriptions -->
<extension
point="org.eclipse.ui.editors">
<editor
name="Dolmen Lexer Editor"
extensions="jl"
icon="icons/dolmen_lexer.gif"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
class="org.stekikun.dolmenplugin.editors.jl.JLEditor"
id="org.stekikun.dolmenplugin.editors.jl.JLEditor">
</editor>
</extension>
<!-- Editor extension for .jg grammar descriptions -->
<extension
point="org.eclipse.ui.editors">
<editor
name="Dolmen Grammar Editor"
extensions="jg"
icon="icons/dolmen_parser3.gif"
contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
class="org.stekikun.dolmenplugin.editors.jg.JGEditor"
id="org.stekikun.dolmenplugin.editors.jg.JGEditor">
</editor>
</extension>
<!-- Builder extension for .jl lexer and .jg grammar descriptions -->
<extension point="org.eclipse.core.resources.builders"
name="Dolmen Lexer and Grammar Builder"
id="org.stekikun.dolmenplugin.base.Builder">
<builder
hasNature="true">
<run
class="org.stekikun.dolmenplugin.base.Builder">
</run>
</builder>
</extension>
<!-- Marker extension for Dolmen files -->
<extension
id="org.stekikun.dolmenplugin.base.marker"
name="Dolmen Problems"
point="org.eclipse.core.resources.markers">
<super
type="org.eclipse.core.resources.problemmarker">
</super>
<persistent value="true"/>
</extension>
<!-- Nature extension for project containing Dolmen files -->
<extension point="org.eclipse.core.resources.natures"
name="Dolmen Nature"
id="DolmenNature" >
<runtime>
<run
class="org.stekikun.dolmenplugin.base.Nature">
</run>
</runtime>
<requires-nature
id="org.eclipse.jdt.core.javanature">
</requires-nature>
<builder
id="org.stekikun.dolmenplugin.base.Builder">
</builder>
</extension>
<!-- Expression checking the Dolmen nature of one project -->
<!-- NB: Even when selecting only a single projects, it seems the
default variable received from the Package Explorer is an array
of IProject, so we need to be careful and iterate on the selection.
Conversely, if the Navigator or Project Explorer sends the IProject
as is, can it be adapted to a singleton iterable? I hope so... -->
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="DolmenPlugin.hasNature">
<adapt
type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.projectNature"
value="DolmenPlugin.DolmenNature">
</test>
</adapt>
</definition>
</extension>
<!-- Declaration of the commands to add and remove the Dolmen nature -->
<extension
point="org.eclipse.ui.commands">
<command
description="Use this command to add the Dolmen nature to the selected project"
id="org.stekikun.dolmenplugin.ConvertDolmenNatureCommand"
name="Convert to Dolmen Project">
</command>
<command
description="Use this command to remove the Dolmen nature from the selected project"
id="org.stekikun.dolmenplugin.RemoveDolmenNatureCommand"
name="Remove Dolmen nature">
</command>
</extension>
<!-- Handler for the commands to add and remove the Dolmen nature -->
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.stekikun.dolmenplugin.handlers.ConvertDolmenNatureHandler"
commandId="org.stekikun.dolmenplugin.ConvertDolmenNatureCommand">
</handler>
<handler
class="org.stekikun.dolmenplugin.handlers.RemoveDolmenNatureHandler"
commandId="org.stekikun.dolmenplugin.RemoveDolmenNatureCommand">
</handler>
</extension>
<!-- Menu contribution to the Project -> Configure -> -->
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.projectConfigure">
<command
commandId="org.stekikun.dolmenplugin.ConvertDolmenNatureCommand"
label="Add Dolmen nature"
style="push">
<!-- Only visible when ALL selected projects are missing the Dolmen nature -->
<visibleWhen
checkEnabled="false">
<iterate ifEmpty="false">
<not>
<reference
definitionId="DolmenPlugin.hasNature">
</reference>
</not>
</iterate>
</visibleWhen>
</command>
</menuContribution>
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.projectConfigure">
<command
commandId="org.stekikun.dolmenplugin.RemoveDolmenNatureCommand"
label="Remove Dolmen nature"
style="push">
<!-- Only visible when ALL selected projects have the Dolmen nature -->
<visibleWhen checkEnabled="false">
<iterate ifEmpty="false">
<reference
definitionId="DolmenPlugin.hasNature">
</reference>
</iterate>
</visibleWhen>
</command>
</menuContribution>
</extension>
<!-- Defining a decorator for project with the Dolmen nature -->
<!-- <extension
point="org.eclipse.ui.ide.projectNatureImages">
<image
icon="icons/sample.gif"
id="DolmenPlugin.DolmenNatureImage"
natureId="DolmenPlugin.DolmenNature">
</image>
</extension> -->
<!-- Default annotation model for Dolmen markers -->
<extension
point="org.eclipse.core.filebuffers.annotationModelCreation">
<factory
extensions="jg,jl"
class="org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory">
</factory>
</extension>
<!-- Custom console for reporting Dolmen builders activity -->
<extension
point="org.eclipse.ui.console.consoleFactories">
<consoleFactory
class="org.stekikun.dolmenplugin.base.Console"
icon="icons/sample.gif"
label="Dolmen Console">
</consoleFactory>
</extension>
<!-- Declaration of the commands that appear in the Source menu -->
<extension
point="org.eclipse.ui.commands">
<command
description="Comment or uncomment the lines of the current selection"
id="org.stekikun.dolmenplugin.ToggleCommentCommand"
name="Toggle Comment">
</command>
<command
description="Go to declaration of element currently selected"
id="org.stekikun.dolmenplugin.OpenDeclarationCommand"
name="Open Declaration">
</command>
<command
description="Go to location of next annotation"
id="org.stekikun.dolmenplugin.NextAnnotationCommand"
name="NextAnnotation">
</command>
<command
description="Go to location of previous annotation"
id="org.stekikun.dolmenplugin.PreviousAnnotationCommand"
name="PreviousAnnotation">
</command>
</extension>
<!-- Handler for the commands that appear in the custom Source menu-->
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.stekikun.dolmenplugin.handlers.ToggleCommentHandler"
commandId="org.stekikun.dolmenplugin.ToggleCommentCommand">
</handler>
<handler
class="org.stekikun.dolmenplugin.handlers.OpenDeclarationHandler"
commandId="org.stekikun.dolmenplugin.OpenDeclarationCommand">
</handler>
<handler
class="org.stekikun.dolmenplugin.handlers.NextAnnotationHandler"
commandId="org.stekikun.dolmenplugin.NextAnnotationCommand">
</handler>
<handler
class="org.stekikun.dolmenplugin.handlers.PreviousAnnotationHandler"
commandId="org.stekikun.dolmenplugin.PreviousAnnotationCommand">
</handler>
</extension>
<!-- Custom source menus for .jl and .jg editors -->
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu?after=edit">
<menu
label="Source"
id="org.stekikun.dolmenplugin.menus.source">
<!-- Only visible when the active editor is either a JLEditor or a JGEditor -->
<visibleWhen
checkEnabled="false">
<with variable="activeEditorId">
<or>
<equals value="org.stekikun.dolmenplugin.editors.jl.JLEditor"/>
<equals value="org.stekikun.dolmenplugin.editors.jg.JGEditor"/>
</or>
</with>
</visibleWhen>
<!-- The Toggle Comment command -->
<command
commandId="org.stekikun.dolmenplugin.ToggleCommentCommand"
label="Toggle Comment">
</command>
<!-- The Open Declaration command -->
<command
commandId="org.stekikun.dolmenplugin.OpenDeclarationCommand"
label="Open Declaration">
</command>
<!-- The Next Annotation command -->
<command
commandId="org.stekikun.dolmenplugin.NextAnnotationCommand"
label="Next Annotation">
</command>
<!-- The Previous Annotation command -->
<command
commandId="org.stekikun.dolmenplugin.PreviousAnnotationCommand"
label="PreviousAnnotation">
</command>
</menu>
</menuContribution>
</extension>
<!-- Contexts Extension -->
<!-- This defines the Editor context (scope) for commands and key bindings -->
<!-- Requires 'setEditorContextMenuId(String editor.id);' in Editor contructor -->
<extension
point="org.eclipse.ui.contexts">
<context
id="org.stekikun.dolmenplugin.editors.DolmenScope"
name="Dolmen editors"
parentId="org.eclipse.jdt.ui.javaEditorScope">
</context>
</extension>
<!-- Keyboard shortcuts for some of the Dolmen commands -->
<extension
point="org.eclipse.ui.bindings">
<!-- Toggle Comment is bound to "Ctrl + /", as in the JDT -->
<key
sequence="M1+/"
commandId="org.stekikun.dolmenplugin.ToggleCommentCommand"
contextId="org.stekikun.dolmenplugin.editors.DolmenScope"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
<!-- Open Declaration is bound to "F3", as in the JDT -->
<key
sequence="F3"
commandId="org.stekikun.dolmenplugin.OpenDeclarationCommand"
contextId="org.stekikun.dolmenplugin.editors.DolmenScope"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
<!-- Next Annotation is bound to "Ctrl + .", as in the JDT -->
<key
sequence="M1+."
commandId="org.stekikun.dolmenplugin.NextAnnotationCommand"
contextId="org.stekikun.dolmenplugin.editors.DolmenScope"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
<!-- Previous Annotation is bound to "Ctrl + ,", as in the JDT -->
<key
sequence="M1+,"
commandId="org.stekikun.dolmenplugin.PreviousAnnotationCommand"
contextId="org.stekikun.dolmenplugin.editors.DolmenScope"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>
<!-- Document setup participants for Dolmen files
NB: These are necessary in order to connect the adequate partitioners
and use TextFileDocumentProviders because TextFileDocumentProvider
does not have an overridable #createDocument like FileDocumentProvider
has
-->
<extension
id="JLDocumentSetupParticipant"
name="Dolmen lexer descriptions setup participant"
point="org.eclipse.core.filebuffers.documentSetup">
<participant
extensions="jl"
class="org.stekikun.dolmenplugin.editors.jl.JLDocumentSetupParticipant">
</participant>
</extension>
<extension
id="JGDocumentSetupParticipant"
name="Dolmen grammar descriptions setup participant"
point="org.eclipse.core.filebuffers.documentSetup">
<participant
extensions="jg"
class="org.stekikun.dolmenplugin.editors.jg.JGDocumentSetupParticipant">
</participant>
</extension>
<!-- <extension
point="org.eclipse.ui.editors.documentProviders">
<provider
class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
inputTypes="org.eclipse.ui.IStorageEditorInput"
id="org.eclipse.ui.editors.text.StorageDocumentProvider">
</provider>
</extension> -->
<!-- Decoration of files generated by Dolmen in
the Project/Package explorer -->
<extension
point="org.eclipse.ui.decorators">
<decorator
id="org.stekikun.dolmenPlugin.decorators.DolmenDecorator"
label="Dolmen files decorator"
lightweight="true"
adaptable="true"
class="org.stekikun.dolmenplugin.decorators.DolmenDecorator"
state="true">
<description>
These decorators are used by Dolmen to mark
generated Java files in the Project or Package explorers.
</description>
<enablement>
<objectClass
name="org.eclipse.core.resources.IResource">
</objectClass>
</enablement>
</decorator>
</extension>
</plugin>