Author: tchemit Date: 2008-01-20 22:09:46 +0000 (Sun, 20 Jan 2008) New Revision: 301 Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ActionParameter.java Modified: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java Log: extraction interface pour marquer les actions de type lookup Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ActionParameter.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ActionParameter.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ActionParameter.java 2008-01-20 22:09:46 UTC (rev 301) @@ -0,0 +1,24 @@ +/* +* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 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 fr.cemagref.simexplorer.is.ui.swing.action; + +/** @author chemit */ +public interface ActionParameter { + String getParam(); +} Modified: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java 2008-01-20 22:09:09 UTC (rev 300) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java 2008-01-20 22:09:46 UTC (rev 301) @@ -34,7 +34,7 @@ * * @author chemit */ -public class SimExplorerAbstractTabAction extends SimExplorerAbstractAction { +public class SimExplorerAbstractTabAction extends SimExplorerAbstractAction implements ActionParameter { protected SimExplorerTabManager.Tab tab; @@ -44,6 +44,7 @@ private static final long serialVersionUID = 5285229914266682509L; + protected String param; protected SimExplorerAbstractTabAction(String name, String prefixPatternName) { super(name); @@ -53,8 +54,9 @@ if (!matcher.matches()) { throw new IllegalArgumentException(I18n._("{0} should have a name like this {1}, but was {2}", getClass().getName(), patternName, name)); } + param = matcher.group(1); Converter convertorLanguage = ConverterUtil.getConverter(SimExplorerTabManager.Tab.class); - tab = (SimExplorerTabManager.Tab) convertorLanguage.convert(SimExplorerTabManager.Tab.class, matcher.group(1)); + tab = (SimExplorerTabManager.Tab) convertorLanguage.convert(SimExplorerTabManager.Tab.class, param); } @Override @@ -80,4 +82,7 @@ return method; } + public String getParam() { + return param; + } }