java.lang.Object
de.agilecoders.wicket.core.Bootstrap
#### Description
This is the bootstrap initializer class, you've to call `install` (with or without custom settings) to
enable wicket-bootstrap in your project. wicket-bootstrap sets some wicket settings depending on your
custom settings or if non provided depending on default settings. These are: `setStripWicketTags(true)` (always),
`getPackageResourceGuard().addPattern(...)` (if `settings.updateSecurityManager()` is true) and
`getComponentInstantiationListeners().add(new BootstrapResourceAppender())` (if `settings.autoAppendResources()`
is true).
`Bootstrap` initializes and uses wicket-webjars to load its web resources, therefor wicket-webjars will be initialized
when calling `install` too (only if `settings.useWebjars()` returns true). If you use your own resources or
the cdn resources, wicket-webjars won't be initialized. wicket-webjars can be initialized by calling
`WicketWebjars.install(yourWicketApplication)` manually if needed.
#### Usage
minimal version:
```java
Bootstrap.install(yourWicketApplication);
```
with custom settings:
```java
final IBootstrapSettings settings = new BootstrapSettings();
settings.useCdnResources(true);
Bootstrap.install(yourWicketApplication, settings);
```
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Bootstrap.Builderbuilder()static IBootstrapSettingsreturns theIBootstrapSettingswhich are assigned to current applicationstatic IBootstrapSettingsgetSettings(Application app) returns theIBootstrapSettingswhich are assigned to given applicationstatic voidinstall(Application app) Installs default bootstrap settings to given application.static voidinstall(Application app, IBootstrapSettings settings) Installs given settings to given application.static voidrenderHead(Component component, IHeaderResponse response) renders all core bootstrap resource referencesstatic voidrenderHead(IHeaderResponse response) renders all core bootstrap resource references
-
Method Details
-
builder
-
install
Installs given settings to given application. Duplicated calls to `install` will be ignored.- Parameters:
app- The current applicationsettings- The settings to use- Throws:
IllegalArgumentException- if given application is null
-
install
Installs default bootstrap settings to given application. Duplicated calls to `install` will be ignored.- Parameters:
app- The current application- Throws:
IllegalArgumentException- if given application is null
-
getSettings
returns theIBootstrapSettingswhich are assigned to given application- Parameters:
app- The current application- Returns:
- assigned
IBootstrapSettings - Throws:
IllegalArgumentException- if given application is null
-
getSettings
returns theIBootstrapSettingswhich are assigned to current application- Returns:
- assigned
IBootstrapSettings - Throws:
IllegalStateException- if there's no application bound to current thread
-
renderHead
renders all core bootstrap resource references- Parameters:
component- current componentresponse- The currentIHeaderResponse- Throws:
IllegalArgumentException- if given component or response is null.IllegalStateException- if there's no application bound to current thread
-
renderHead
renders all core bootstrap resource references- Parameters:
response- The currentIHeaderResponse- Throws:
IllegalArgumentException- if given response is nullIllegalStateException- if there's no application bound to current thread
-