IncludeOptions.java
2.24 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.servlet.ServletRequest
*/
package com.day.cq.wcm.api.components;
import com.day.cq.wcm.api.Page;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.ServletRequest;
public class IncludeOptions {
public static String ATTR_NAME = IncludeOptions.class.getName();
private Page currentPage;
private boolean sameContext = false;
private boolean forceEditContext = false;
private String cellName;
private Set<String> cssClassNames = new HashSet<String>();
private String decorationTagName;
public static IncludeOptions getOptions(ServletRequest req, boolean force) {
IncludeOptions opts = (IncludeOptions)req.getAttribute(ATTR_NAME);
if (opts == null && force) {
opts = new IncludeOptions();
req.setAttribute(ATTR_NAME, (Object)opts);
}
return opts;
}
public static IncludeOptions clear(ServletRequest req) {
IncludeOptions opts = (IncludeOptions)req.getAttribute(ATTR_NAME);
if (opts != null) {
req.removeAttribute(ATTR_NAME);
}
return opts;
}
public IncludeOptions forceSameContext(boolean force) {
this.sameContext = force;
return this;
}
public boolean isSameContext() {
return this.sameContext;
}
public IncludeOptions forceCurrentPage(Page currentPage) {
this.currentPage = currentPage;
return this;
}
public Page getCurrentPage() {
return this.currentPage;
}
public IncludeOptions forceCellName(String cellName) {
this.cellName = cellName;
return this;
}
public String getCellName() {
return this.cellName;
}
public Set<String> getCssClassNames() {
return this.cssClassNames;
}
public boolean isForceEditContext() {
return this.forceEditContext;
}
public void forceEditContext(boolean forceEditContext) {
this.forceEditContext = forceEditContext;
}
public String getDecorationTagName() {
return this.decorationTagName;
}
public void setDecorationTagName(String decorationTagName) {
this.decorationTagName = decorationTagName;
}
}