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 EditorMinimapOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorMinimapOptions(this);
41 }
42
43 private static class SerializedEditorMinimapOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorMinimapOptions(EditorMinimapOptions editorMinimapOptions) {
47 this.json = editorMinimapOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorMinimapOptions editorMinimapOptions = new EditorMinimapOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorMinimapOptions.put(key, value);
56 }
57 return editorMinimapOptions;
58 }
59 }
60
61
62
63
64 public Boolean isAutohide() {
65 return (Boolean) (has("autohide") ? get("autohide") : null);
66 }
67
68
69
70
71
72 public EditorMinimapOptions setAutohide(final Boolean autohide) {
73 put("autohide", autohide);
74 return this;
75 }
76
77
78
79
80 public Boolean isEnabled() {
81 return (Boolean) (has("enabled") ? get("enabled") : null);
82 }
83
84
85
86
87
88 public EditorMinimapOptions setEnabled(final Boolean enabled) {
89 put("enabled", enabled);
90 return this;
91 }
92
93
94
95
96 public Number getMaxColumn() {
97 return (Number) (has("maxColumn") ? get("maxColumn") : null);
98 }
99
100
101
102
103
104
105 public EditorMinimapOptions setMaxColumn(final Number maxColumn) {
106 put("maxColumn", maxColumn);
107 return this;
108 }
109
110
111
112
113 public Boolean isRenderCharacters() {
114 return (Boolean) (has("renderCharacters") ? get("renderCharacters") : null);
115 }
116
117
118
119
120
121 public EditorMinimapOptions setRenderCharacters(final Boolean renderCharacters) {
122 put("renderCharacters", renderCharacters);
123 return this;
124 }
125
126
127
128
129 public Number getScale() {
130 return (Number) (has("scale") ? get("scale") : null);
131 }
132
133
134
135
136
137 public EditorMinimapOptions setScale(final Number scale) {
138 put("scale", scale);
139 return this;
140 }
141
142
143
144
145 public Number getSectionHeaderFontSize() {
146 return (Number) (has("sectionHeaderFontSize") ? get("sectionHeaderFontSize") : null);
147 }
148
149
150
151
152
153 public EditorMinimapOptions setSectionHeaderFontSize(final Number sectionHeaderFontSize) {
154 put("sectionHeaderFontSize", sectionHeaderFontSize);
155 return this;
156 }
157
158
159
160
161 public Number getSectionHeaderLetterSpacing() {
162 return (Number) (has("sectionHeaderLetterSpacing") ? get("sectionHeaderLetterSpacing") : null);
163 }
164
165
166
167
168
169
170 public EditorMinimapOptions setSectionHeaderLetterSpacing(final Number sectionHeaderLetterSpacing) {
171 put("sectionHeaderLetterSpacing", sectionHeaderLetterSpacing);
172 return this;
173 }
174
175
176
177
178 public Boolean isShowMarkSectionHeaders() {
179 return (Boolean) (has("showMarkSectionHeaders") ? get("showMarkSectionHeaders") : null);
180 }
181
182
183
184
185
186 public EditorMinimapOptions setShowMarkSectionHeaders(final Boolean showMarkSectionHeaders) {
187 put("showMarkSectionHeaders", showMarkSectionHeaders);
188 return this;
189 }
190
191
192
193
194 public Boolean isShowRegionSectionHeaders() {
195 return (Boolean) (has("showRegionSectionHeaders") ? get("showRegionSectionHeaders") : null);
196 }
197
198
199
200
201
202 public EditorMinimapOptions setShowRegionSectionHeaders(final Boolean showRegionSectionHeaders) {
203 put("showRegionSectionHeaders", showRegionSectionHeaders);
204 return this;
205 }
206
207
208
209
210 public String getShowSlider() {
211 return (String) (has("showSlider") ? get("showSlider") : null);
212 }
213
214
215
216
217
218 public EditorMinimapOptions setShowSlider(final EMinimapShowSlider showSlider) {
219 put("showSlider", showSlider != null ? showSlider.toString() : null);
220 return this;
221 }
222
223
224
225
226
227 public EditorMinimapOptions setShowSlider(final String showSlider) {
228 put("showSlider", showSlider);
229 return this;
230 }
231
232
233
234
235 public String getSide() {
236 return (String) (has("side") ? get("side") : null);
237 }
238
239
240
241
242
243 public EditorMinimapOptions setSide(final EMinimapSide side) {
244 put("side", side != null ? side.toString() : null);
245 return this;
246 }
247
248
249
250
251
252 public EditorMinimapOptions setSide(final String side) {
253 put("side", side);
254 return this;
255 }
256
257
258
259
260 public String getSize() {
261 return (String) (has("size") ? get("size") : null);
262 }
263
264
265
266
267
268 public EditorMinimapOptions setSize(final EMinimapSize size) {
269 put("size", size != null ? size.toString() : null);
270 return this;
271 }
272
273
274
275
276
277 public EditorMinimapOptions setSize(final String size) {
278 put("size", size);
279 return this;
280 }
281
282
283
284
285 JSONObject getJSONObject() {
286 return this;
287 }
288 }