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 EditorScrollbarOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorScrollbarOptions(this);
41 }
42
43 private static class SerializedEditorScrollbarOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorScrollbarOptions(EditorScrollbarOptions editorScrollbarOptions) {
47 this.json = editorScrollbarOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorScrollbarOptions editorScrollbarOptions = new EditorScrollbarOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorScrollbarOptions.put(key, value);
56 }
57 return editorScrollbarOptions;
58 }
59 }
60
61
62
63
64
65 public Boolean isAlwaysConsumeMouseWheel() {
66 return (Boolean) (has("alwaysConsumeMouseWheel") ? get("alwaysConsumeMouseWheel") : null);
67 }
68
69
70
71
72
73
74 public EditorScrollbarOptions setAlwaysConsumeMouseWheel(final Boolean alwaysConsumeMouseWheel) {
75 put("alwaysConsumeMouseWheel", alwaysConsumeMouseWheel);
76 return this;
77 }
78
79
80
81
82 public Number getArrowSize() {
83 return (Number) (has("arrowSize") ? get("arrowSize") : null);
84 }
85
86
87
88
89
90 public EditorScrollbarOptions setArrowSize(final Number arrowSize) {
91 put("arrowSize", arrowSize);
92 return this;
93 }
94
95
96
97
98 public Boolean isHandleMouseWheel() {
99 return (Boolean) (has("handleMouseWheel") ? get("handleMouseWheel") : null);
100 }
101
102
103
104
105
106 public EditorScrollbarOptions setHandleMouseWheel(final Boolean handleMouseWheel) {
107 put("handleMouseWheel", handleMouseWheel);
108 return this;
109 }
110
111
112
113
114 public String getHorizontal() {
115 return (String) (has("horizontal") ? get("horizontal") : null);
116 }
117
118
119
120
121
122 public EditorScrollbarOptions setHorizontal(final EScrollbarHorizontal horizontal) {
123 put("horizontal", horizontal != null ? horizontal.toString() : null);
124 return this;
125 }
126
127
128
129
130
131 public EditorScrollbarOptions setHorizontal(final String horizontal) {
132 put("horizontal", horizontal);
133 return this;
134 }
135
136
137
138
139 public Boolean isHorizontalHasArrows() {
140 return (Boolean) (has("horizontalHasArrows") ? get("horizontalHasArrows") : null);
141 }
142
143
144
145
146
147
148 public EditorScrollbarOptions setHorizontalHasArrows(final Boolean horizontalHasArrows) {
149 put("horizontalHasArrows", horizontalHasArrows);
150 return this;
151 }
152
153
154
155
156 public Number getHorizontalScrollbarSize() {
157 return (Number) (has("horizontalScrollbarSize") ? get("horizontalScrollbarSize") : null);
158 }
159
160
161
162
163
164 public EditorScrollbarOptions setHorizontalScrollbarSize(final Number horizontalScrollbarSize) {
165 put("horizontalScrollbarSize", horizontalScrollbarSize);
166 return this;
167 }
168
169
170
171
172 public Number getHorizontalSliderSize() {
173 return (Number) (has("horizontalSliderSize") ? get("horizontalSliderSize") : null);
174 }
175
176
177
178
179
180
181 public EditorScrollbarOptions setHorizontalSliderSize(final Number horizontalSliderSize) {
182 put("horizontalSliderSize", horizontalSliderSize);
183 return this;
184 }
185
186
187
188
189 public Boolean isIgnoreHorizontalScrollbarInContentHeight() {
190 return (Boolean) (has("ignoreHorizontalScrollbarInContentHeight") ? get("ignoreHorizontalScrollbarInContentHeight") : null);
191 }
192
193
194
195
196
197
198 public EditorScrollbarOptions setIgnoreHorizontalScrollbarInContentHeight(final Boolean ignoreHorizontalScrollbarInContentHeight) {
199 put("ignoreHorizontalScrollbarInContentHeight", ignoreHorizontalScrollbarInContentHeight);
200 return this;
201 }
202
203
204
205
206 public Boolean isScrollByPage() {
207 return (Boolean) (has("scrollByPage") ? get("scrollByPage") : null);
208 }
209
210
211
212
213
214 public EditorScrollbarOptions setScrollByPage(final Boolean scrollByPage) {
215 put("scrollByPage", scrollByPage);
216 return this;
217 }
218
219
220
221
222 public Boolean isUseShadows() {
223 return (Boolean) (has("useShadows") ? get("useShadows") : null);
224 }
225
226
227
228
229
230 public EditorScrollbarOptions setUseShadows(final Boolean useShadows) {
231 put("useShadows", useShadows);
232 return this;
233 }
234
235
236
237
238 public String getVertical() {
239 return (String) (has("vertical") ? get("vertical") : null);
240 }
241
242
243
244
245
246 public EditorScrollbarOptions setVertical(final EScrollbarVertical vertical) {
247 put("vertical", vertical != null ? vertical.toString() : null);
248 return this;
249 }
250
251
252
253
254
255 public EditorScrollbarOptions setVertical(final String vertical) {
256 put("vertical", vertical);
257 return this;
258 }
259
260
261
262
263 public Boolean isVerticalHasArrows() {
264 return (Boolean) (has("verticalHasArrows") ? get("verticalHasArrows") : null);
265 }
266
267
268
269
270
271
272 public EditorScrollbarOptions setVerticalHasArrows(final Boolean verticalHasArrows) {
273 put("verticalHasArrows", verticalHasArrows);
274 return this;
275 }
276
277
278
279
280 public Number getVerticalScrollbarSize() {
281 return (Number) (has("verticalScrollbarSize") ? get("verticalScrollbarSize") : null);
282 }
283
284
285
286
287
288 public EditorScrollbarOptions setVerticalScrollbarSize(final Number verticalScrollbarSize) {
289 put("verticalScrollbarSize", verticalScrollbarSize);
290 return this;
291 }
292
293
294
295
296 public Number getVerticalSliderSize() {
297 return (Number) (has("verticalSliderSize") ? get("verticalSliderSize") : null);
298 }
299
300
301
302
303
304 public EditorScrollbarOptions setVerticalSliderSize(final Number verticalSliderSize) {
305 put("verticalSliderSize", verticalSliderSize);
306 return this;
307 }
308
309
310
311
312 JSONObject getJSONObject() {
313 return this;
314 }
315 }