r1858 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script
Author: chatellier Date: 2009-02-23 09:02:58 +0000 (Mon, 23 Feb 2009) New Revision: 1858 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java Log: Some code style corrections. Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-02-20 17:00:48 UTC (rev 1857) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-02-23 09:02:58 UTC (rev 1858) @@ -1,3 +1,22 @@ +/* *##% + * Copyright (C) 2006 - 2009 + * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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.ifremer.isisfish.ui.script; import static org.codelutin.i18n.I18n._; @@ -38,7 +57,7 @@ import fr.ifremer.isisfish.vcs.VCSException; class ScriptFileFilter implements FileFilter { - final FileFilter filter; + protected FileFilter filter; public ScriptFileFilter(FileFilter filter) { this.filter = filter; @@ -50,13 +69,18 @@ } /** + * ScriptAction. + * + * @author letellier + * @version $Revision: 1526 $ * - * @author letellier + * Last update: $Date: 2008-10-07 18:46:13 +0200 (mar 07 oct 2008) $ + * by : $Author: tchemit $ */ public class ScriptAction { /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(ScriptAction.class); + private static Log log = LogFactory.getLog(ScriptAction.class); protected CodeSourceStorage code; @@ -74,7 +98,9 @@ return code; } - /** @return an array of all script's modules names managed by this screen */ + /** + * @return an array of all script's modules names managed by this screen + */ public static String[] getScriptTypesNames() { ScriptMapping[] values = ScriptMapping.values(); String[] result = new String[values.length]; @@ -136,19 +162,19 @@ return FormuleStorage.getFormuleDirectory(); } - /* - * JButton Action + /** + * Creer un nouveau script, ici un script peut-etre un Script, un Simulator, + * un Export. + * + * @param fileName + * @param scriptType le type que l'on souhaite Script, Simulator, + * ou Export. */ - /** - * Creer un nouveau script, ici un script peut-etre un Script, un Simulator, - * un Export. - * - * @param fileName - * @param scriptType le type que l'on souhaite Script, Simulator, - * ou Export. - */ public void newScript(String fileName, String scriptType) { - // log.info("newScript called [" + scriptType + "] " + uiContext); + + if (log.isDebugEnabled()) { + log.info("newScript called [" + scriptType + "]"); + } Exception e; try { @@ -405,7 +431,7 @@ // there is some directories selected by user for (File dir : dirFound) { FileFilter filter = new FileFilter() { - FileFilter excludeFilter = getSCRIPT_FILE_FILTER(); + FileFilter excludeFilter = getScriptFileFilter(); public boolean accept(File pathname) { return !excludeFilter.accept(pathname); @@ -421,13 +447,13 @@ return result; } - public static FileFilter SCRIPT_FILE_FILTER; + protected static FileFilter scriptFileFilter; - public static FileFilter getSCRIPT_FILE_FILTER() { - if (SCRIPT_FILE_FILTER == null) { - SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs); + public static FileFilter getScriptFileFilter() { + if (scriptFileFilter == null) { + scriptFileFilter = new ScriptFileFilter(IsisFish.vcs); } - return SCRIPT_FILE_FILTER; + return scriptFileFilter; } //public static Object updateScript() @@ -643,7 +669,8 @@ + "\n" + " public void simulate(SimulationContext context) throws Exception '{'\n" + " // put your code here\n" + " '}'\n" - + "\n" + "'}'\n"), Export( + + "\n" + "'}'\n"), + Export( ExportStorage.getExportDirectory(), /** * 0 = package name, @@ -714,7 +741,9 @@ + "\n" + " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n" + " // put your code here, and write export with: out.write(\"...\")\n" - + " '}'\n" + "\n" + "'}'\n"), Rule( + + " '}'\n" + "\n" + "'}'\n"), + + Rule( RuleStorage.getRuleDirectory(), /** * 0 = package name, @@ -816,7 +845,9 @@ + " * @param simulation La simulation pour lequel on utilise cette regle\n" + " */\n" + " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" - + " // TODO\n" + " '}'\n" + "\n" + "'}'\n"), AnalysePlan( + + " // TODO\n" + " '}'\n" + "\n" + "'}'\n"), + + AnalysePlan( AnalysePlanStorage.getAnalysePlanDirectory(), /** * 0 = package name, @@ -908,8 +939,10 @@ + " */\n" + " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n" + " return false; // TODO\n" + " '}'\n" - + "\n" + "'}'\n"), EquationModel(FormuleStorage - .getFormuleDirectory(), + + "\n" + "'}'\n"), + + EquationModel( + FormuleStorage.getFormuleDirectory(), /** * 0 = package name, * 1 = class name, @@ -926,19 +959,19 @@ //" */\n" + "\n" + "// put your code here\n" + "\n"); - private File module; - private String defaultContent; + protected File module; + protected String defaultContent; - ScriptMapping(File module, String defaultContent) { + private ScriptMapping(File module, String defaultContent) { this.module = module; this.defaultContent = defaultContent; } - File getModule() { + public File getModule() { return module; } - String getDefaultContent() { + public String getDefaultContent() { return defaultContent; } }
participants (1)
-
chatellier@users.labs.libre-entreprise.org