Package org.springframework.richclient.application

Examples of org.springframework.richclient.application.Application$CloseApplicationObserver


        if (startupContext == null) {
            displaySplashScreen(rootApplicationContext);
        }

        final Application application;

        try {
            application = (Application) rootApplicationContext.getBean(APPLICATION_BEAN_ID, Application.class);
        } catch (NoSuchBeanDefinitionException e) {
            throw new IllegalArgumentException(
                    "A single bean definition with id " + APPLICATION_BEAN_ID + ", of type " + Application.class.getName() + " must be defined in the main application context",
                    e);
        }

        try {
            // To avoid deadlocks when events fire during initialization of some swing components
            // Possible to do: in theory not a single Swing component should be created (=modified) in the launcher thread...
            SwingUtilities.invokeAndWait(new Runnable() {

                public void run() {
                    application.start();
                }
            });
        } catch (InterruptedException e) {
            logger.warn("Application start interrupted", e);
        } catch (InvocationTargetException e) {
View Full Code Here


        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);
View Full Code Here

            }
        } );

        // load dummy application
        Application.load( null );
        new Application( new DefaultApplicationLifecycleAdvisor() );
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        Application.instance().setApplicationContext( applicationContext );
        applicationContext.getStaticMessageSource().addMessage( "okCommand.label", Locale.getDefault(), "Ok" );
        applicationContext.refresh();
    }
View Full Code Here

    public void testApplicationEventNotification() throws Exception {
        TestAdvisor advisor = new TestAdvisor();
        advisor.afterPropertiesSet();
        Application.load(null);
        new Application(advisor);
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        Application.instance().setApplicationContext(applicationContext);
        applicationContext.registerSingleton( "eventMulticaster", SimpleApplicationEventMulticaster.class );
        applicationContext.refresh();
View Full Code Here

     * @param ctxFileName Name of context configuration file to read, may be null
     */
    private void prepareApplication(String ctxFileName) {
        Application.load( null );
        ApplicationServicesLocator.load(null);
        Application app = new Application( new DefaultApplicationLifecycleAdvisor() );

        if( ctxFileName != null ) {
            ac = new ClassPathXmlApplicationContext( "org/springframework/richclient/security/" + ctxFileName );
            app.setApplicationContext( ac );
        }
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        applicationContext = new ClassPathXmlApplicationContext(
            "org/springframework/richclient/security/security-test-configurer-ctx.xml" );
        Application.load( null );
        Application app = new Application( new DefaultApplicationLifecycleAdvisor() );
        app.setApplicationContext( applicationContext );

        securityManager = (ApplicationSecurityManager)ApplicationServicesLocator.services().getService(ApplicationSecurityManager.class);
        authAwareBean = (AuthAwareBean) applicationContext.getBean( "authAwareBean" );
        loginAwareBean = (LoginAwareBean) applicationContext.getBean( "loginAwareBean" );
    }
View Full Code Here

            ConfigurableApplicationContext applicationContext = createApplicationContext();
            applicationServices = new DefaultApplicationServices(applicationContext);
            new ApplicationServicesLocator(applicationServices);

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

    public void setUp() {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                "org/springframework/richclient/dialog/support/generic-application-ctx.xml");
        Application.load(null);
        Application app = new Application(new DefaultApplicationLifecycleAdvisor());
        app.setApplicationContext(applicationContext);
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        Application.load( null );
        TestApplicationLifecycleAdvisor ala = new TestApplicationLifecycleAdvisor();
        ala.setWindowCommandBarDefinitions( "org/springframework/richclient/security/support/test-command-ctx.xml" );
        Application app = new Application( ala );
        applicationContext = new ClassPathXmlApplicationContext(
            "org/springframework/richclient/security/support/test-security-controller-ctx.xml" );
        app.setApplicationContext(applicationContext);

        ala.setStartingPageId( "start" );
        ala.setApplication( app );
        app.openWindow( "start" );

        testAuth1 = (TestAuthorizable) applicationContext.getBean( "testAuth1" );
        manager = (SecurityControllerManager)ApplicationServicesLocator.services().getService(SecurityControllerManager.class);

        // Prepare the command context
View Full Code Here

TOP

Related Classes of org.springframework.richclient.application.Application$CloseApplicationObserver

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.