Author: tchemit Date: 2010-09-07 12:47:16 +0200 (Tue, 07 Sep 2010) New Revision: 2074 Url: http://nuiton.org/repositories/revision/jaxx/2074 Log: make real bean + introduce DemoDecoratorProvider Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-09-07 10:47:05 UTC (rev 2073) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2010-09-07 10:47:16 UTC (rev 2074) @@ -25,8 +25,7 @@ package jaxx.demo; -import jaxx.demo.entities.Movie; -import jaxx.demo.entities.People; +import jaxx.demo.entities.DemoDecoratorProvider; import jaxx.demo.tree.DemoDataProvider; import jaxx.demo.tree.DemoTreeHelper; import jaxx.runtime.SwingUtil; @@ -51,7 +50,7 @@ private static Log log = LogFactory.getLog(RunDemo.class); /** The singleton instance of the main context */ - protected static DefaultApplicationContext context; + protected static volatile DefaultApplicationContext context; public static void main(String[] args) { @@ -86,16 +85,8 @@ rootContext.setContextValue(config); // init decorator provider - DecoratorProvider p = new DecoratorProvider() { + DecoratorProvider p = new DemoDecoratorProvider(); - @Override - protected void loadDecorators() { - - registerMultiJXPathDecorator(Movie.class, "${title}$s##${year}$s", "##", " - "); - registerMultiJXPathDecorator(People.class, "${firstName}$s##${lastName}$s", "##", " "); - } - }; - // share the decorator provider rootContext.setContextValue(p); @@ -178,7 +169,7 @@ * @throws IllegalStateException si le contexte n'a pas été initialisé via * la méthode {@link #init()} */ - protected static DefaultApplicationContext get() throws IllegalStateException { + public static DefaultApplicationContext get() throws IllegalStateException { if (!isInit()) { throw new IllegalStateException("no application context registred."); }