[Lutinutil-commits] r898 - in trunk/commandline/commandline-demo/src/main: java/org/codelutin/commandline/demo/ui resources
Author: tchemit Date: 2008-07-24 21:00:19 +0000 (Thu, 24 Jul 2008) New Revision: 898 Removed: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/ui/MyActionManager.java Modified: trunk/commandline/commandline-demo/src/main/resources/log4j.properties Log: update from jaxx-swing-action framework Deleted: trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/ui/MyActionManager.java =================================================================== --- trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/ui/MyActionManager.java 2008-07-24 21:00:10 UTC (rev 897) +++ trunk/commandline/commandline-demo/src/main/java/org/codelutin/commandline/demo/ui/MyActionManager.java 2008-07-24 21:00:19 UTC (rev 898) @@ -1,116 +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.ui; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.jaxx.action.ActionFactoryFromProvider; -import org.codelutin.jaxx.action.ActionFactory; -import org.codelutin.commandline.demo.ui.actions.MyAbstractAction; - -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.JComboBox; - -import jaxx.runtime.JAXXObject; - -import java.awt.event.ActionEvent; - -/** @author chemit */ -public class MyActionManager { - - private static final Log log = LogFactory.getLog(MyActionManager.class); - - /** l'usine d'actions */ - private static ActionFactory factory; - - /** - * @param ui l'ui � charger - * @return le tableau des actions instanci�es ou r�cup�r�es du cache de - * la factory - */ - public static AbstractAction[] loadActions(JAXXObject ui) { - AbstractAction[] actions; - actions = getFactory().loadActions(ui); - return actions; - - } - - /** - * Retourne (et instancie la premi�re fois l'usine d'actions) - * - * @return l'usine d'actions - * @see org.codelutin.jaxx.action.ActionFactory - */ - public static ActionFactory getFactory() { - if (factory == null) { - // used a simple factory implementation - factory = new ActionFactoryFromProvider(); - } - return factory; - } - - public static void fireAction(String actionKey, Object source) { - fireAction(actionKey, source, (AbstractButton) null); - } - - - public static AbstractAction newAction(String actionKey) { - return newAction(actionKey, (AbstractButton) null); - } - - public static void resetCache() { - getFactory().resetCache(); - } - - public static void dispose() { - resetCache(); - for (String actionKey : getFactory().getActionNames()) { - MyAbstractAction action = (MyAbstractAction) newAction(actionKey); - if (action != null) { - action.disposeUI(); - } - } - } - - - public static void fireAction(String actionKey, Object source, AbstractButton component) { - AbstractAction action = newAction(actionKey, component); - fireAction0(actionKey, source, action); - } - - public static void fireAction(String actionKey, Object source, JComboBox component) { - AbstractAction action = newAction(actionKey, component); - fireAction0(actionKey, source, action); - } - - protected static AbstractAction newAction(String actionKey, AbstractButton component) { - return getFactory().newAction(actionKey, component); - } - - protected static AbstractAction newAction(String actionKey, JComboBox component) { - return getFactory().newAction(actionKey, component); - } - - protected static void fireAction0(String actionKey, Object source, AbstractAction action) { - if (action == null) { - log.warn("could not find action " + actionKey); - return; - } - ActionEvent event = new ActionEvent(source, ActionEvent.ACTION_FIRST, actionKey); - action.actionPerformed(event); - } - -} Modified: trunk/commandline/commandline-demo/src/main/resources/log4j.properties =================================================================== --- trunk/commandline/commandline-demo/src/main/resources/log4j.properties 2008-07-24 21:00:10 UTC (rev 897) +++ trunk/commandline/commandline-demo/src/main/resources/log4j.properties 2008-07-24 21:00:19 UTC (rev 898) @@ -6,6 +6,6 @@ log4j.appender.file.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n # package level -log4j.logger.org.codelutin.commandline=INFO -log4j.logger.org.codelutin.option=INFO -#log4j.logger.org.codelutin=INFO +log4j.logger.org.codelutin.commandline=DEBUG +#log4j.logger.org.codelutin.option=DEBUG +log4j.logger.org.codelutin.jaxx=DEBUG
participants (1)
-
tchemit@users.labs.libre-entreprise.org