• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RuntimeConfigurationType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.wicket.RuntimeConfigurationType的典型用法代码示例。如果您正苦于以下问题:Java RuntimeConfigurationType类的具体用法?Java RuntimeConfigurationType怎么用?Java RuntimeConfigurationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RuntimeConfigurationType类属于org.apache.wicket包,在下文中一共展示了RuntimeConfigurationType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: init

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
	if (RuntimeConfigurationType.DEVELOPMENT == webApplication.getConfigurationType()) {
		webApplication.getMarkupSettings().setStripWicketTags(true);
		webApplication.getRequestCycleSettings().addResponseFilter(new HtmlValidationResponseFilter());
	}
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:8,代码来源:HTMLValidatorConfig.java


示例17: createAdminConsoleHandler

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
private Handler createAdminConsoleHandler() {
    FilterHolder filter = new FilterHolder(WicketFilter.class);
    filter.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
            HyracksAdminConsoleApplication.class.getName());
    filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
    filter.setInitParameter(Application.CONFIGURATION, RuntimeConfigurationType.DEPLOYMENT.toString());

    ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
    handler.setContextPath("/adminconsole");
    handler.setAttribute(ClusterControllerService.class.getName(), ccs);
    handler.addFilter(filter, "/*", EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR));
    handler.addServlet(DefaultServlet.class, "/");
    return handler;
}
 
开发者ID:apache,项目名称:incubator-asterixdb-hyracks,代码行数:15,代码来源:WebServer.java


示例18: getHTMLDocumentCachingPolicy

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
public HTMLDocumentCachingPolicy getHTMLDocumentCachingPolicy() {
    String stringValue = getProperty(HTML_DOCUMENT_CACHING_POLICY, HTMLDocumentCachingPolicy.wicket.name());
    HTMLDocumentCachingPolicy value = HTMLDocumentCachingPolicy.valueOf(stringValue);
    if (value == HTMLDocumentCachingPolicy.wicket) {
        return (WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEPLOYMENT) ?
                HTMLDocumentCachingPolicy.permanent : HTMLDocumentCachingPolicy.none;
    }
    return HTMLDocumentCachingPolicy.valueOf(stringValue);
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:10,代码来源:WebDomainProperties.java


示例19: getConfigurationType

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:14,代码来源:WicketApplication.java


示例20: addWicketHandler

import org.apache.wicket.RuntimeConfigurationType; //导入依赖的package包/类
public static EmbeddedJettyBuilder.ServletContextHandlerBuilder addWicketHandler(EmbeddedJettyBuilder.ServletContextHandlerBuilder wicketHandler,
                                                                                 Class<? extends WebApplication> wicketApplication,
                                                                                 boolean development){
    String pathSpec = "/*";
    WicketServlet wicketServlet = new WicketServlet();
    wicketHandler.addServlet(wicketServlet )
            .mountAtPath(pathSpec)
            .setInitParameter(WicketFilter.APP_FACT_PARAM, org.apache.wicket.spring.SpringWebApplicationFactory.class.getName())
            .setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM, wicketApplication.getName())
            .setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, pathSpec)
            .setInitParameter("wicket.configuration",
                    development ? RuntimeConfigurationType.DEVELOPMENT.name() :  RuntimeConfigurationType.DEPLOYMENT.name());

    return wicketHandler;
}
 
开发者ID:NetsOSS,项目名称:embedded-jetty,代码行数:16,代码来源:EmbeddedWicketBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JSONObject类代码示例发布时间:2022-05-21
下一篇:
Java PBEParametersGenerator类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap