当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeConfigurationType类代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:20,代码来源:Application.java

示例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());
}
 
开发者ID:webanno,项目名称:webanno,代码行数:17,代码来源:WicketApplicationBase.java

示例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();
}
 
开发者ID:lumenrobot,项目名称:lumen,代码行数:17,代码来源:MyWebApplication.java

示例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();
}
 
开发者ID:lumenrobot,项目名称:lumen,代码行数:20,代码来源:MyWebApplication.java

示例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();
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:24,代码来源:ArtifactoryApplication.java

示例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();
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:18,代码来源:BaseApplication.java

示例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);
	}
}
 
开发者ID:mpostelnicu,项目名称:wicket-spring-jpa-bootstrap-boilerplate,代码行数:24,代码来源:WicketApplication.java

示例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());
        }
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:22,代码来源:DMDWebGenPageContext.java

示例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;
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:19,代码来源:DomainClassReferenceFactory.java

示例10: getConfigurationType

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public RuntimeConfigurationType getConfigurationType() {
	if (Bootstrap.sandboxMode && !Bootstrap.prodMode)
		return RuntimeConfigurationType.DEVELOPMENT;
	else
		return RuntimeConfigurationType.DEPLOYMENT;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:8,代码来源:GitPlexWebApplication.java

示例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());
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:34,代码来源:SingularServerApplication.java

示例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;
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:9,代码来源:SingularServerApplication.java

示例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);
    }
}
 
开发者ID:webanno,项目名称:webanno,代码行数:14,代码来源:ApplicationPageBase.java

示例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();
}
 
开发者ID:webanno,项目名称:webanno,代码行数:31,代码来源:DocumentNamePanel.java

示例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;
}
 
开发者ID:lumenrobot,项目名称:lumen,代码行数:12,代码来源:WicketConfig.java


注:本文中的org.apache.wicket.RuntimeConfigurationType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。