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 EditorInlineEditOptions extends JSONObject implements Serializable {
39 private Object writeReplace() throws ObjectStreamException {
40 return new SerializedEditorInlineEditOptions(this);
41 }
42
43 private static class SerializedEditorInlineEditOptions implements Serializable {
44 private String json;
45
46 public SerializedEditorInlineEditOptions(EditorInlineEditOptions editorInlineEditOptions) {
47 this.json = editorInlineEditOptions.toString();
48 }
49
50 private Object readResolve() throws ObjectStreamException {
51 final EditorInlineEditOptions editorInlineEditOptions = new EditorInlineEditOptions();
52 final JSONObject data = new JSONObject(json);
53 for (final String key : data.keySet()) {
54 final Object value = data.get(key);
55 editorInlineEditOptions.put(key, value);
56 }
57 return editorInlineEditOptions;
58 }
59 }
60
61
62
63
64 public Boolean isEnabled() {
65 return (Boolean) (has("enabled") ? get("enabled") : null);
66 }
67
68
69
70
71
72 public EditorInlineEditOptions setEnabled(final Boolean enabled) {
73 put("enabled", enabled);
74 return this;
75 }
76
77
78
79
80 public String getFontFamily() {
81 return (String) (has("fontFamily") ? get("fontFamily") : null);
82 }
83
84
85
86
87
88 public EditorInlineEditOptions setFontFamily(final String fontFamily) {
89 put("fontFamily", fontFamily);
90 return this;
91 }
92
93
94
95
96 public Boolean isKeepOnBlur() {
97 return (Boolean) (has("keepOnBlur") ? get("keepOnBlur") : null);
98 }
99
100
101
102
103
104 public EditorInlineEditOptions setKeepOnBlur(final Boolean keepOnBlur) {
105 put("keepOnBlur", keepOnBlur);
106 return this;
107 }
108
109 public String getShowToolbar() {
110 return (String) (has("showToolbar") ? get("showToolbar") : null);
111 }
112
113 public EditorInlineEditOptions setShowToolbar(final EInlineEditorShowToolbarMode showToolbar) {
114 put("showToolbar", showToolbar != null ? showToolbar.toString() : null);
115 return this;
116 }
117
118 public EditorInlineEditOptions setShowToolbar(final String showToolbar) {
119 put("showToolbar", showToolbar);
120 return this;
121 }
122
123
124
125
126 JSONObject getJSONObject() {
127 return this;
128 }
129 }