-
Notifications
You must be signed in to change notification settings - Fork 163
/
IBootstrapSettings.java
197 lines (165 loc) · 6.08 KB
/
IBootstrapSettings.java
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
package de.agilecoders.wicket.core.settings;
import org.apache.wicket.request.resource.ResourceReference;
/**
* #### Description
*
* Settings interface for bootstrap settings.
*
* @author Michael Haitz <michael.haitz@agilecoders.de>
*/
public interface IBootstrapSettings {
/**
* The version of Bootstrap
*/
String VERSION = "3.3.7";
/**
* The version of modernizr
*/
String MODERNIZR_VERSION = "2.8.3";
/**
* The url to the JavaScript resource at a CDN network
*/
String JS_CDN_PATTERN = "//maxcdn.bootstrapcdn.com/bootstrap/%s/js/bootstrap.min.js";
/**
* The url to the modernizr JavaScript resource at a CDN network
*/
String MODERNIZR_CDN_PATTERN = "//cdnjs.cloudflare.com/ajax/libs/modernizr/%s/modernizr.min.js";
/**
* The url to the css resource at a CDN network
*/
String CSS_CDN_PATTERN = "//maxcdn.bootstrapcdn.com/bootstrap/%s/css/bootstrap.min.css";
/**
* @param version The version of Bootstrap. CDN resources use it to construct their urls
* @return same instance for chaining
*/
IBootstrapSettings setVersion(String version);
/**
* @param version The version of modernizr. CDN resources use it to construct their urls
* @return same instance for chaining
*/
IBootstrapSettings setModernizrVersion(String version);
/**
* @return the deferJavascript flag
*/
boolean deferJavascript();
/**
* @return The version of Bootstrap. CDN resources use it to construct their urls
*/
String getVersion();
/**
* @return The version of modernizr. CDN resources use it to construct their urls
*/
String getModernizrVersion();
/**
* @return True, if bootstrap resources should be added to each page automatically
*/
boolean autoAppendResources();
/**
* @return the base bootstrap css resource reference
*/
ResourceReference getCssResourceReference();
/**
* @return the base bootstrap JavaScript resource reference
*/
ResourceReference getJsResourceReference();
/**
* @return the modernizr JavaScript resource reference
*/
ResourceReference getModernizrResourceReference();
/**
* @param reference a reference to the base bootstrap css library.
* Defaults to the embedded bootstrap.css
* @return same instance for chaining
*/
IBootstrapSettings setCssResourceReference(ResourceReference reference);
/**
* @param reference a reference to the base bootstrap JavaScript library.
* Defaults to the embedded bootstrap.js
* @return same instance for chaining
*/
IBootstrapSettings setJsResourceReference(ResourceReference reference);
/**
* @param reference a reference to the Modernizr library.
* Defaults to the embedded modernizr.js
* @return same instance for chaining
*/
IBootstrapSettings setModernizrResourceReference(ResourceReference reference);
/**
* @return javascript resource filter name
*/
String getJsResourceFilterName();
/**
* set value to true, if bootstrap resources should be added to each page automatically
*
* @param value true, if bootstrap resources should be added to each page automatically
* @return same instance for chaining
*/
IBootstrapSettings setAutoAppendResources(boolean value);
/**
* sets the filter name for all bootstrap js resource references
*
* @param name javascript resource filter name
* @return same instance for chaining
*/
IBootstrapSettings setJsResourceFilterName(String name);
/**
* if true, all necessary exceptions will be added to security manager to allow
* fonts and less files. (default is true)
*
* @param activate true, if security manger should be updated while installing these settings
* @return same instance for chaining
*/
IBootstrapSettings setUpdateSecurityManager(boolean activate);
/**
* if true, the <script/> tag for the bootstrap javascript will get the defer="defer" attribute
*
* @param defer
* @return same instance for chaining
*/
IBootstrapSettings setDeferJavascript(boolean defer);
/**
* if true, all necessary exceptions will be added to security manager to allow
* fonts and less files. (default is true)
*
* @return true, if security manger should be updated while installing these settings
*/
boolean updateSecurityManager();
/**
* The {@link ActiveThemeProvider} provides access to the active theme
*
* @param themeProvider The {@link ActiveThemeProvider} instance
* @return same instance for chaining
*/
IBootstrapSettings setActiveThemeProvider(ActiveThemeProvider themeProvider);
/**
* @return The {@link ActiveThemeProvider} instance
*/
ActiveThemeProvider getActiveThemeProvider();
/**
* @return The {@link ThemeProvider} instance
*/
ThemeProvider getThemeProvider();
/**
* The {@link ThemeProvider} instance provides access to all available themes.
*
* @param themeProvider The {@link ThemeProvider} instance
* @return same instance for chaining
*/
IBootstrapSettings setThemeProvider(ThemeProvider themeProvider);
/**
* @return true, if the resources for the themes should be loaded from a CDN network
*/
boolean useCdnResources();
/**
* @return true, if wicket bootstrap uses the webjars library. If you don't want to use the webjars libraries,
* please set bootstrap css/js, modernizr reference to your own instance or call {@link #useCdnResources(boolean)}.
* Some components uses webjars references internally, so if you want to use them,
* please override the provided {@code newXYHeaderItem()} methods.
*/
boolean useWebjars();
/**
* @param useCdnResources a flag indicating whether the resources for the themes should be loaded from a CDN network
* @return this instance
*/
IBootstrapSettings useCdnResources(boolean useCdnResources);
}