1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.primefaces.extensions.model.monacoeditor;
25
26 import org.primefaces.shaded.json.*;
27 import java.io.ObjectStreamException;
28 import java.io.Serializable;
29
30
31
32
33
34
35
36
37 @SuppressWarnings("serial")
38 public class EditorSuggestOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorSuggestOptions(this);
41 }
42
43 private static class SerializedEditorSuggestOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorSuggestOptions(EditorSuggestOptions editorSuggestOptions) {
47 this.json = editorSuggestOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorSuggestOptions editorSuggestOptions = new EditorSuggestOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorSuggestOptions.put(key, value);
56 }
57 return editorSuggestOptions;
58 }
59 }
60
61
62
63
64 public Boolean isFilterGraceful() {
65 return (Boolean) (has("filterGraceful") ? get("filterGraceful") : null);
66 }
67
68
69
70
71
72 public EditorSuggestOptions setFilterGraceful(final Boolean filterGraceful) {
73 put("filterGraceful", filterGraceful);
74 return this;
75 }
76
77
78
79
80 public String getInsertMode() {
81 return (String) (has("insertMode") ? get("insertMode") : null);
82 }
83
84
85
86
87
88 public EditorSuggestOptions setInsertMode(final EInsertMode insertMode) {
89 put("insertMode", insertMode != null ? insertMode.toString() : null);
90 return this;
91 }
92
93
94
95
96
97 public EditorSuggestOptions setInsertMode(final String insertMode) {
98 put("insertMode", insertMode);
99 return this;
100 }
101
102
103
104
105 public Boolean isLocalityBonus() {
106 return (Boolean) (has("localityBonus") ? get("localityBonus") : null);
107 }
108
109
110
111
112
113 public EditorSuggestOptions setLocalityBonus(final Boolean localityBonus) {
114 put("localityBonus", localityBonus);
115 return this;
116 }
117
118
119
120
121 public Boolean isMatchOnWordStartOnly() {
122 return (Boolean) (has("matchOnWordStartOnly") ? get("matchOnWordStartOnly") : null);
123 }
124
125
126
127
128
129
130 public EditorSuggestOptions setMatchOnWordStartOnly(final Boolean matchOnWordStartOnly) {
131 put("matchOnWordStartOnly", matchOnWordStartOnly);
132 return this;
133 }
134
135
136
137
138 public Boolean isPreview() {
139 return (Boolean) (has("preview") ? get("preview") : null);
140 }
141
142
143
144
145
146 public EditorSuggestOptions setPreview(final Boolean preview) {
147 put("preview", preview);
148 return this;
149 }
150
151
152
153
154 public String getPreviewMode() {
155 return (String) (has("previewMode") ? get("previewMode") : null);
156 }
157
158
159
160
161
162 public EditorSuggestOptions setPreviewMode(final ESuggestPreviewMode previewMode) {
163 put("previewMode", previewMode != null ? previewMode.toString() : null);
164 return this;
165 }
166
167
168
169
170
171 public EditorSuggestOptions setPreviewMode(final String previewMode) {
172 put("previewMode", previewMode);
173 return this;
174 }
175
176
177
178
179 public String getSelectionMode() {
180 return (String) (has("selectionMode") ? get("selectionMode") : null);
181 }
182
183
184
185
186
187 public EditorSuggestOptions setSelectionMode(final ESuggestSelectionMode selectionMode) {
188 put("selectionMode", selectionMode != null ? selectionMode.toString() : null);
189 return this;
190 }
191
192
193
194
195
196 public EditorSuggestOptions setSelectionMode(final String selectionMode) {
197 put("selectionMode", selectionMode);
198 return this;
199 }
200
201
202
203
204 public Boolean isShareSuggestSelections() {
205 return (Boolean) (has("shareSuggestSelections") ? get("shareSuggestSelections") : null);
206 }
207
208
209
210
211
212 public EditorSuggestOptions setShareSuggestSelections(final Boolean shareSuggestSelections) {
213 put("shareSuggestSelections", shareSuggestSelections);
214 return this;
215 }
216
217
218
219
220 public Boolean isShowClasses() {
221 return (Boolean) (has("showClasses") ? get("showClasses") : null);
222 }
223
224
225
226
227
228 public EditorSuggestOptions setShowClasses(final Boolean showClasses) {
229 put("showClasses", showClasses);
230 return this;
231 }
232
233
234
235
236 public Boolean isShowColors() {
237 return (Boolean) (has("showColors") ? get("showColors") : null);
238 }
239
240
241
242
243
244 public EditorSuggestOptions setShowColors(final Boolean showColors) {
245 put("showColors", showColors);
246 return this;
247 }
248
249
250
251
252 public Boolean isShowConstants() {
253 return (Boolean) (has("showConstants") ? get("showConstants") : null);
254 }
255
256
257
258
259
260 public EditorSuggestOptions setShowConstants(final Boolean showConstants) {
261 put("showConstants", showConstants);
262 return this;
263 }
264
265
266
267
268 public Boolean isShowConstructors() {
269 return (Boolean) (has("showConstructors") ? get("showConstructors") : null);
270 }
271
272
273
274
275
276 public EditorSuggestOptions setShowConstructors(final Boolean showConstructors) {
277 put("showConstructors", showConstructors);
278 return this;
279 }
280
281
282
283
284 public Boolean isShowDeprecated() {
285 return (Boolean) (has("showDeprecated") ? get("showDeprecated") : null);
286 }
287
288
289
290
291
292 public EditorSuggestOptions setShowDeprecated(final Boolean showDeprecated) {
293 put("showDeprecated", showDeprecated);
294 return this;
295 }
296
297
298
299
300 public Boolean isShowEnumMembers() {
301 return (Boolean) (has("showEnumMembers") ? get("showEnumMembers") : null);
302 }
303
304
305
306
307
308 public EditorSuggestOptions setShowEnumMembers(final Boolean showEnumMembers) {
309 put("showEnumMembers", showEnumMembers);
310 return this;
311 }
312
313
314
315
316 public Boolean isShowEnums() {
317 return (Boolean) (has("showEnums") ? get("showEnums") : null);
318 }
319
320
321
322
323
324 public EditorSuggestOptions setShowEnums(final Boolean showEnums) {
325 put("showEnums", showEnums);
326 return this;
327 }
328
329
330
331
332 public Boolean isShowEvents() {
333 return (Boolean) (has("showEvents") ? get("showEvents") : null);
334 }
335
336
337
338
339
340 public EditorSuggestOptions setShowEvents(final Boolean showEvents) {
341 put("showEvents", showEvents);
342 return this;
343 }
344
345
346
347
348 public Boolean isShowFields() {
349 return (Boolean) (has("showFields") ? get("showFields") : null);
350 }
351
352
353
354
355
356 public EditorSuggestOptions setShowFields(final Boolean showFields) {
357 put("showFields", showFields);
358 return this;
359 }
360
361
362
363
364 public Boolean isShowFiles() {
365 return (Boolean) (has("showFiles") ? get("showFiles") : null);
366 }
367
368
369
370
371
372 public EditorSuggestOptions setShowFiles(final Boolean showFiles) {
373 put("showFiles", showFiles);
374 return this;
375 }
376
377
378
379
380 public Boolean isShowFolders() {
381 return (Boolean) (has("showFolders") ? get("showFolders") : null);
382 }
383
384
385
386
387
388 public EditorSuggestOptions setShowFolders(final Boolean showFolders) {
389 put("showFolders", showFolders);
390 return this;
391 }
392
393
394
395
396 public Boolean isShowFunctions() {
397 return (Boolean) (has("showFunctions") ? get("showFunctions") : null);
398 }
399
400
401
402
403
404 public EditorSuggestOptions setShowFunctions(final Boolean showFunctions) {
405 put("showFunctions", showFunctions);
406 return this;
407 }
408
409
410
411
412 public Boolean isShowIcons() {
413 return (Boolean) (has("showIcons") ? get("showIcons") : null);
414 }
415
416
417
418
419
420 public EditorSuggestOptions setShowIcons(final Boolean showIcons) {
421 put("showIcons", showIcons);
422 return this;
423 }
424
425
426
427
428 public Boolean isShowInlineDetails() {
429 return (Boolean) (has("showInlineDetails") ? get("showInlineDetails") : null);
430 }
431
432
433
434
435
436 public EditorSuggestOptions setShowInlineDetails(final Boolean showInlineDetails) {
437 put("showInlineDetails", showInlineDetails);
438 return this;
439 }
440
441
442
443
444 public Boolean isShowInterfaces() {
445 return (Boolean) (has("showInterfaces") ? get("showInterfaces") : null);
446 }
447
448
449
450
451
452 public EditorSuggestOptions setShowInterfaces(final Boolean showInterfaces) {
453 put("showInterfaces", showInterfaces);
454 return this;
455 }
456
457
458
459
460 public Boolean isShowIssues() {
461 return (Boolean) (has("showIssues") ? get("showIssues") : null);
462 }
463
464
465
466
467
468 public EditorSuggestOptions setShowIssues(final Boolean showIssues) {
469 put("showIssues", showIssues);
470 return this;
471 }
472
473
474
475
476 public Boolean isShowKeywords() {
477 return (Boolean) (has("showKeywords") ? get("showKeywords") : null);
478 }
479
480
481
482
483
484 public EditorSuggestOptions setShowKeywords(final Boolean showKeywords) {
485 put("showKeywords", showKeywords);
486 return this;
487 }
488
489
490
491
492 public Boolean isShowMethods() {
493 return (Boolean) (has("showMethods") ? get("showMethods") : null);
494 }
495
496
497
498
499
500 public EditorSuggestOptions setShowMethods(final Boolean showMethods) {
501 put("showMethods", showMethods);
502 return this;
503 }
504
505
506
507
508 public Boolean isShowModules() {
509 return (Boolean) (has("showModules") ? get("showModules") : null);
510 }
511
512
513
514
515
516 public EditorSuggestOptions setShowModules(final Boolean showModules) {
517 put("showModules", showModules);
518 return this;
519 }
520
521
522
523
524 public Boolean isShowOperators() {
525 return (Boolean) (has("showOperators") ? get("showOperators") : null);
526 }
527
528
529
530
531
532 public EditorSuggestOptions setShowOperators(final Boolean showOperators) {
533 put("showOperators", showOperators);
534 return this;
535 }
536
537
538
539
540 public Boolean isShowProperties() {
541 return (Boolean) (has("showProperties") ? get("showProperties") : null);
542 }
543
544
545
546
547
548 public EditorSuggestOptions setShowProperties(final Boolean showProperties) {
549 put("showProperties", showProperties);
550 return this;
551 }
552
553
554
555
556 public Boolean isShowReferences() {
557 return (Boolean) (has("showReferences") ? get("showReferences") : null);
558 }
559
560
561
562
563
564 public EditorSuggestOptions setShowReferences(final Boolean showReferences) {
565 put("showReferences", showReferences);
566 return this;
567 }
568
569
570
571
572 public Boolean isShowSnippets() {
573 return (Boolean) (has("showSnippets") ? get("showSnippets") : null);
574 }
575
576
577
578
579
580 public EditorSuggestOptions setShowSnippets(final Boolean showSnippets) {
581 put("showSnippets", showSnippets);
582 return this;
583 }
584
585
586
587
588 public Boolean isShowStatusBar() {
589 return (Boolean) (has("showStatusBar") ? get("showStatusBar") : null);
590 }
591
592
593
594
595
596 public EditorSuggestOptions setShowStatusBar(final Boolean showStatusBar) {
597 put("showStatusBar", showStatusBar);
598 return this;
599 }
600
601
602
603
604 public Boolean isShowStructs() {
605 return (Boolean) (has("showStructs") ? get("showStructs") : null);
606 }
607
608
609
610
611
612 public EditorSuggestOptions setShowStructs(final Boolean showStructs) {
613 put("showStructs", showStructs);
614 return this;
615 }
616
617
618
619
620 public Boolean isShowTypeParameters() {
621 return (Boolean) (has("showTypeParameters") ? get("showTypeParameters") : null);
622 }
623
624
625
626
627
628 public EditorSuggestOptions setShowTypeParameters(final Boolean showTypeParameters) {
629 put("showTypeParameters", showTypeParameters);
630 return this;
631 }
632
633
634
635
636 public Boolean isShowUnits() {
637 return (Boolean) (has("showUnits") ? get("showUnits") : null);
638 }
639
640
641
642
643
644 public EditorSuggestOptions setShowUnits(final Boolean showUnits) {
645 put("showUnits", showUnits);
646 return this;
647 }
648
649
650
651
652 public Boolean isShowUsers() {
653 return (Boolean) (has("showUsers") ? get("showUsers") : null);
654 }
655
656
657
658
659
660 public EditorSuggestOptions setShowUsers(final Boolean showUsers) {
661 put("showUsers", showUsers);
662 return this;
663 }
664
665
666
667
668 public Boolean isShowValues() {
669 return (Boolean) (has("showValues") ? get("showValues") : null);
670 }
671
672
673
674
675
676 public EditorSuggestOptions setShowValues(final Boolean showValues) {
677 put("showValues", showValues);
678 return this;
679 }
680
681
682
683
684 public Boolean isShowVariables() {
685 return (Boolean) (has("showVariables") ? get("showVariables") : null);
686 }
687
688
689
690
691
692 public EditorSuggestOptions setShowVariables(final Boolean showVariables) {
693 put("showVariables", showVariables);
694 return this;
695 }
696
697
698
699
700 public Boolean isShowWords() {
701 return (Boolean) (has("showWords") ? get("showWords") : null);
702 }
703
704
705
706
707
708 public EditorSuggestOptions setShowWords(final Boolean showWords) {
709 put("showWords", showWords);
710 return this;
711 }
712
713
714
715
716 public Boolean isSnippetsPreventQuickSuggestions() {
717 return (Boolean) (has("snippetsPreventQuickSuggestions") ? get("snippetsPreventQuickSuggestions") : null);
718 }
719
720
721
722
723
724
725 public EditorSuggestOptions setSnippetsPreventQuickSuggestions(final Boolean snippetsPreventQuickSuggestions) {
726 put("snippetsPreventQuickSuggestions", snippetsPreventQuickSuggestions);
727 return this;
728 }
729
730
731
732
733 JSONObject getJSONObject() {
734 return this;
735 }
736 }