Package org.springframework.richclient.application.support

Examples of org.springframework.richclient.application.support.DefaultApplicationServices


     * Initialize test environment
     */
    protected void setUp() throws Exception {
        Application.load(null);
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        DefaultApplicationServices applicationServices = new DefaultApplicationServices(applicationContext);

        DefaultApplicationLifecycleAdvisor advisor = new DefaultApplicationLifecycleAdvisor();
        Application app = new Application(advisor);
        advisor.setApplication(app);

        Application.instance().setApplicationContext(applicationContext);
        applicationServices.setApplicationContext(applicationContext);

        ApplicationServicesLocator locator = new ApplicationServicesLocator(applicationServices);
        ApplicationServicesLocator.load(locator);

        // create dummy message source that always return an empty string
        AbstractMessageSource source = new AbstractMessageSource() {
            @Override
            protected MessageFormat resolveCode(String s, Locale locale) {
                return new MessageFormat("");
            }
        };
        MessageSourceAccessor accessor = new MessageSourceAccessor(source);
        applicationServices.setMessageSourceAccesor(accessor);
        applicationServices.setMessageSource(source);

        applicationContext.refresh();

        // create formmodel to test on and initialize value models
        model = FormModelHelper.createFormModel(new ValidatingObject());
View Full Code Here


    protected final void setUp() throws Exception {
        try {
            Application.load(null);
            ConfigurableApplicationContext applicationContext = createApplicationContext();
            applicationServices = new DefaultApplicationServices(applicationContext);
            new ApplicationServicesLocator(applicationServices);

            final ApplicationLifecycleAdvisor advisor = createApplicationLifecycleAdvisor();
            final Application application = new Application(advisor);
            advisor.setApplication(application);
View Full Code Here

     *
     * @return The application services locator.
     */
    public static ApplicationServices services() {
      if (!ApplicationServicesLocator.isLoaded()) {
        ApplicationServicesLocator.load(new ApplicationServicesLocator(new DefaultApplicationServices()));
      }
        return ApplicationServicesLocator.services();
    }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.application.support.DefaultApplicationServices

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.