-
Notifications
You must be signed in to change notification settings - Fork 164
BootstrapSettings
You have to override the Application.init()
method and call Bootstrap.install(this, settings)
where settings
is a new instance of BoostrapSettings
or your own implementation of IBootstrapSettings
.
/**
* @see org.apache.wicket.Application#init()
*/
@Override
public void init() {
super.init();
BootstrapSettings settings = new BootstrapSettings();
settings.minify(true); // use minimized version of all bootstrap references
Bootstrap.install(this, settings);
}
public interface IBootstrapSettings {
/**
* @return the base twitter bootstrap css resource reference
*/
ResourceReference getCssResourceReference();
/**
* @return the twitter bootstrap responsive css resource reference
*/
ResourceReference getResponsiveCssResourceReference();
/**
* @return the base twitter bootstrap javascript resource reference
*/
ResourceReference getJsResourceReference();
/**
* @return returns the jquery cdn url
*/
String getJqueryUrl();
void setJqueryUrl(final String url);
boolean isMinified();
void minify(final boolean minify);
boolean useModernizr();
void setUseModernizr(final boolean useModernizr);
boolean useResponsiveCss();
void setUseResponsiveCss(final boolean useResponsiveCss);
void setActiveThemeProvider(ActiveThemeProvider themeProvider);
ActiveThemeProvider getActiveThemeProvider();
ThemeProvider getThemeProvider();
void setThemeProvider(ThemeProvider themeProvider);
}
package de.agilecoders.wicket.settings;
import com.asual.lesscss.LessOptions;
import de.agilecoders.wicket.util.IBootstrapLessCompiler;
import java.nio.charset.Charset;
/**
* The {@link IBootstrapLessCompilerSettings} interface.
*
* @author miha
* @version 1.0
*/
public interface IBootstrapLessCompilerSettings {
public enum CacheStrategy {
Never, Forever, Modified
}
/**
* Turns on the less compiler.
*
* @param value true, if less compiler should be used
*/
void setUseLessCompiler(boolean value);
/**
* @return true, if less compiler should be used
*/
boolean useLessCompiler();
/**
* Sets the charset to use when reading and writing less/css files.
* Default: UTF-8
*
* @param charset the charset to use.
*/
void setCharset(Charset charset);
/**
* @return the charset to use.
*/
Charset getCharset();
/**
* The less compiler implementation that generates the css files.
*
* @param lessCompiler The less compiler to use
*/
void setLessCompiler(IBootstrapLessCompiler lessCompiler);
/**
* @return The less compiler to use
*/
IBootstrapLessCompiler getLessCompiler();
/**
* sets the less compiler options
*
* @param lessOptions the less compiler options
*/
void setLessOptions(LessOptions lessOptions);
/**
* @return the less compiler options
*/
LessOptions getLessOptions();
/**
* @return the cache strategy
*/
CacheStrategy getCacheStrategy();
/**
* sets the {@link CacheStrategy} to use.
*
* @param strategy the cache strategy
*/
void setCacheStrategy(CacheStrategy strategy);
/**
* whether to store all less file changes to the css file or not
*
* @param value true, if file should stored.
*/
void storeChanges(boolean value);
/**
* @return true, if less file changes should stored in css file.
*/
boolean storeChanges();
}
Copyright 2012 AgileCoders.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.