本文整理汇总了Java中org.apache.wicket.RuntimeConfigurationType.DEVELOPMENT属性的典型用法代码示例。如果您正苦于以下问题:Java RuntimeConfigurationType.DEVELOPMENT属性的具体用法?Java RuntimeConfigurationType.DEVELOPMENT怎么用?Java RuntimeConfigurationType.DEVELOPMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.wicket.RuntimeConfigurationType
的用法示例。
在下文中一共展示了RuntimeConfigurationType.DEVELOPMENT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getString
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: getConfigurationType
@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();
}
}
示例3: init
@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();
}
示例4: loadDomainRegistry
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());
}
}
}
示例5: getDomainClassReference
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;
}
}
示例6: getConfigurationType
@Override
public RuntimeConfigurationType getConfigurationType() {
if (Bootstrap.sandboxMode && !Bootstrap.prodMode)
return RuntimeConfigurationType.DEVELOPMENT;
else
return RuntimeConfigurationType.DEPLOYMENT;
}
示例7: init
@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());
}
}
示例8: getConfigurationType
@Override
public RuntimeConfigurationType getConfigurationType() {
if (SingularProperties.get().isFalse(SingularProperties.SINGULAR_DEV_MODE)) {
return RuntimeConfigurationType.DEPLOYMENT;
} else {
return RuntimeConfigurationType.DEVELOPMENT;
}
}
示例9: init
@Override
public void init(WebApplication webApplication) {
if (RuntimeConfigurationType.DEVELOPMENT == webApplication.getConfigurationType()) {
webApplication.getMarkupSettings().setStripWicketTags(true);
webApplication.getRequestCycleSettings().addResponseFilter(new HtmlValidationResponseFilter());
}
}
示例10: getConfigurationType
/**
* Own solution: uses development parameter of servlet context init parameter (see context.xml or server.xml).
* @return DEVELOPMENT, if development variable of servlet context is set to "true" otherwise DEPLOYMENT.
* @see org.apache.wicket.protocol.http.WebApplication#getConfigurationType()
*/
@Override
public RuntimeConfigurationType getConfigurationType()
{
if (isDevelopmentSystem() == true) {
return RuntimeConfigurationType.DEVELOPMENT;
}
return RuntimeConfigurationType.DEPLOYMENT;
}
示例11: getConfigurationType
@Override
public RuntimeConfigurationType getConfigurationType() {
//noinspection ConstantConditions
return deployment ? RuntimeConfigurationType.DEPLOYMENT : RuntimeConfigurationType.DEVELOPMENT;
}
示例12: getConfigurationType
@Override
public RuntimeConfigurationType getConfigurationType() {
return wicketSettings.getDevelopment() ? RuntimeConfigurationType.DEVELOPMENT : RuntimeConfigurationType.DEPLOYMENT;
}
示例13: isDevelopement
private static boolean isDevelopement() {
return WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT;
}
示例14: getConfigurationType
@Override
public RuntimeConfigurationType getConfigurationType() {
return RuntimeConfigurationType.DEVELOPMENT;
}
示例15: init
/**
* @see org.apache.wicket.Application#init()
*/
@Override
public void init()
{
super.init();
getComponentInstantiationListeners().add(new GuiceComponentInjector(this, new RestModule()));
if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
getResourceSettings().setUseMinifiedResources(false);
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
} else {
getResourceSettings().setUseMinifiedResources(true);
getDebugSettings().setDevelopmentUtilitiesEnabled(false);
}
getMarkupSettings().setStripWicketTags(true);
mountPage("/home", HomePage.class);
mountPage("/etcd/#{cluster}", NavigationPage.class);
mountPage("/registries", RegistriesPage.class);
mountPage("/about", AboutPage.class);
mountPage("/signin", AuthPage.class);
// add your configuration here
}