Author: tchemit Date: 2008-01-20 13:33:33 +0000 (Sun, 20 Jan 2008) New Revision: 256 Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractAction.java 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/admin/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/GroupsAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/UsersAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/CollapseAllAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExpandAllAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExportApplicationAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ImportApplicationAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/LaunchSynchronizeAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ListApplicationsAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ResetSearchApplicationAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/SearchApplicationAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/ConnectAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/UnconnectAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/AboutAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ChangeI18nAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ConfigAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/HelpAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/QuitAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/SiteAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/CloseTabAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ShowTabAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ToggleTabAction.java Removed: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/AboutAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ChangeI18nAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConfigAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConnectAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/GroupsAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/HelpAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ListApplicationsAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/QuitAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SiteAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UnconnectAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UsersAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ Log: structuration des actions Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractAction.java 2008-01-20 13:33:14 UTC (rev 255) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,59 +0,0 @@ -/* -* \#\#% 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; - -import fr.cemagref.simexplorer.is.SimExplorer; -import fr.cemagref.simexplorer.is.SimExplorerContext; -import fr.cemagref.simexplorer.is.SimExplorerMainUI; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.AbstractAction; -import javax.swing.Action; - -/** - * La classe de base à utiliser pour toutes les actions de l'application - * - * @author chemit - */ -public abstract class SimExplorerAbstractAction extends AbstractAction { - - private static final long serialVersionUID = -810023044364620841L; - - static protected Log log = LogFactory.getLog(SimExplorerAbstractAction.class); - - protected SimExplorerAbstractAction(String name) { - super(name); - } - - protected SimExplorerAbstractAction() { - } - - protected SimExplorerContext getContext() { - return SimExplorer.getContext(); - } - - protected SimExplorerMainUI getMainUI() { - return SimExplorer.getUI(); - } - - protected String getName() { - return (String) getValue(Action.NAME); - } -} Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions) Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/AboutAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/AboutAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/AboutAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class AboutAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 6382834972163773346L; - - public AboutAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ChangeI18nAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ChangeI18nAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ChangeI18nAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,87 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.SimExplorer; -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; -import org.apache.commons.beanutils.Converter; -import org.codelutin.i18n.CountryEnum; -import org.codelutin.i18n.I18n; -import org.codelutin.i18n.LanguageEnum; -import org.codelutin.util.ConverterUtil; - -import java.awt.event.ActionEvent; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Une action pour recharger la locale. - * <p/> - * Le nom de l'action doit etre de la forme i18n_XX_YY où XX est la langue - * et YY le pays de la locale à charger. - * - * @author chemit - * @see LanguageEnum - * @see CountryEnum - */ -public class ChangeI18nAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 8663845268703843948L; - - public static final Pattern PATTERN_NAME = Pattern.compile("i18n_(\\w\\w)_(\\w\\w)"); - - protected LanguageEnum language; - - protected CountryEnum country; - - public ChangeI18nAction(String name) { - super(name); - Matcher matcher = PATTERN_NAME.matcher(name); - if (!matcher.matches()) { - throw new IllegalArgumentException(I18n._(getClass().getName() + " should have a nmae like this 'i18n_XX_YY', but was {0}", name)); - } - Converter convertorLanguage = ConverterUtil.getConverter(LanguageEnum.class); - language = (LanguageEnum) convertorLanguage.convert(LanguageEnum.class, matcher.group(1)); - - convertorLanguage = ConverterUtil.getConverter(CountryEnum.class); - country = (CountryEnum) convertorLanguage.convert(CountryEnum.class, matcher.group(2)); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - - //TODO Should ask confirm from user since it will close ui, and re instanciate ui - - getMainUI().getQuit().getAction().actionPerformed(new ActionEvent(this, ActionEvent.ACTION_FIRST, "cancel")); - SimExplorer.reloadUI(); - getContext().getConfig().setI18n(language,country); - getContext().getConfig().initI18n(); - - SimExplorer.launch(); - - SimExplorer.getContext().saveSafely(); - } - - public boolean equalsLocale(LanguageEnum lang, CountryEnum countr) { - return language == lang && country == countr; - } - - @Override - public String toString() { - return super.toString() + " Language " + language + " Country " + country; - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConfigAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ConfigAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConfigAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,36 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.JConfigUI; -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; -import org.codelutin.option.ui.ConfigTableModel; - -/** @author tony */ -public class ConfigAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 3300059369540110934L; - - public ConfigAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - JConfigUI.showUI(getContext().getConfig(), ConfigTableModel.TypeModel.all); - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConnectAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ConnectAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ConnectAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class ConnectAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 7878367943091442615L; - - public ConnectAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/GroupsAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/GroupsAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/GroupsAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class GroupsAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = -3295312475361573482L; - - public GroupsAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/HelpAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/HelpAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/HelpAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class HelpAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 2809805482518823876L; - - public HelpAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ListApplicationsAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ListApplicationsAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/ListApplicationsAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class ListApplicationsAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 6220034344778635703L; - - public ListApplicationsAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/QuitAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/QuitAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/QuitAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class QuitAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 8078558268479422370L; - - public QuitAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - getMainUI().dispose(); - } -} Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,60 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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; + +import fr.cemagref.simexplorer.is.SimExplorer; +import fr.cemagref.simexplorer.is.SimExplorerContext; +import fr.cemagref.simexplorer.is.SimExplorerMainUI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * La classe de base à utiliser pour toutes les action de l'application + * + * @author chemit + */ +public abstract class SimExplorerAbstractAction extends javax.swing.AbstractAction { + + private static final long serialVersionUID = -810023044364620841L; + + static protected Log log = LogFactory.getLog(SimExplorerAbstractAction.class); + + protected SimExplorerAbstractAction(String name) { + super(name); + } + + protected SimExplorerAbstractAction() { + } + + protected SimExplorerContext getContext() { + return SimExplorer.getContext(); + } + + protected SimExplorerMainUI getMainUI() { + return SimExplorer.getUI(); + } + + protected String getName() { + return (String) getValue(NAME); + } + + public void actionPerformed(java.awt.event.ActionEvent e) { + log.info(this); + } +} Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/SimExplorerAbstractTabAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SimExplorerAbstractTabAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,83 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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; + +import fr.cemagref.simexplorer.is.ui.swing.SimExplorerTabManager; +import org.apache.commons.beanutils.Converter; +import org.codelutin.i18n.I18n; +import org.codelutin.util.ConverterUtil; + +import javax.swing.JTabbedPane; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * La classe d'action de base pour toutes les action sur les Tab + * + * @author chemit + */ +public class SimExplorerAbstractTabAction extends SimExplorerAbstractAction { + + protected SimExplorerTabManager.Tab tab; + + protected String methodName; + + protected Method method; + + private static final long serialVersionUID = 5285229914266682509L; + + + protected SimExplorerAbstractTabAction(String name, String prefixPatternName) { + super(name); + methodName = prefixPatternName; + Pattern patternName = Pattern.compile(prefixPatternName + "_(\\w+)"); + Matcher matcher = patternName.matcher(name); + if (!matcher.matches()) { + throw new IllegalArgumentException(I18n._("{0} should have a name like this {1}, but was {2}", getClass().getName(), patternName, name)); + } + Converter convertorLanguage = ConverterUtil.getConverter(SimExplorerTabManager.Tab.class); + tab = (SimExplorerTabManager.Tab) convertorLanguage.convert(SimExplorerTabManager.Tab.class, matcher.group(1)); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + try { + getMethod().invoke(null, getMainUI().getContent(), tab); + } catch (IllegalAccessException e1) { + throw new RuntimeException(e1); + } catch (InvocationTargetException e1) { + throw new RuntimeException(e1); + } + } + + protected Method getMethod() { + if (method == null) { + try { + method = SimExplorerTabManager.class.getMethod(methodName, JTabbedPane.class, SimExplorerTabManager.Tab.class); + } catch (NoSuchMethodException e) { + throw new RuntimeException("could not found method '" + methodName + "' on " + SimExplorerTabManager.class); + } + } + return method; + } + +} Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SiteAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SiteAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/SiteAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class SiteAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = 2809805482518823876L; - - public SiteAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UnconnectAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/UnconnectAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UnconnectAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,34 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class UnconnectAction extends SimExplorerAbstractAction { - private static final long serialVersionUID = -5210454594354934593L; - - public UnconnectAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UsersAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/UsersAction.java 2008-01-19 14:54:59 UTC (rev 227) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/UsersAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -1,35 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.ui.swing.SimExplorerAbstractAction; - -/** @author tony */ -public class UsersAction extends SimExplorerAbstractAction { - - private static final long serialVersionUID = -53117911219660095L; - - public UsersAction(String name) { - super(name); - } - - public void actionPerformed(java.awt.event.ActionEvent e) { - //TODO... - } -} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/GroupsAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/GroupsAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/GroupsAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/GroupsAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.admin; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour afficher la page de gestion des groupes d'utilisateurs + * + * @author chemit + */ +public class GroupsAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 42756519520713299L; + + public GroupsAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/UsersAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/UsersAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/UsersAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/admin/UsersAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.admin; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour voir la gestion des utilisateurs + * + * @author chemit + */ +public class UsersAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -8183522709906575547L; + + public UsersAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/CollapseAllAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/CollapseAllAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/CollapseAllAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Pour réduire tous les noeuds de l'arbe d'une application + * + * @author chemit + */ +public class CollapseAllAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -3254708595851406041L; + + public CollapseAllAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExpandAllAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/AboutAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExpandAllAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExpandAllAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Pour dérouler tous les noeuds de l'arbre d'une application + * + * @author tony + */ +public class ExpandAllAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 9033359716418852179L; + + public ExpandAllAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExportApplicationAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExportApplicationAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ExportApplicationAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour exporter une application + * + * @author chemit + */ +public class ExportApplicationAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 7535647131305304738L; + + public ExportApplicationAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ImportApplicationAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ImportApplicationAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ImportApplicationAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,42 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action de base pour importer une application + * + * @author tony + */ +public class ImportApplicationAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 3377670691203328711L; + + + public ImportApplicationAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/LaunchSynchronizeAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/LaunchSynchronizeAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/LaunchSynchronizeAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,39 @@ +/* +* ##% 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pouyr lancer la synchro + * + * @author tony + */ +public class LaunchSynchronizeAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 8379937369551031306L; + + public LaunchSynchronizeAction(String name) { + super(name); + } + + public void actionPerformed(java.awt.event.ActionEvent e) { + log.info(this); + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ListApplicationsAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ListApplicationsAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ListApplicationsAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ListApplicationsAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,39 @@ +/* +* ##% 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour ??? + * + * @author tony + */ +public class ListApplicationsAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 6220034344778635703L; + + public ListApplicationsAction(String name) { + super(name); + } + + public void actionPerformed(java.awt.event.ActionEvent e) { + log.info(this); + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ResetSearchApplicationAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ResetSearchApplicationAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/ResetSearchApplicationAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour réinitialiser une recherche d'application + * + * @author tony + */ +public class ResetSearchApplicationAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -155773498930710467L; + + public ResetSearchApplicationAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/SearchApplicationAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/SearchApplicationAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/application/SearchApplicationAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.application; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour lancer une recherche d'application + * + * @author chemit + */ +public class SearchApplicationAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -8537587629478588257L; + + public SearchApplicationAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/ConnectAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ConnectAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/ConnectAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/ConnectAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.auth; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action de connexion au serveur distant + * + * @author chemit + */ +public class ConnectAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -6172528731543675359L; + + public ConnectAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO appeler le service Auth + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/UnconnectAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/UnconnectAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/UnconnectAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/auth/UnconnectAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.auth; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour se deconnecter du serveur distant + * + * @author chemit + */ +public class UnconnectAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 2248642521834932196L; + + public UnconnectAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO appel au service auth ? + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/AboutAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/AboutAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/AboutAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/AboutAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour afficher la boit de dialogue About de l'application + * + * @author chemit + */ +public class AboutAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 8275852970637350877L; + + public AboutAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ChangeI18nAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ChangeI18nAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ChangeI18nAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ChangeI18nAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,88 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.SimExplorer; +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; +import org.apache.commons.beanutils.Converter; +import org.codelutin.i18n.CountryEnum; +import org.codelutin.i18n.I18n; +import org.codelutin.i18n.LanguageEnum; +import org.codelutin.util.ConverterUtil; + +import java.awt.event.ActionEvent; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Une action pour recharger la locale. + * <p/> + * Le nom de l'action doit etre de la forme i18n_XX_YY où XX est la langue + * et YY le pays de la locale à charger. + * + * @author chemit + * @see LanguageEnum + * @see CountryEnum + */ +public class ChangeI18nAction extends SimExplorerAbstractAction { + + public static final Pattern PATTERN_NAME = Pattern.compile("i18n_(\\w\\w)_(\\w\\w)"); + + protected LanguageEnum language; + + protected CountryEnum country; + private static final long serialVersionUID = 4180668477670765253L; + + public ChangeI18nAction(String name) { + super(name); + Matcher matcher = PATTERN_NAME.matcher(name); + if (!matcher.matches()) { + throw new IllegalArgumentException(I18n._(getClass().getName() + " should have a nmae like this 'i18n_XX_YY', but was {0}", name)); + } + Converter convertorLanguage = ConverterUtil.getConverter(LanguageEnum.class); + language = (LanguageEnum) convertorLanguage.convert(LanguageEnum.class, matcher.group(1)); + + convertorLanguage = ConverterUtil.getConverter(CountryEnum.class); + country = (CountryEnum) convertorLanguage.convert(CountryEnum.class, matcher.group(2)); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO Should ask confirm from user since it will close ui, and re instanciate ui + + getMainUI().getQuit().getAction().actionPerformed(new ActionEvent(this, ActionEvent.ACTION_FIRST, "cancel")); + SimExplorer.reloadUI(); + getContext().getConfig().setI18n(language, country); + getContext().getConfig().initI18n(); + + SimExplorer.launch(); + + SimExplorer.getContext().saveSafely(); + } + + public boolean equalsLocale(LanguageEnum lang, CountryEnum countr) { + return language == lang && country == countr; + } + + @Override + public String toString() { + return super.toString() + " Language " + language + " Country " + country; + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ConfigAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ConfigAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ConfigAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/ConfigAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,43 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.ui.swing.JConfigUI; +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; +import org.codelutin.option.ui.ConfigTableModel; + +/** + * Action pour afficher la dialogue de modification de configuration + * + * @author chemit + */ +public class ConfigAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 1449553547444065616L; + + public ConfigAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + JConfigUI.showUI(getContext().getConfig(), ConfigTableModel.TypeModel.all); + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/HelpAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/HelpAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/HelpAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/HelpAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour afficher l'aide principale + * + * @author chemit + */ +public class HelpAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 8250247303366300958L; + + public HelpAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/QuitAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/QuitAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/QuitAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/QuitAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,42 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour quitter l'application + * + * @author chemit + */ +public class QuitAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = -2291089937320691627L; + + public QuitAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO Fermer tous les tabs + getMainUI().dispose(); + } +} Copied: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/SiteAction.java (from rev 227, trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SiteAction.java) =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/SiteAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/common/SiteAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,41 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.common; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractAction; + +/** + * Action pour accéder au site de l'application + * + * @author chemit + */ +public class SiteAction extends SimExplorerAbstractAction { + + private static final long serialVersionUID = 7458557977976803799L; + + public SiteAction(String name) { + super(name); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + super.actionPerformed(e); + //TODO + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/CloseTabAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/CloseTabAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/CloseTabAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,43 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.tab; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractTabAction; + +/** + * Action pour fermer un tab + * + * @author chemit + */ +public class CloseTabAction extends SimExplorerAbstractTabAction { + + private static final long serialVersionUID = -3088257073806742313L; + + public CloseTabAction(String name) { + super(name, "closeTab"); + } + + @Override + public void actionPerformed(java.awt.event.ActionEvent e) { + //TODO voir le model avant + + // close ui + super.actionPerformed(e); + } +} Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ShowTabAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ShowTabAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ShowTabAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,93 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gariel Landais +* +* 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.tab; + +import fr.cemagref.simexplorer.is.SimExplorer; +import fr.cemagref.simexplorer.is.service.StorageService; +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractTabAction; +import fr.cemagref.simexplorer.is.ui.swing.bean.ListApplicationBean; + +import java.awt.event.ActionEvent; + +/** + * Action pour afficher une tab + * + * @author chemit + */ +public class ShowTabAction extends SimExplorerAbstractTabAction { + + private static final long serialVersionUID = -4030583314708934811L; + + public ShowTabAction(String name) { + super(name, "showTab"); + } + + @Override + public void actionPerformed(ActionEvent e) { + + initAction(); + + // load ui + super.actionPerformed(e); + + // set model + + } + + public void initAction() { + + StorageService service; + + ListApplicationBean list; + switch (tab) { + + case detail: + + break; + case local: + if (getContext().getLocalApplications() == null) { + + service = SimExplorer.getStorageService(); + + // first local query, + list = new ListApplicationBean(); + try { + long size = service.findApplicationsCount(true); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + break; + case remote: + if (getContext().getRemoteApplications() == null) { + // first remote query, + service = SimExplorer.getRemoteStorageService(); + + list = new ListApplicationBean(); + + } + break; + case synchronize: + + break; + } + } +} Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ToggleTabAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ToggleTabAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/action/tab/ToggleTabAction.java 2008-01-20 13:33:33 UTC (rev 256) @@ -0,0 +1,44 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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.tab; + +import fr.cemagref.simexplorer.is.ui.swing.action.SimExplorerAbstractTabAction; + +import java.awt.event.ActionEvent; + +/** + * Action pour siwtcher un tab + * + * @author chemit + */ +public class ToggleTabAction extends SimExplorerAbstractTabAction { + + private static final long serialVersionUID = -5457476021698351850L; + + + public ToggleTabAction(String name) { + super(name, "toggleTab"); + } + + @Override + public void actionPerformed(ActionEvent e) { + super.actionPerformed(e); + //TODO + } +}
participants (1)
-
tchemit@users.labs.libre-entreprise.org