Author: tchemit Date: 2008-07-24 21:06:51 +0000 (Thu, 24 Jul 2008) New Revision: 902 Added: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/DemoContext.java Removed: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/MyContext.java Log: demo :) Copied: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/DemoContext.java (from rev 897, trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/MyContext.java) =================================================================== --- trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/DemoContext.java (rev 0) +++ trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/DemoContext.java 2008-07-24 21:06:51 UTC (rev 902) @@ -0,0 +1,62 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.commandline.demo; + +import org.codelutin.commandline.demo.ui.JMainUI; +import org.codelutin.commandline.demo.ui.MyMainUI; +import org.codelutin.commandline.demo.ui.actions.CommandLineAction; +import org.codelutin.i18n.I18n; +import org.codelutin.jaxx.action.factory.ActionFactory; +import org.codelutin.jaxx.action.factory.ActionFactoryFromProvider; + +/** @author chemit */ +public class DemoContext extends CommandLineDemoAbstractContext { + + /** main UI */ + protected JMainUI mainUI; + + /** l'usine d'actions */ + private ActionFactory<CommandLineAction> actionFactory; + + public DemoContext() throws Exception { + super(); + } + + public ActionFactory<CommandLineAction> getActionFactory() { + if (actionFactory == null) { + actionFactory = ActionFactoryFromProvider.newInstance(CommandLineAction.class); + } + return actionFactory; + } + + public void initI18n() { + I18n.init(getMainConfig().getLocale(), getMainConfig().getEncoding()); + } + + public JMainUI getMainUI() { + if (mainUI == null) { + mainUI = new MyMainUI(); + } + return mainUI; + } + + public void disposeUI() { + if (mainUI != null) { + mainUI.dispose(); + mainUI = null; + } + } + +} Deleted: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/MyContext.java =================================================================== --- trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/MyContext.java 2008-07-24 21:06:38 UTC (rev 901) +++ trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/MyContext.java 2008-07-24 21:06:51 UTC (rev 902) @@ -1,62 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.commandline.demo; - -import org.codelutin.commandline.demo.ui.JMainUI; -import org.codelutin.commandline.demo.ui.MyMainUI; -import org.codelutin.commandline.demo.ui.actions.CommandLineAction; -import org.codelutin.i18n.I18n; -import org.codelutin.jaxx.action.factory.ActionFactory; -import org.codelutin.jaxx.action.factory.ActionFactoryFromProvider; - -/** @author chemit */ -public class MyContext extends CommandLineDemoAbstractContext { - - /** main UI */ - protected JMainUI mainUI; - - /** l'usine d'actions */ - private ActionFactory<CommandLineAction> actionFactory; - - public MyContext() throws Exception { - super(); - } - - public ActionFactory<CommandLineAction> getActionFactory() { - if (actionFactory == null) { - actionFactory = ActionFactoryFromProvider.newInstance(CommandLineAction.class); - } - return actionFactory; - } - - public void initI18n() { - I18n.init(getMainConfig().getLocale(), getMainConfig().getEncoding()); - } - - public JMainUI getMainUI() { - if (mainUI == null) { - mainUI = new MyMainUI(); - } - return mainUI; - } - - public void disposeUI() { - if (mainUI != null) { - mainUI.dispose(); - mainUI = null; - } - } - -}