Search in sources :

Example 1 with ShutdownDialogAvailableEvent

use of de.tudarmstadt.ukp.clarin.webanno.support.standalone.ShutdownDialogAvailableEvent in project webanno by webanno.

the class WebAnno method main.

public static void main(String[] args) throws Exception {
    Optional<JWindow> splash = LoadingSplashScreen.setupScreen(WebAnno.class.getResource("splash.png"));
    SpringApplicationBuilder builder = new SpringApplicationBuilder();
    // Signal that we may need the shutdown dialog
    builder.properties("running.from.commandline=true");
    init(builder);
    builder.sources(WebAnno.class);
    builder.listeners(event -> {
        if (event instanceof ApplicationReadyEvent || event instanceof ShutdownDialogAvailableEvent) {
            splash.ifPresent(it -> it.dispose());
        }
    });
    builder.run(args);
}
Also used : ShutdownDialogAvailableEvent(de.tudarmstadt.ukp.clarin.webanno.support.standalone.ShutdownDialogAvailableEvent) JWindow(javax.swing.JWindow) ApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Aggregations

ShutdownDialogAvailableEvent (de.tudarmstadt.ukp.clarin.webanno.support.standalone.ShutdownDialogAvailableEvent)1 JWindow (javax.swing.JWindow)1 SpringApplicationBuilder (org.springframework.boot.builder.SpringApplicationBuilder)1 ApplicationReadyEvent (org.springframework.boot.context.event.ApplicationReadyEvent)1