Skip to main content
summaryrefslogtreecommitdiffstats
blob: 3e9041f4f33d2d4f80a4e7fc0cb36af7260a4734 (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
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
/**
 * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0 
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *         Florian Pirchner - Initial implementation
 */

package org.eclipse.osbp.ecview.dsl.formatting;

import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiBeanReferenceFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiBeanSlotElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiBindingElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiBindingEndpointAliasElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiBrowserElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiButtonElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiChangeTriggerElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiCheckBoxElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiColumnElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiColumnsAssignmentElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiComboBoxElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiDateFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiDecimalFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiDialogElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiErrorCodeElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiExposedActionElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiFormLayoutElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiGridLayoutElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiHorizontalLayoutElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiIDEViewElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiImageElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiLabelElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiListElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileHorizontalButtonGroupElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileNavBarActionElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileNavigationButtonElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileNavigationCommandElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileNavigationPageElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileSwitchElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileTabSheetElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileVerticalComponentGroupElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiMobileViewElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiNumericFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiOpenDialogCommandElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiOptionsGroupElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiProgressBarElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiSearchDialogElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiSearchFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiSearchPanelElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiSearchWithDialogCommandElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiTabAssignmentElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiTabSheetElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiTableElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiTextAreaElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiTextFieldElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiValidatorAliasElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiValidatorAssignmentElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiVerticalLayoutElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiViewSetElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiVisibilityProcessorElements;
import org.eclipse.osbp.ecview.dsl.services.UIGrammarGrammarAccess.UiXbaseVisibilityRuleElements;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
import org.eclipse.xtext.formatting.impl.FormattingConfig;
import org.eclipse.xtext.xbase.formatting.XbaseFormatter;

import com.google.inject.Inject;

@SuppressWarnings({ "restriction", "deprecation", "unused" })
public class UIGrammarFormatter extends AbstractDeclarativeFormatter {

	@Inject
	private UIGrammarGrammarAccess ga;
	@Inject
	private XbaseFormatter xbaseFormatter;

	protected void configureFormatting(FormattingConfig c) {
		configure(c, (UIGrammarGrammarAccess) getGrammarAccess());
	}

	protected void configure(FormattingConfig c, UIGrammarGrammarAccess ga) {

		UIGrammarGrammarAccess f = (UIGrammarGrammarAccess) getGrammarAccess();
		c.setAutoLinewrap(120);
		c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
		c.setLinewrap(0, 1, 2).after(f.getSL_COMMENTRule());
		c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
		c.setLinewrap(0, 1, 2).after(f.getML_COMMENTRule());

		c.setLinewrap(1,1,2).around(ga.getOXtypeGrammarAccess().getXImportDeclarationRule());
		
		// Modell
		configureUiModel(c, f.getUiModelAccess());
		// IDEView
		configureUiIdeView(c, f.getUiIDEViewAccess());
		// MobileView
		configureMobileView(c, f.getUiMobileViewAccess());
		// Viewset
		configureUiViewSet(c, f.getUiViewSetAccess());
		// Actions
		configureExposedActions(c, f.getUiExposedActionAccess());
		// Tabsheet
		configureUiTabSheet(c, f.getUiTabSheetAccess());
		// Tab
		configureUiTab(c, f.getUiTabAssignmentAccess());
		// MobileTab
		configureUiMobileTab(c, f.getUiMobileTabSheetAccess());
		// Columns
		configureUiColumns(c, f.getUiColumnsAssignmentAccess());
		// Forms
		configureUiForms(c, f.getUiFormLayoutAccess());
		// Combobox
		configureUiComboBoxAccess(c, f.getUiComboBoxAccess());
		// Table
		configureUiTable(c, f.getUiTableAccess());
		// Checkbox
		configureUiCheckBox(c, f.getUiCheckBoxAccess());
		// NumericFiled
		configureUiNumericFiled(c, f.getUiNumericFieldAccess());
		// Image
		configureUiImage(c, f.getUiImageAccess());
		// List
		configureUiList(c, f.getUiListAccess());
		// datasource
		configureUiBeanSlot(c, f.getUiBeanSlotAccess());
		// dataAlias
		configureUiBindingEndpointAlias(c, f.getUiBindingEndpointAliasAccess());
		// bind
		configureUiBinding(c, f.getUiBindingAccess());
		// column
		configureUiColumn(c, f.getUiColumnAccess());
		// Textfield
		configureUiTextField(c, f.getUiTextFieldAccess());
		// Decimalfield
		configureUiDecimalField(c, f.getUiDecimalFieldAccess());
		// Optionsgroup
		configureUiOptionsGroup(c, f.getUiOptionsGroupAccess());
		// Progressbar
		configureUiProgressbar(c, f.getUiProgressBarAccess());
		// BeanField
		configureUiBeanReferenceField(c, f.getUiBeanReferenceFieldAccess());
		// Searchdialog
		configureUiSearchDialog(c, f.getUiSearchDialogAccess());
		// Searchfield
		configureUiSearchfield(c, f.getUiSearchFieldAccess());
		// Textarea
		configureUiTextArea(c, f.getUiTextAreaAccess());
		// Browser
		configureUiBrowser(c, f.getUiBrowserAccess());
		// Datefield
		configureUiDatefield(c, f.getUiDateFieldAccess());
		// ValidatorALias
		configureUiValidatorAlias(c, f.getUiValidatorAliasAccess());
		// FieldValidation
		configureUiFieldValidation(c, f.getUiValidatorAssignmentAccess());

		c.setLinewrap(1, 1, 2).around(
				f.getUiMaxLengthValidatorAccess().getRule());
		c.setLinewrap(1, 1, 2).around(
				f.getUiMinLengthValidatorAccess().getRule());
		c.setLinewrap(1, 1, 2).around(f.getUiRegexpValidatorAccess().getRule());
		c.setLinewrap(1, 1, 2).around(f.getUiXbaseValidatorAccess().getRule());

		// GridLayout
		configureUiGridLayout(c, f.getUiGridLayoutAccess());
		// VerticalLayout
		configureUiVerticalLayout(c, f.getUiVerticalLayoutAccess());
		// HorizontalLayout
		configureUiHorizontalLayout(c, f.getUiHorizontalLayoutAccess());
		// HorizontalButtonGroup
		configureUiHorizontalButtonGroup(c,
				f.getUiMobileHorizontalButtonGroupAccess());
		// SearchPanel
		configureUiSearchPanel(c, f.getUiSearchPanelAccess());
		// VerticalGroup
		configureUiVerticalGroup(c, f.getUiMobileVerticalComponentGroupAccess());
		// Button
		configureUiButton(c, f.getUiButtonAccess());
		// MobileNavigationButton
		configureUiMobileNavigationButton(c,
				f.getUiMobileNavigationButtonAccess());
		// MobileNavBarAction
		configureUiMobileNavigationButton(c, f.getUiMobileNavBarActionAccess());

		// MobileNavigationPage
		configureUiMobileNavigationPage(c, f.getUiMobileNavigationPageAccess());
		// NavigateTo
		configureUiNavigateTo(c, f.getUiMobileNavigationCommandAccess());
		// Dialog
		configureUiDialog(c, f.getUiDialogAccess());
		// switchIt
		configureUiSwitchIt(c, f.getUiMobileSwitchAccess());
		// UiLabel
		configureUiLabel(c, f.getUiLabelAccess());
		// Visibility
		configureUiVisibility(c, f.getUiVisibilityProcessorAccess());
		configureUiVisibilityRule(c, f.getUiXbaseVisibilityRuleAccess());
		// fireOn
		configureUiFireOn(c, f.getUiChangeTriggerAccess());
		// openDialog
		configureUiOpenDialog(c, f.getUiOpenDialogCommandAccess());
		// searchWithCommand
		configureUiSearchWithCommand(c, f.getUiSearchWithDialogCommandAccess());
		// errorCodes
		configureUiErrorCode(c, f.getUiErrorCodeAccess());

		for (Keyword kw : f.findKeywords("{")) {
			c.setSpace(" ").before(kw);
			c.setLinewrap(1).after(kw);
			c.setIndentationIncrement().after(kw);
		}

		for (Keyword kw : f.findKeywords("}")) {
			c.setLinewrap(1).before(kw);
			c.setLinewrap(1).after(kw);
			c.setIndentationDecrement().before(kw);
		}

		for (Keyword kw : ga.findKeywords(".")) {
			c.setNoSpace().before(kw);
			c.setNoSpace().after(kw);
		}
		for (Keyword kw : ga.findKeywords("..")) {
			c.setNoSpace().before(kw);
			c.setNoSpace().after(kw);
		}
		for (Keyword kw : ga.findKeywords(":")) {
			c.setNoSpace().before(kw);
			c.setNoSpace().after(kw);
		}
		for (Keyword kw : ga.findKeywords("<")) {
			c.setNoSpace().after(kw);
			c.setSpace(" ").before(kw);
		}
		for (Keyword kw : ga.findKeywords(">")) {
			c.setNoSpace().before(kw);
			c.setSpace(" ").after(kw);
		}
		for (Keyword kw : ga.findKeywords(";")) {
			c.setNoSpace().before(kw);
			c.setLinewrap(1, 1, 2).after(kw);
		}
		for (Keyword kw : ga.findKeywords("@")) {
			c.setNoSpace().after(kw);
		}
		for (Keyword kw : ga.findKeywords("(")) {
			c.setNoSpace().after(kw);
			c.setNoSpace().before(kw);
		}
		for (Keyword kw : ga.findKeywords(")")) {
			c.setNoSpace().before(kw);
		}
		for (Keyword kw : ga.findKeywords("[")) {
			c.setNoSpace().after(kw);
		}
		for (Keyword kw : ga.findKeywords("]")) {
			c.setNoSpace().before(kw);
		}
	}

	private void configureExposedActions(FormattingConfig c,
			UiExposedActionElements ele) {
		c.setLinewrap(1, 1, 2).around(ele.getRule());
	}

	private void configureUiErrorCode(FormattingConfig c,
			UiErrorCodeElements ele) {
		c.setLinewrap(1, 1, 2).before(ele.getCodeKeyword_0());
	}

	private void configureUiSearchWithCommand(FormattingConfig c,
			UiSearchWithDialogCommandElements ele) {
	}

	private void configureUiOpenDialog(FormattingConfig c,
			UiOpenDialogCommandElements ele) {
	}

	private void configureUiNavigateTo(FormattingConfig c,
			UiMobileNavigationCommandElements ele) {
	}

	private void configureUiFireOn(FormattingConfig c,
			UiChangeTriggerElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getFireOnKeyword_0());
	}

	private void configureUiVisibility(FormattingConfig c,
			UiVisibilityProcessorElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getVisibilityKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getChangeTriggersAssignment_4_1());
		c.setLinewrap(1, 1, 2).before(ele.getDataUsedAssignment_4_0());
		c.setLinewrap(1, 1, 2).before(ele.getImportedElementsAssignment_4_2());
		c.setLinewrap(1, 2, 3).before(ele.getRuleAssignment_5());
	}

	private void configureUiVisibilityRule(FormattingConfig c,
			UiXbaseVisibilityRuleElements ele) {
		c.setLinewrap(1, 1, 2).around(ele.getRule());
	}

	private void configureUiLabel(FormattingConfig c, UiLabelElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getLabelKeyword_1());
	}

	private void configureUiSwitchIt(FormattingConfig c,
			UiMobileSwitchElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getSwitchItKeyword_1());
	}

	private void configureUiVerticalGroup(FormattingConfig c,
			UiMobileVerticalComponentGroupElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getVerticalGroupKeyword_1());
	}

	private void configureUiHorizontalButtonGroup(FormattingConfig c,
			UiMobileHorizontalButtonGroupElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getHorizontalButtonGroupKeyword_1());
	}

	private void configureUiHorizontalLayout(FormattingConfig c,
			UiHorizontalLayoutElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getHorizontalLayoutKeyword_1());
	}

	private void configureUiSearchPanel(FormattingConfig c,
			UiSearchPanelElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getSearchPanelKeyword_1());
	}

	private void configureUiVerticalLayout(FormattingConfig c,
			UiVerticalLayoutElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getVerticalLayoutKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getContentsAssignment_5());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_4());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_8());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_4());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_8());
	}

	private void configureUiGridLayout(FormattingConfig c,
			UiGridLayoutElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getGridlayoutKeyword_1());
	}

	private void configureUiFieldValidation(FormattingConfig c,
			UiValidatorAssignmentElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).around(ele.getRule());
	}

	private void configureUiValidatorAlias(FormattingConfig c,
			UiValidatorAliasElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getValidatorAliasKeyword_0());
	}

	private void configureUiSearchfield(FormattingConfig c,
			UiSearchFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getSearchfieldKeyword_1());
	}

	private void configureUiTextArea(FormattingConfig c, UiTextAreaElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTextareaKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getValidatorsAssignment_4_1_0());
	}

	private void configureUiSearchDialog(FormattingConfig c,
			UiSearchDialogElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getSearchdialogKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_5_0());
		c.setLinewrap(1, 1, 2).before(ele.getSearchKeyword_6_0());
		c.setLinewrap(1, 1, 2).before(ele.getContentKeyword_7_0());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3());
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_5_1());
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_6_1());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_5_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_6_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_9());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3());
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_5_1());
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_6_1());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_5_3());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_6_3());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_9());
	}

	private void configureUiDatefield(FormattingConfig c,
			UiDateFieldElements ele) {
		c.setLinewrap(1, 1, 2).before(ele.getDatefieldKeyword_1());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_3());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_3());
	}

	private void configureUiBrowser(FormattingConfig c, UiBrowserElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getBrowserKeyword_1());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_3());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_3());
	}

	private void configureUiProgressbar(FormattingConfig c,
			UiProgressBarElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getProgressbarKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getValidatorsAssignment_4_1_0());
		c.setLinewrap(1, 1, 2).before(
				ele.getProcessorAssignmentsAssignment_4_2());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_3());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_3());
	}

	private void configureUiOptionsGroup(FormattingConfig c,
			UiOptionsGroupElements ele) {
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_4());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_4());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_4());
	}

	private void configureUiMobileNavigationPage(FormattingConfig c,
			UiMobileNavigationPageElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_5_0());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_8());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_8());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_8());
	}

	private void configureUiDialog(FormattingConfig c, UiDialogElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_5_0());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_8());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_8());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_8());
	}

	private void configureUiList(FormattingConfig c, UiListElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getListSelectKeyword_1());
	}

	private void configureUiImage(FormattingConfig c, UiImageElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getImageKeyword_1());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_4());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_4());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_4());
	}

	private void configureUiNumericFiled(FormattingConfig c,
			UiNumericFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getNumericFieldKeyword_1());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_4_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_4_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_4_3());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_4_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_4_3());
	}

	private void configureUiCheckBox(FormattingConfig c, UiCheckBoxElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getCheckboxKeyword_1());
		// // Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_3());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_3());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_3());
	}

	private void configureUiTable(FormattingConfig c, UiTableElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_4_1_0_0());
		c.setLinewrap(1, 1, 2).before(ele.getSelectionTypeKeyword_4_1_1_0());
		c.setLinewrap(1, 1, 2).before(ele.getImageFieldKeyword_4_1_2_0());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_5());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_5());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_5());
	}

	private void configureUiBeanReferenceField(FormattingConfig c,
			UiBeanReferenceFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_4_1_0_0());
		c.setLinewrap(1, 1, 2).before(ele.getCaptionFieldKeyword_4_1_2_0());
		c.setLinewrap(1, 1, 2).before(ele.getImageFieldKeyword_4_1_4_0());
		c.setLinewrap(1, 1, 2).before(ele.getInMemoryServiceKeyword_4_1_5_0());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_5());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_5());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_5());
	}

	public void configureUiModel(FormattingConfig c,
			UIGrammarGrammarAccess.UiModelElements ele) {
		// linewrap
		c.setLinewrap(1, 1, 2).after(ele.getPackageNameAssignment_1());
		c.setLinewrap(1, 1, 2).around(ele.getImportSectionAssignment_2());
		// c.setLinewrap().around(ele.getRootsAssignment_3());
	}

	private void configureUiIdeView(FormattingConfig c, UiIDEViewElements ele) {
		// Keyword
		c.setLinewrap(1).before(ele.getIdeviewKeyword_0());
		c.setLinewrap(1, 1, 2).before(
				ele.getProcessorAssignmentsAssignment_7_3());
		c.setLinewrap(1).before(ele.getSharedStateGroupKeyword_3_0_0());

		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_2());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_7());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_2());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_7());
	}

	private void configureMobileView(FormattingConfig c,
			UiMobileViewElements ele) {
		// Keyword
		c.setLinewrap(1, 1, 2).before(ele.getMobileKeyword_0());
		c.setLinewrap(1, 1, 2).before(
				ele.getProcessorAssignmentsAssignment_7_3());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_2());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_7());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_2());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_7());
	}

	private void configureUiViewSet(FormattingConfig c, UiViewSetElements ele) {
		// Keywords
		c.setLinewrap(1).before(ele.getViewsetKeyword_0());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_2());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_5());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_5());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_2());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_5());
	}

	private void configureUiTabSheet(FormattingConfig c, UiTabSheetElements ele) {
		// Keywords
		c.setLinewrap(1).before(ele.getTabsheetKeyword_1());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_7());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_7());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_7());
	}

	private void configureUiTab(FormattingConfig c, UiTabAssignmentElements ele) {
		// Keyword
		c.setLinewrap(1, 1, 2).before(ele.getTabKeyword_0());
	}

	private void configureUiMobileTab(FormattingConfig c,
			UiMobileTabSheetElements ele) {
		// Keyword
		c.setLinewrap(1, 1, 2).before(ele.getMobileTabKeyword_1());
	}

	private void configureUiForms(FormattingConfig c, UiFormLayoutElements ele) {
		// Keywords
		// c.setLinewrap(1, 1, 2).before(ele.getFormKeyword_1());
		c.setLinewrap(1, 1, 2).after(ele.getContentsAssignment_5());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_7());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_7());
		// // indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_7());
	}

	private void configureUiColumns(FormattingConfig c,
			UiColumnsAssignmentElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getColumnsKeyword_1());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_2());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_4());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_4());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_2());
		// c.setIndentationDecrement().before(ele.getRightCurlyBracketKeyword_4());
	}

	private void configureUiBeanSlot(FormattingConfig c, UiBeanSlotElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getDatasourceKeyword_0());
		c.setLinewrap(1, 1, 2).after(ele.getJvmTypeAssignment_3());
	}

	private void configureUiBindingEndpointAlias(FormattingConfig c,
			UiBindingEndpointAliasElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getDataAliasKeyword_0());
		c.setLinewrap(1, 1, 2).after(ele.getAliasAssignment_3());
	}

	private void configureUiBinding(FormattingConfig c, UiBindingElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getBindKeyword_0());
		c.setLinewrap(1, 1, 2).after(ele.getTargetAssignment_4());
	}

	private void configureUiTextField(FormattingConfig c,
			UiTextFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTextfieldKeyword_1());
		c.setLinewrap(1, 1, 2).before(ele.getValidatorsAssignment_4_1_0());
		c.setLinewrap(1, 1, 2).before(ele.getBindingsAssignment_4_1_1());
	}

	private void configureUiNumericField(FormattingConfig c,
			UiNumericFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getNumericFieldKeyword_1());
	}

	private void configureUiDecimalField(FormattingConfig c,
			UiDecimalFieldElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getDecimalFieldKeyword_1());
	}

	private void configureUiColumn(FormattingConfig c, UiColumnElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getColumnKeyword_1());
	}

	private void configureUiButton(FormattingConfig c, UiButtonElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getButtonKeyword_1());
	}

	private void configureUiMobileNavigationButton(FormattingConfig c,
			UiMobileNavigationButtonElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2)
				.before(ele.getUiMobileNavigationButtonAction_0());
	}

	private void configureUiMobileNavigationButton(FormattingConfig c,
			UiMobileNavBarActionElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).around(ele.getRule());
	}

	private void configureUiComboBoxAccess(FormattingConfig c,
			UiComboBoxElements ele) {
		// Keywords
		c.setLinewrap(1, 1, 2).before(ele.getTypeKeyword_4_1_0_0());
		c.setLinewrap(1, 1, 2).before(ele.getCaptionFieldKeyword_4_1_1_0());
		c.setLinewrap(1, 1, 2).before(ele.getImageFieldKeyword_4_1_3_0());
		// Brackets
		// c.setLinewrap(1, 1, 2).after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setLinewrap(1).before(ele.getRightCurlyBracketKeyword_3_4());
		// c.setLinewrap(1, 1, 2).after(ele.getRightCurlyBracketKeyword_3_4());
		// // Indentation
		// c.setIndentationIncrement().after(ele.getLeftCurlyBracketKeyword_3_0());
		// c.setIndentationDecrement().before(
		// ele.getRightCurlyBracketKeyword_3_4());
	}

}

Back to the top