GuideDatePicker.java
2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.commons.json.io.JSONWriter
*/
package com.adobe.aemds.guide.common;
import com.adobe.aemds.guide.common.GuideField;
import com.adobe.aemds.guide.service.GuideException;
import java.io.StringWriter;
import java.io.Writer;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.commons.json.io.JSONWriter;
public class GuideDatePicker
extends GuideField {
public String getGuideFieldType() {
return "guideDatePicker";
}
public String getDateInputOptions() {
StringWriter jsonStringWriter = new StringWriter();
JSONWriter writer = new JSONWriter((Writer)jsonStringWriter);
try {
writer.object();
writer.key("dateFormat").value(this.resourceProps.get("dateDisplayFormat", (Object)"date{M/D/YYYY}"));
writer.key("placeholderMonth").value((Object)this.externalize((String)this.resourceProps.get("placeholderMonth", (Object)"")));
writer.key("placeholderDay").value((Object)this.externalize((String)this.resourceProps.get("placeholderDay", (Object)"")));
writer.key("placeholderYear").value((Object)this.externalize((String)this.resourceProps.get("placeholderYear", (Object)"")));
writer.key("labelMonth").value((Object)this.externalize((String)this.resourceProps.get("titleMonth", (Object)"")));
writer.key("labelDay").value((Object)this.externalize((String)this.resourceProps.get("titleDay", (Object)"")));
writer.key("labelYear").value((Object)this.externalize((String)this.resourceProps.get("titleYear", (Object)"")));
writer.key("hideLabels").value((Object)this.checkIfDateInputTitleHidden());
writer.endObject();
}
catch (Exception e) {
throw new GuideException(e);
}
return jsonStringWriter.toString();
}
public Boolean checkIfDateInputTitleHidden() {
return (Boolean)this.resourceProps.get("hideTitleDate", (Object)false);
}
public String getHeightOfDiv() {
if (!this.checkIfDateInputTitleHidden().booleanValue()) {
return "showDateInputLabels";
}
return "";
}
}