View Javadoc
1   
2   /*
3    * Copyright (c) 2011-2022 PrimeFaces Extensions
4    *
5    *  Permission is hereby granted, free of charge, to any person obtaining a copy
6    *  of this software and associated documentation files (the "Software"), to deal
7    *  in the Software without restriction, including without limitation the rights
8    *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9    *  copies of the Software, and to permit persons to whom the Software is
10   *  furnished to do so, subject to the following conditions:
11   *
12   *  The above copyright notice and this permission notice shall be included in
13   *  all copies or substantial portions of the Software.
14   *
15   *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16   *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17   *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18   *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19   *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20   *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21   *  THE SOFTWARE.
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  // THIS FILE WAS GENERATED AUTOMATICALLY. DO NOT EDIT DIRECTLY.
32  // ============================================================
33  
34  /**
35   * Configuration options for editor suggest widget
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       * @return Enable graceful matching. Defaults to {@code true}.
63       */
64      public Boolean isFilterGraceful() {
65          return (Boolean) (has("filterGraceful") ? get("filterGraceful") : null);
66      }
67  
68      /**
69       * @param filterGraceful Enable graceful matching. Defaults to {@code true}.
70       * @return This same instance, useful for chaining multiple setter methods in one call.
71       */
72      public EditorSuggestOptions setFilterGraceful(final Boolean filterGraceful) {
73          put("filterGraceful", filterGraceful);
74          return this;
75      }
76  
77      /**
78       * @return Overwrite word ends on accept. Default to {@code false}.
79       */
80      public String getInsertMode() {
81          return (String) (has("insertMode") ? get("insertMode") : null);
82      }
83  
84      /**
85       * @param insertMode Overwrite word ends on accept. Default to {@code false}.
86       * @return This same instance, useful for chaining multiple setter methods in one call.
87       */
88      public EditorSuggestOptions setInsertMode(final EInsertMode insertMode) {
89          put("insertMode", insertMode != null ? insertMode.toString() : null);
90          return this;
91      }
92  
93      /**
94       * @param insertMode Overwrite word ends on accept. Default to {@code false}.
95       * @return This same instance, useful for chaining multiple setter methods in one call.
96       */
97      public EditorSuggestOptions setInsertMode(final String insertMode) {
98          put("insertMode", insertMode);
99          return this;
100     }
101 
102     /**
103      * @return Favours words that appear close to the cursor.
104      */
105     public Boolean isLocalityBonus() {
106         return (Boolean) (has("localityBonus") ? get("localityBonus") : null);
107     }
108 
109     /**
110      * @param localityBonus Favours words that appear close to the cursor.
111      * @return This same instance, useful for chaining multiple setter methods in one call.
112      */
113     public EditorSuggestOptions setLocalityBonus(final Boolean localityBonus) {
114         put("localityBonus", localityBonus);
115         return this;
116     }
117 
118     /**
119      * @return Controls whether suggestions allow matches in the middle of the word instead of only at the beginning.
120      */
121     public Boolean isMatchOnWordStartOnly() {
122         return (Boolean) (has("matchOnWordStartOnly") ? get("matchOnWordStartOnly") : null);
123     }
124 
125     /**
126      * @param matchOnWordStartOnly Controls whether suggestions allow matches in the middle of the word instead of only
127      * at the beginning.
128      * @return This same instance, useful for chaining multiple setter methods in one call.
129      */
130     public EditorSuggestOptions setMatchOnWordStartOnly(final Boolean matchOnWordStartOnly) {
131         put("matchOnWordStartOnly", matchOnWordStartOnly);
132         return this;
133     }
134 
135     /**
136      * @return Enable or disable the rendering of the suggestion preview.
137      */
138     public Boolean isPreview() {
139         return (Boolean) (has("preview") ? get("preview") : null);
140     }
141 
142     /**
143      * @param preview Enable or disable the rendering of the suggestion preview.
144      * @return This same instance, useful for chaining multiple setter methods in one call.
145      */
146     public EditorSuggestOptions setPreview(final Boolean preview) {
147         put("preview", preview);
148         return this;
149     }
150 
151     /**
152      * @return Configures the mode of the preview.
153      */
154     public String getPreviewMode() {
155         return (String) (has("previewMode") ? get("previewMode") : null);
156     }
157 
158     /**
159      * @param previewMode Configures the mode of the preview.
160      * @return This same instance, useful for chaining multiple setter methods in one call.
161      */
162     public EditorSuggestOptions setPreviewMode(final ESuggestPreviewMode previewMode) {
163         put("previewMode", previewMode != null ? previewMode.toString() : null);
164         return this;
165     }
166 
167     /**
168      * @param previewMode Configures the mode of the preview.
169      * @return This same instance, useful for chaining multiple setter methods in one call.
170      */
171     public EditorSuggestOptions setPreviewMode(final String previewMode) {
172         put("previewMode", previewMode);
173         return this;
174     }
175 
176     /**
177      * @return Select suggestions when triggered via quick suggest or trigger characters.
178      */
179     public String getSelectionMode() {
180         return (String) (has("selectionMode") ? get("selectionMode") : null);
181     }
182 
183     /**
184      * @param selectionMode Select suggestions when triggered via quick suggest or trigger characters.
185      * @return This same instance, useful for chaining multiple setter methods in one call.
186      */
187     public EditorSuggestOptions setSelectionMode(final ESuggestSelectionMode selectionMode) {
188         put("selectionMode", selectionMode != null ? selectionMode.toString() : null);
189         return this;
190     }
191 
192     /**
193      * @param selectionMode Select suggestions when triggered via quick suggest or trigger characters.
194      * @return This same instance, useful for chaining multiple setter methods in one call.
195      */
196     public EditorSuggestOptions setSelectionMode(final String selectionMode) {
197         put("selectionMode", selectionMode);
198         return this;
199     }
200 
201     /**
202      * @return Enable using global storage for remembering suggestions.
203      */
204     public Boolean isShareSuggestSelections() {
205         return (Boolean) (has("shareSuggestSelections") ? get("shareSuggestSelections") : null);
206     }
207 
208     /**
209      * @param shareSuggestSelections Enable using global storage for remembering suggestions.
210      * @return This same instance, useful for chaining multiple setter methods in one call.
211      */
212     public EditorSuggestOptions setShareSuggestSelections(final Boolean shareSuggestSelections) {
213         put("shareSuggestSelections", shareSuggestSelections);
214         return this;
215     }
216 
217     /**
218      * @return Show class-suggestions.
219      */
220     public Boolean isShowClasses() {
221         return (Boolean) (has("showClasses") ? get("showClasses") : null);
222     }
223 
224     /**
225      * @param showClasses Show class-suggestions.
226      * @return This same instance, useful for chaining multiple setter methods in one call.
227      */
228     public EditorSuggestOptions setShowClasses(final Boolean showClasses) {
229         put("showClasses", showClasses);
230         return this;
231     }
232 
233     /**
234      * @return Show color-suggestions.
235      */
236     public Boolean isShowColors() {
237         return (Boolean) (has("showColors") ? get("showColors") : null);
238     }
239 
240     /**
241      * @param showColors Show color-suggestions.
242      * @return This same instance, useful for chaining multiple setter methods in one call.
243      */
244     public EditorSuggestOptions setShowColors(final Boolean showColors) {
245         put("showColors", showColors);
246         return this;
247     }
248 
249     /**
250      * @return Show constant-suggestions.
251      */
252     public Boolean isShowConstants() {
253         return (Boolean) (has("showConstants") ? get("showConstants") : null);
254     }
255 
256     /**
257      * @param showConstants Show constant-suggestions.
258      * @return This same instance, useful for chaining multiple setter methods in one call.
259      */
260     public EditorSuggestOptions setShowConstants(final Boolean showConstants) {
261         put("showConstants", showConstants);
262         return this;
263     }
264 
265     /**
266      * @return Show constructor-suggestions.
267      */
268     public Boolean isShowConstructors() {
269         return (Boolean) (has("showConstructors") ? get("showConstructors") : null);
270     }
271 
272     /**
273      * @param showConstructors Show constructor-suggestions.
274      * @return This same instance, useful for chaining multiple setter methods in one call.
275      */
276     public EditorSuggestOptions setShowConstructors(final Boolean showConstructors) {
277         put("showConstructors", showConstructors);
278         return this;
279     }
280 
281     /**
282      * @return Show deprecated-suggestions.
283      */
284     public Boolean isShowDeprecated() {
285         return (Boolean) (has("showDeprecated") ? get("showDeprecated") : null);
286     }
287 
288     /**
289      * @param showDeprecated Show deprecated-suggestions.
290      * @return This same instance, useful for chaining multiple setter methods in one call.
291      */
292     public EditorSuggestOptions setShowDeprecated(final Boolean showDeprecated) {
293         put("showDeprecated", showDeprecated);
294         return this;
295     }
296 
297     /**
298      * @return Show enumMember-suggestions.
299      */
300     public Boolean isShowEnumMembers() {
301         return (Boolean) (has("showEnumMembers") ? get("showEnumMembers") : null);
302     }
303 
304     /**
305      * @param showEnumMembers Show enumMember-suggestions.
306      * @return This same instance, useful for chaining multiple setter methods in one call.
307      */
308     public EditorSuggestOptions setShowEnumMembers(final Boolean showEnumMembers) {
309         put("showEnumMembers", showEnumMembers);
310         return this;
311     }
312 
313     /**
314      * @return Show enum-suggestions.
315      */
316     public Boolean isShowEnums() {
317         return (Boolean) (has("showEnums") ? get("showEnums") : null);
318     }
319 
320     /**
321      * @param showEnums Show enum-suggestions.
322      * @return This same instance, useful for chaining multiple setter methods in one call.
323      */
324     public EditorSuggestOptions setShowEnums(final Boolean showEnums) {
325         put("showEnums", showEnums);
326         return this;
327     }
328 
329     /**
330      * @return Show event-suggestions.
331      */
332     public Boolean isShowEvents() {
333         return (Boolean) (has("showEvents") ? get("showEvents") : null);
334     }
335 
336     /**
337      * @param showEvents Show event-suggestions.
338      * @return This same instance, useful for chaining multiple setter methods in one call.
339      */
340     public EditorSuggestOptions setShowEvents(final Boolean showEvents) {
341         put("showEvents", showEvents);
342         return this;
343     }
344 
345     /**
346      * @return Show field-suggestions.
347      */
348     public Boolean isShowFields() {
349         return (Boolean) (has("showFields") ? get("showFields") : null);
350     }
351 
352     /**
353      * @param showFields Show field-suggestions.
354      * @return This same instance, useful for chaining multiple setter methods in one call.
355      */
356     public EditorSuggestOptions setShowFields(final Boolean showFields) {
357         put("showFields", showFields);
358         return this;
359     }
360 
361     /**
362      * @return Show file-suggestions.
363      */
364     public Boolean isShowFiles() {
365         return (Boolean) (has("showFiles") ? get("showFiles") : null);
366     }
367 
368     /**
369      * @param showFiles Show file-suggestions.
370      * @return This same instance, useful for chaining multiple setter methods in one call.
371      */
372     public EditorSuggestOptions setShowFiles(final Boolean showFiles) {
373         put("showFiles", showFiles);
374         return this;
375     }
376 
377     /**
378      * @return Show folder-suggestions.
379      */
380     public Boolean isShowFolders() {
381         return (Boolean) (has("showFolders") ? get("showFolders") : null);
382     }
383 
384     /**
385      * @param showFolders Show folder-suggestions.
386      * @return This same instance, useful for chaining multiple setter methods in one call.
387      */
388     public EditorSuggestOptions setShowFolders(final Boolean showFolders) {
389         put("showFolders", showFolders);
390         return this;
391     }
392 
393     /**
394      * @return Show function-suggestions.
395      */
396     public Boolean isShowFunctions() {
397         return (Boolean) (has("showFunctions") ? get("showFunctions") : null);
398     }
399 
400     /**
401      * @param showFunctions Show function-suggestions.
402      * @return This same instance, useful for chaining multiple setter methods in one call.
403      */
404     public EditorSuggestOptions setShowFunctions(final Boolean showFunctions) {
405         put("showFunctions", showFunctions);
406         return this;
407     }
408 
409     /**
410      * @return Enable or disable icons in suggestions. Defaults to {@code true}.
411      */
412     public Boolean isShowIcons() {
413         return (Boolean) (has("showIcons") ? get("showIcons") : null);
414     }
415 
416     /**
417      * @param showIcons Enable or disable icons in suggestions. Defaults to {@code true}.
418      * @return This same instance, useful for chaining multiple setter methods in one call.
419      */
420     public EditorSuggestOptions setShowIcons(final Boolean showIcons) {
421         put("showIcons", showIcons);
422         return this;
423     }
424 
425     /**
426      * @return Show details inline with the label. Defaults to {@code true}.
427      */
428     public Boolean isShowInlineDetails() {
429         return (Boolean) (has("showInlineDetails") ? get("showInlineDetails") : null);
430     }
431 
432     /**
433      * @param showInlineDetails Show details inline with the label. Defaults to {@code true}.
434      * @return This same instance, useful for chaining multiple setter methods in one call.
435      */
436     public EditorSuggestOptions setShowInlineDetails(final Boolean showInlineDetails) {
437         put("showInlineDetails", showInlineDetails);
438         return this;
439     }
440 
441     /**
442      * @return Show interface-suggestions.
443      */
444     public Boolean isShowInterfaces() {
445         return (Boolean) (has("showInterfaces") ? get("showInterfaces") : null);
446     }
447 
448     /**
449      * @param showInterfaces Show interface-suggestions.
450      * @return This same instance, useful for chaining multiple setter methods in one call.
451      */
452     public EditorSuggestOptions setShowInterfaces(final Boolean showInterfaces) {
453         put("showInterfaces", showInterfaces);
454         return this;
455     }
456 
457     /**
458      * @return Show issue-suggestions.
459      */
460     public Boolean isShowIssues() {
461         return (Boolean) (has("showIssues") ? get("showIssues") : null);
462     }
463 
464     /**
465      * @param showIssues Show issue-suggestions.
466      * @return This same instance, useful for chaining multiple setter methods in one call.
467      */
468     public EditorSuggestOptions setShowIssues(final Boolean showIssues) {
469         put("showIssues", showIssues);
470         return this;
471     }
472 
473     /**
474      * @return Show keyword-suggestions.
475      */
476     public Boolean isShowKeywords() {
477         return (Boolean) (has("showKeywords") ? get("showKeywords") : null);
478     }
479 
480     /**
481      * @param showKeywords Show keyword-suggestions.
482      * @return This same instance, useful for chaining multiple setter methods in one call.
483      */
484     public EditorSuggestOptions setShowKeywords(final Boolean showKeywords) {
485         put("showKeywords", showKeywords);
486         return this;
487     }
488 
489     /**
490      * @return Show method-suggestions.
491      */
492     public Boolean isShowMethods() {
493         return (Boolean) (has("showMethods") ? get("showMethods") : null);
494     }
495 
496     /**
497      * @param showMethods Show method-suggestions.
498      * @return This same instance, useful for chaining multiple setter methods in one call.
499      */
500     public EditorSuggestOptions setShowMethods(final Boolean showMethods) {
501         put("showMethods", showMethods);
502         return this;
503     }
504 
505     /**
506      * @return Show module-suggestions.
507      */
508     public Boolean isShowModules() {
509         return (Boolean) (has("showModules") ? get("showModules") : null);
510     }
511 
512     /**
513      * @param showModules Show module-suggestions.
514      * @return This same instance, useful for chaining multiple setter methods in one call.
515      */
516     public EditorSuggestOptions setShowModules(final Boolean showModules) {
517         put("showModules", showModules);
518         return this;
519     }
520 
521     /**
522      * @return Show operator-suggestions.
523      */
524     public Boolean isShowOperators() {
525         return (Boolean) (has("showOperators") ? get("showOperators") : null);
526     }
527 
528     /**
529      * @param showOperators Show operator-suggestions.
530      * @return This same instance, useful for chaining multiple setter methods in one call.
531      */
532     public EditorSuggestOptions setShowOperators(final Boolean showOperators) {
533         put("showOperators", showOperators);
534         return this;
535     }
536 
537     /**
538      * @return Show property-suggestions.
539      */
540     public Boolean isShowProperties() {
541         return (Boolean) (has("showProperties") ? get("showProperties") : null);
542     }
543 
544     /**
545      * @param showProperties Show property-suggestions.
546      * @return This same instance, useful for chaining multiple setter methods in one call.
547      */
548     public EditorSuggestOptions setShowProperties(final Boolean showProperties) {
549         put("showProperties", showProperties);
550         return this;
551     }
552 
553     /**
554      * @return Show reference-suggestions.
555      */
556     public Boolean isShowReferences() {
557         return (Boolean) (has("showReferences") ? get("showReferences") : null);
558     }
559 
560     /**
561      * @param showReferences Show reference-suggestions.
562      * @return This same instance, useful for chaining multiple setter methods in one call.
563      */
564     public EditorSuggestOptions setShowReferences(final Boolean showReferences) {
565         put("showReferences", showReferences);
566         return this;
567     }
568 
569     /**
570      * @return Show snippet-suggestions.
571      */
572     public Boolean isShowSnippets() {
573         return (Boolean) (has("showSnippets") ? get("showSnippets") : null);
574     }
575 
576     /**
577      * @param showSnippets Show snippet-suggestions.
578      * @return This same instance, useful for chaining multiple setter methods in one call.
579      */
580     public EditorSuggestOptions setShowSnippets(final Boolean showSnippets) {
581         put("showSnippets", showSnippets);
582         return this;
583     }
584 
585     /**
586      * @return Enable or disable the suggest status bar.
587      */
588     public Boolean isShowStatusBar() {
589         return (Boolean) (has("showStatusBar") ? get("showStatusBar") : null);
590     }
591 
592     /**
593      * @param showStatusBar Enable or disable the suggest status bar.
594      * @return This same instance, useful for chaining multiple setter methods in one call.
595      */
596     public EditorSuggestOptions setShowStatusBar(final Boolean showStatusBar) {
597         put("showStatusBar", showStatusBar);
598         return this;
599     }
600 
601     /**
602      * @return Show struct-suggestions.
603      */
604     public Boolean isShowStructs() {
605         return (Boolean) (has("showStructs") ? get("showStructs") : null);
606     }
607 
608     /**
609      * @param showStructs Show struct-suggestions.
610      * @return This same instance, useful for chaining multiple setter methods in one call.
611      */
612     public EditorSuggestOptions setShowStructs(final Boolean showStructs) {
613         put("showStructs", showStructs);
614         return this;
615     }
616 
617     /**
618      * @return Show typeParameter-suggestions.
619      */
620     public Boolean isShowTypeParameters() {
621         return (Boolean) (has("showTypeParameters") ? get("showTypeParameters") : null);
622     }
623 
624     /**
625      * @param showTypeParameters Show typeParameter-suggestions.
626      * @return This same instance, useful for chaining multiple setter methods in one call.
627      */
628     public EditorSuggestOptions setShowTypeParameters(final Boolean showTypeParameters) {
629         put("showTypeParameters", showTypeParameters);
630         return this;
631     }
632 
633     /**
634      * @return Show unit-suggestions.
635      */
636     public Boolean isShowUnits() {
637         return (Boolean) (has("showUnits") ? get("showUnits") : null);
638     }
639 
640     /**
641      * @param showUnits Show unit-suggestions.
642      * @return This same instance, useful for chaining multiple setter methods in one call.
643      */
644     public EditorSuggestOptions setShowUnits(final Boolean showUnits) {
645         put("showUnits", showUnits);
646         return this;
647     }
648 
649     /**
650      * @return Show user-suggestions.
651      */
652     public Boolean isShowUsers() {
653         return (Boolean) (has("showUsers") ? get("showUsers") : null);
654     }
655 
656     /**
657      * @param showUsers Show user-suggestions.
658      * @return This same instance, useful for chaining multiple setter methods in one call.
659      */
660     public EditorSuggestOptions setShowUsers(final Boolean showUsers) {
661         put("showUsers", showUsers);
662         return this;
663     }
664 
665     /**
666      * @return Show value-suggestions.
667      */
668     public Boolean isShowValues() {
669         return (Boolean) (has("showValues") ? get("showValues") : null);
670     }
671 
672     /**
673      * @param showValues Show value-suggestions.
674      * @return This same instance, useful for chaining multiple setter methods in one call.
675      */
676     public EditorSuggestOptions setShowValues(final Boolean showValues) {
677         put("showValues", showValues);
678         return this;
679     }
680 
681     /**
682      * @return Show variable-suggestions.
683      */
684     public Boolean isShowVariables() {
685         return (Boolean) (has("showVariables") ? get("showVariables") : null);
686     }
687 
688     /**
689      * @param showVariables Show variable-suggestions.
690      * @return This same instance, useful for chaining multiple setter methods in one call.
691      */
692     public EditorSuggestOptions setShowVariables(final Boolean showVariables) {
693         put("showVariables", showVariables);
694         return this;
695     }
696 
697     /**
698      * @return Show text-suggestions.
699      */
700     public Boolean isShowWords() {
701         return (Boolean) (has("showWords") ? get("showWords") : null);
702     }
703 
704     /**
705      * @param showWords Show text-suggestions.
706      * @return This same instance, useful for chaining multiple setter methods in one call.
707      */
708     public EditorSuggestOptions setShowWords(final Boolean showWords) {
709         put("showWords", showWords);
710         return this;
711     }
712 
713     /**
714      * @return Prevent quick suggestions when a snippet is active. Defaults to {@code true}.
715      */
716     public Boolean isSnippetsPreventQuickSuggestions() {
717         return (Boolean) (has("snippetsPreventQuickSuggestions") ? get("snippetsPreventQuickSuggestions") : null);
718     }
719 
720     /**
721      * @param snippetsPreventQuickSuggestions Prevent quick suggestions when a snippet is active. Defaults to {@code
722      * true}.
723      * @return This same instance, useful for chaining multiple setter methods in one call.
724      */
725     public EditorSuggestOptions setSnippetsPreventQuickSuggestions(final Boolean snippetsPreventQuickSuggestions) {
726         put("snippetsPreventQuickSuggestions", snippetsPreventQuickSuggestions);
727         return this;
728     }
729 
730     /**
731      * @return This options object as a serializable JSON object
732      */
733     JSONObject getJSONObject() {
734         return this;
735     }
736 }