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 EditorGuidesOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorGuidesOptions(this);
41 }
42
43 private static class SerializedEditorGuidesOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorGuidesOptions(EditorGuidesOptions editorGuidesOptions) {
47 this.json = editorGuidesOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorGuidesOptions editorGuidesOptions = new EditorGuidesOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorGuidesOptions.put(key, value);
56 }
57 return editorGuidesOptions;
58 }
59 }
60
61
62
63
64 public Boolean isBracketPairs() {
65 return (Boolean) (has("bracketPairs") ? get("bracketPairs") : null);
66 }
67
68
69
70
71
72 public EditorGuidesOptions setBracketPairs(final Boolean bracketPairs) {
73 put("bracketPairs", bracketPairs);
74 return this;
75 }
76
77
78
79
80 public Boolean isBracketPairsHorizontal() {
81 return (Boolean) (has("bracketPairsHorizontal") ? get("bracketPairsHorizontal") : null);
82 }
83
84
85
86
87
88 public EditorGuidesOptions setBracketPairsHorizontal(final Boolean bracketPairsHorizontal) {
89 put("bracketPairsHorizontal", bracketPairsHorizontal);
90 return this;
91 }
92
93
94
95
96 public Boolean isHighlightActiveBracketPair() {
97 return (Boolean) (has("highlightActiveBracketPair") ? get("highlightActiveBracketPair") : null);
98 }
99
100
101
102
103
104 public EditorGuidesOptions setHighlightActiveBracketPair(final Boolean highlightActiveBracketPair) {
105 put("highlightActiveBracketPair", highlightActiveBracketPair);
106 return this;
107 }
108
109
110
111
112 public Boolean isHighlightActiveIndentation() {
113 return (Boolean) (has("highlightActiveIndentation") ? get("highlightActiveIndentation") : null);
114 }
115
116
117
118
119
120 public EditorGuidesOptions setHighlightActiveIndentation(final Boolean highlightActiveIndentation) {
121 put("highlightActiveIndentation", highlightActiveIndentation);
122 return this;
123 }
124
125
126
127
128 public Boolean isIndentation() {
129 return (Boolean) (has("indentation") ? get("indentation") : null);
130 }
131
132
133
134
135
136 public EditorGuidesOptions setIndentation(final Boolean indentation) {
137 put("indentation", indentation);
138 return this;
139 }
140
141
142
143
144 JSONObject getJSONObject() {
145 return this;
146 }
147 }