本文整理汇总了Java中org.apache.wicket.RuntimeConfigurationType类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeConfigurationType类的具体用法?Java RuntimeConfigurationType怎么用?Java RuntimeConfigurationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeConfigurationType类属于org.apache.wicket包,在下文中一共展示了RuntimeConfigurationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getString
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
public static String getString(String key, final Locale loc, String... _params) {
if (!exists()) {
ThreadContext.setApplication(org.apache.wicket.Application.get(appName));
}
String[] params = _params;
if ((params == null || params.length == 0) && STRINGS_WITH_APP.contains(key)) {
params = new String[]{getApplicationName()};
}
Localizer l = get().getResourceSettings().getLocalizer();
String value = l.getStringIgnoreSettings(key, null, null, loc, null, "[Missing]");
if (params != null && params.length > 0) {
final MessageFormat format = new MessageFormat(value, loc);
value = format.format(params);
}
if (RuntimeConfigurationType.DEVELOPMENT == get().getConfigurationType()) {
value += String.format(" [%s]", key);
}
return value;
}
示例2: initBootstrap
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
protected void initBootstrap()
{
LessCompilerConfigurationFactory lessConfigFactory = () -> {
Configuration lessConfig = new Configuration();
lessConfig.setCompressing(
RuntimeConfigurationType.DEPLOYMENT.equals(getConfigurationType()));
return lessConfig;
};
WicketWebjars.install(this);
BootstrapLess.install(this, lessConfigFactory);
Bootstrap.install(this);
IBootstrapSettings settings = Bootstrap.getSettings(this);
settings.setCssResourceReference(CustomBootstrapLessReference.get());
}
示例3: init
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public void init() {
super.init();
getDebugSettings().setAjaxDebugModeEnabled(false);
getExceptionSettings().setUnexpectedExceptionDisplay(ExceptionSettings.SHOW_EXCEPTION_PAGE);
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
final IBootstrapSettings bootstrapSettings = new BootstrapSettings()
.useCdnResources(getConfigurationType() == RuntimeConfigurationType.DEPLOYMENT)
.setThemeProvider(new SingleThemeProvider(BootswatchTheme.Cosmo));
Bootstrap.install(this, bootstrapSettings);
//Howler.install(this);
mountPages();
}
示例4: init
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public void init() {
super.init();
getDebugSettings().setAjaxDebugModeEnabled(false);
getExceptionSettings().setUnexpectedExceptionDisplay(ExceptionSettings.SHOW_EXCEPTION_PAGE);
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
final IBootstrapSettings bootstrapSettings = new BootstrapSettings()
.useCdnResources(getConfigurationType() == RuntimeConfigurationType.DEPLOYMENT)
.setThemeProvider(new SingleThemeProvider(BootswatchTheme.Cosmo));
Bootstrap.install(this, bootstrapSettings);
//Howler.install(this);
((SecurePackageResourceGuard) getResourceSettings().getPackageResourceGuard()).addPattern("+*.map");
JQueryFix1_12_1.apply(this);
mountPages();
}
示例5: getConfigurationType
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public RuntimeConfigurationType getConfigurationType() {
//Init the modes from the constants if needed
if (modes.isEmpty()) {
// use configuration from the servlet context since properties are not bound to the thread when this method is called
ArtifactoryHome artifactoryHome = getArtifactoryContext().getArtifactoryHome();
ArtifactorySystemProperties artifactorySystemProperties = artifactoryHome.getArtifactoryProperties();
/*if (Boolean.parseBoolean(artifactorySystemProperties.getProperty(ConstantValues.dev))) {
modes.add(ConstantValues.dev);
}*/
if (Boolean.parseBoolean(artifactorySystemProperties.getProperty(ConstantValues.test))) {
modes.add(ConstantValues.test);
}
if (Boolean.parseBoolean(artifactorySystemProperties.getProperty(ConstantValues.qa))) {
modes.add(ConstantValues.qa);
}
}
if (modes.contains(ConstantValues.dev)) {
return RuntimeConfigurationType.DEVELOPMENT;
} else {
return super.getConfigurationType();
}
}
示例6: init
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
protected final void init() {
super.init();
if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
String path = "src/main/java";
if (new File(path).exists()) {
getResourceSettings().getResourceFinders().add(0, new Path(path));
} else {
logger.warn("No src/main/java folder found, dynamic resource reloading is not available");
}
}
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
getDebugSettings().setOutputMarkupContainerClassName(false);
customInit();
}
示例7: init
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
protected void init() {
super.init();
registerSpringComponentInjector();
initPageMounting();
initBootstrap();
initWebjars();
getMarkupSettings().setDefaultMarkupEncoding(DEFAULT_ENCODING);
getRequestCycleSettings().setResponseRequestEncoding(DEFAULT_ENCODING);
if (getConfigurationType().equals(RuntimeConfigurationType.DEVELOPMENT)) {
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setStripComments(true);
getMarkupSettings().setCompressWhitespace(true);
getDebugSettings().setAjaxDebugModeEnabled(true);
getDebugSettings().setComponentUseCheck(true);
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
getResourceSettings().setResourcePollFrequency(Duration.ONE_SECOND);
}
}
示例8: loadDomainRegistry
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
private DomainRegistry<DomainObjectReference> loadDomainRegistry() {
// Wicket's development mode allows to reload classes at runtime, so in that mode
// we must not cache any data structures which depend on class structures. The
// domain registry prototypes are such a candidate.
if (WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT)
return constructDomainRegistry();
synchronized (DMDWebGenPageContext.class) {
String domainClassName = page.getDefaultModelObject().getClass().getName();
DomainRegistry<DomainObjectReference> registry = domainRegistryPrototypes.get(domainClassName);
if (registry == null) {
registry = constructDomainRegistry();
domainRegistryPrototypes.put(domainClassName, registry);
return registry;
} else {
// Construct a new DomainRegistry from an existing prototype rather than from
// traversing the domain class structure. Creation from prototype is much faster.
return registry.replicate(page.getDefaultModelObject());
}
}
}
示例9: getDomainClassReference
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
public static DomainClassReference getDomainClassReference(Class<?> domainClass, boolean runtime) {
// Wicket's development mode allows to reload classes at runtime, so in that mode
// we must not cache any data structures which depend on class structures. The
// DomainClassReference cache is such a candidate.
if (!runtime || WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
return new DomainClassReference(domainClass);
}
synchronized (DomainClassReferenceFactory.class) {
String domainClassName = domainClass.getName();
DomainClassReference ref = domainClassReferenceCache.get(domainClassName);
if (ref == null) {
ref = new DomainClassReference(domainClass);
domainClassReferenceCache.put(domainClassName, ref);
}
return ref;
}
}
示例10: getConfigurationType
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public RuntimeConfigurationType getConfigurationType() {
if (Bootstrap.sandboxMode && !Bootstrap.prodMode)
return RuntimeConfigurationType.DEVELOPMENT;
else
return RuntimeConfigurationType.DEPLOYMENT;
}
示例11: init
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public void init() {
super.init();
getRequestCycleSettings().setTimeout(Duration.minutes(5));
getRequestCycleListeners().add(new SingularServerContextListener());
Locale.setDefault(new Locale("pt", "BR"));//NOSONAR
getApplicationSettings().setAccessDeniedPage(Error403Page.class);
getApplicationSettings().setPageExpiredErrorPage(Page410.class);
// Don't forget to check your Application server for this
getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10));
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setStripComments(true);
getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name());
getComponentOnConfigureListeners().add(component -> {
boolean outputId = !component.getRenderBodyOnly();
component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId);
});
getComponentInstantiationListeners().add(new SpringComponentInjector(this, getApplicationContext(), true));
new SingularAnnotatedMountScanner().mountPages(this);
if (RuntimeConfigurationType.DEVELOPMENT == getConfigurationType()) {
getDebugSettings().setComponentPathAttributeName("wicketdebug");
WicketSerializationDebugUtil.configurePageSerializationDebug(this, this.getClass());
}
}
示例12: getConfigurationType
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public RuntimeConfigurationType getConfigurationType() {
if (SingularProperties.get().isFalse(SingularProperties.SINGULAR_DEV_MODE)) {
return RuntimeConfigurationType.DEPLOYMENT;
} else {
return RuntimeConfigurationType.DEVELOPMENT;
}
}
示例13: onConfigure
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
protected void onConfigure()
{
super.onConfigure();
// Do not cache pages in development mode - allows us to make changes to the HMTL without
// having to reload the application
if (RuntimeConfigurationType.DEVELOPMENT.equals(getApplication().getConfigurationType())) {
getApplication().getMarkupSettings().getMarkupFactory().getMarkupCache().clear();
getApplication().getResourceSettings()
.setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE);
}
}
示例14: getLabel
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
private String getLabel()
{
StringBuilder sb = new StringBuilder();
AnnotatorState state = getModelObject();
if (state.getProject() != null) {
sb.append(state.getProject().getName());
}
sb.append("/");
if (state.getDocument() != null) {
sb.append(state.getDocument().getName());
}
if (RuntimeConfigurationType.DEVELOPMENT.equals(getApplication().getConfigurationType())) {
sb.append(" (");
if (state.getProject() != null) {
sb.append(state.getProject().getId());
}
sb.append("/");
if (state.getDocument() != null) {
sb.append(state.getDocument().getId());
}
sb.append(")");
}
return sb.toString();
}
示例15: wicketFilter
import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Bean @DependsOn("openEntityManagerInViewFilter")
public FilterRegistrationBean wicketFilter() {
final FilterRegistrationBean reg = new FilterRegistrationBean(new WicketFilter());
reg.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
reg.addInitParameter(WicketFilter.APP_FACT_PARAM, SpringWebApplicationFactory.class.getName());
reg.addInitParameter("applicationBean", "webApp");
final RuntimeConfigurationType wicketConfiguration =
env.getRequiredProperty("wicket.configuration", RuntimeConfigurationType.class);
reg.addInitParameter("configuration", wicketConfiguration.name());
return reg;
}