Author: sletellier Date: 2008-11-21 15:53:41 +0000 (Fri, 21 Nov 2008) New Revision: 1616 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java Log: Gestion des erreurs Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-11-21 13:57:45 UTC (rev 1615) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-11-21 15:53:41 UTC (rev 1616) @@ -54,7 +54,6 @@ import fr.ifremer.isisfish.entities.MetierSeasonInfoDAO; import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.PopulationGroup; -import fr.ifremer.isisfish.entities.PopulationGroupDAO; import fr.ifremer.isisfish.entities.PopulationSeasonInfo; import fr.ifremer.isisfish.entities.Port; import fr.ifremer.isisfish.entities.Selectivity; @@ -88,6 +87,7 @@ import static org.codelutin.i18n.I18nf._; import static javax.swing.JOptionPane.showInputDialog; import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation; +import static javax.swing.JOptionPane.showMessageDialog; /** * @@ -116,7 +116,11 @@ public InputAction() { } - + protected void showMsgBox(String txt){ + if (txt != null){ + showMessageDialog(null, txt); + } + } public void setValue(Object value, Class type) { if (type == Zone.class) { zone = (Zone) value; @@ -155,8 +159,6 @@ /** * Exporter la region dans un zip * - * @param uiContext - * @param frame * @return */ public File importRegion() { @@ -168,7 +170,7 @@ } } catch (Exception eee) { log.error("Can't import region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error " + eee.getMessage()); } return file; } @@ -176,8 +178,6 @@ /** * Exporter la region dans un zip * - * @param uiContext - * @param frame * @return */ public File importRegionAndRename() { @@ -192,7 +192,7 @@ } } catch (Exception eee) { log.error("Can't import region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error" + eee.getMessage()); } return file; } @@ -201,8 +201,6 @@ /** * Importer la region depuis un fichier XML de la version 2 * - * @param uiContext - * @param frame * @return */ public File importV2Region() { @@ -216,7 +214,7 @@ } } catch (Exception eee) { log.error("Can't import region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error" + eee.getMessage()); } return file; } @@ -225,9 +223,7 @@ * Extract from a simulation the region, and rename it with name given * by user. * - * @param frame the siwxat frame - * @param combo combo containing list of regions names - * @param uiContext the swixat context + * return msg */ public String importRegionFromSimulation() { @@ -238,7 +234,7 @@ simulationName = selectSimulation(SimulationStorage.getSimulationNames()); if (simulationName == null) { { -// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.no.selected.simulation"))); + showMsgBox("error" + _("isisfish.error.no.selected.simulation")); return null; } } @@ -247,7 +243,7 @@ String msg = _("isisfish.error.no.select.simulation"); log.warn(msg); e.printStackTrace(); -// frame.viewOutput(new OutputView("Error.xml", "error", msg)); + showMsgBox("error " + msg); return null; } @@ -256,19 +252,17 @@ // ask new region name String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName); if (regionName == null || "".equals(regionName)) { -// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.name.empty"))); + showMsgBox("error " + _("isisfish.error.region.name.empty")); return null; } if (RegionStorage.getRegionNames().contains(regionName)) { -// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.already.exists"))); + showMsgBox("error " + _("isisfish.error.region.already.exists")); return null; } log.info("new region name " + regionName); - // frame.setInfoText(_("isisfish.message.import", regionName)); - try { SimulationStorage.getSimulation(simulationName).extractRegion(regionName); @@ -290,7 +284,7 @@ } catch (StorageException e) { log.error("Can't extract region", e); -// frame.viewOutput(new OutputView("Error.xml", "error", e.getMessage())); + showMsgBox("error" + e.getMessage()); } return regionName; } @@ -298,9 +292,6 @@ /** * Exporter la region dans un zip * - * @param uiContext - * @param frame - * @param regionStorage * @return */ public File exportRegion() { @@ -319,7 +310,7 @@ } } catch (Exception eee) { log.error("Can't export region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error" + eee.getMessage()); } return file; } @@ -327,9 +318,6 @@ /** * Copy la region avec un autre nom * - * @param uiContext - * @param frame - * @param regionStorage * @return */ public String copyRegion() { @@ -342,7 +330,7 @@ } catch (Exception eee) { log.error("Can't copy region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error" + eee.getMessage()); } return newName; } @@ -350,10 +338,6 @@ /** * Remove region * - * @param uiContext - * @param frame - * @param regionStorage - * region to remove * @param cvsDelete * if true delete region in CVS too * @return @@ -373,7 +357,7 @@ } } catch (Exception eee) { log.error("Can't remove region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error" + eee.getMessage()); } return result; } @@ -381,10 +365,6 @@ /** * Remove region * - * @param uiContext - * @param frame - * @param regionStorage - * region to remove * @return */ public String commitRegionInCVS() { @@ -406,7 +386,7 @@ } } catch (Exception eee) { log.error("Can't export region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error " + eee.getMessage()); } return result; } @@ -418,12 +398,6 @@ * <p> * tree ans * - * @param uiContext - * @param frame - * @param oldIsisContext - * @param oldRegionStorage - * @param inputPane - * inputPane is put in 'emptyPanel' state * @param name * name of region * @return if ok return null else OutView error @@ -463,7 +437,7 @@ } catch (Exception eee) { log.error("Can't load region", eee); - //new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("error " + eee.getMessage()); } } @@ -471,12 +445,6 @@ * Create new region, and select it in combo, and show input pane region in * input area. * - * @param uiContext - * @param frame - * @param oldIsisContext - * @param oldRegionStorage - * @param inputPane - * @param combo * @param name * name of the new region * @return if ok return null else OutView error @@ -498,10 +466,10 @@ // } if ("".equals(name)) { -// return new OutputView("Error.xml", "error", _("isisfish.error.region.name.empty")); + showMsgBox("error " + _("isisfish.error.region.name.empty")); } if (RegionStorage.getRegionNames().contains(name)) { -// return new OutputView("Error.xml", "error", _("isisfish.error.region.already.exists")); + showMsgBox("Error " + _("isisfish.error.region.already.exists")); } @@ -510,7 +478,7 @@ } catch (Exception eee) { log.error("Can't create region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } } @@ -524,10 +492,6 @@ * * if this method return false, nothing is do * - * @param uiContext - * @param frame - * @param isisContext - * current transaction context * @return false if user want cancel action, true otherwize * @throws TopiaException */ @@ -559,13 +523,6 @@ * Permet de creer simplement un nouvelle objet portant un nom par defaut. * Le nouvel element est automatiquement selectionné dans l'arbre * - * @param frame - * @param isisContext - * (auto) Le Topia context a utiliser - * @param tree - * (auto) l'arbre ou il faudra selectionner le nouvel element - * @param jmodel - * (auto) le model de l'arbre * @param type * le type de l'entite a creer, le type est compose seulement du * nom de l'entite et pas du package. @@ -589,7 +546,7 @@ } catch (Exception eee) { log.error("Can't create entity", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -597,11 +554,8 @@ /** * Save entity passed in argument, and commit * - * @param frame * @param idToRefresh * id to refresh after commit - * @param entity - * entity to save * @return if ok return null else OutView error */ public TopiaEntity save(String idToRefresh) { @@ -618,7 +572,7 @@ selected.getTopiaContext().commitTransaction(); } catch (Exception eee) { log.error("Can't save region", eee); - // return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return selected; } @@ -627,14 +581,9 @@ * Cancel all modification on entity (rollback), and force reload it and * refresh all ui component that name match 'type'Tab * - * @param uiContext - * @param frame - * @param isisContext * @param type * entity type (Zone, Gear, Population, ...), prefix of user * interface Tab to refresh after rollback and reload - * @param entity - * entity to refresh * @return if ok return null else OutView error */ public Object cancel(String type) { @@ -652,7 +601,7 @@ } catch (Exception eee) { log.error("Can't cancel modification in region", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -664,16 +613,6 @@ * Refresh all ui component where name match "input<entity type without * package >.*" * - * @param uiContext - * @param frame - * @param isisContext - * @param fisheryRegion - * @param tree - * tree where we want to select other node - * @param jmodel - * tree model - * @param entity - * entuty to remove * @return if ok return null else OutView error */ public String remove() { @@ -712,7 +651,7 @@ } } catch (Exception eee) { log.error("Can't remove entity: " + selected, eee); - // return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } // finally { // uiContext.removeData("InDeletion"); @@ -723,9 +662,6 @@ /** * Save an Equation as model, to reuse it for other equation * - * @param uiContext - * @param frame - * @param isisfish * @param eq * equation to put in models * @return if ok return null else OutputView error message @@ -735,7 +671,7 @@ if (eq != null) { String name = showInputDialog(""); if ("".equals(name)) { -// return new OutputView("Error.xml", "error",_("isisfish.error.invalid.equation.name")); + showMsgBox("Error " +_("isisfish.error.invalid.equation.name")); } if (name != null) { FormuleStorage storage = FormuleStorage.createFormule(eq @@ -747,7 +683,7 @@ } } catch (Exception eee) { log.error("Can't save equation as model", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -755,21 +691,18 @@ /** * Save an Equation as model, to reuse it for other equation * - * @param uiContext - * @param frame - * @param isisfish * @param category * categoy for this equation * @param isisfish * equation to put in models - * @param language + * @param language * @return if ok return null else OutputView error message */ public Object saveAsModel(String category, String language, String content) { try { String name = showInputDialog(""); if ("".equals(name)) { -// return new OutputView("Error.xml", "error",_("isisfish.error.invalid.equation.name")); + showMsgBox("Error " +_("isisfish.error.invalid.equation.name")); } if (name != null) { FormuleStorage storage = FormuleStorage.createFormule(category, name, language); @@ -778,7 +711,7 @@ } catch (Exception eee) { log.error("Can't save equation as model", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -795,7 +728,7 @@ pane.dispose(); } catch (Exception eee) { log.error("Can't open editor", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -879,7 +812,7 @@ } catch (Exception eee) { log.error("Can't add selectivity", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -892,7 +825,7 @@ } }catch(Exception eee){ log.error("Can't remove TargetSpecies", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -913,7 +846,7 @@ }catch(Exception eee){ log.error("Can't create MetierSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -926,26 +859,10 @@ isisContext.commitTransaction(); }catch(Exception eee){ log.error("Can't create MetierSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } - -// static public Object selectSeasonInfo( -// Context uiContext, AbstractFrame frame, -// MetierSeasonInfo metierSeasonInfo){ -// log.debug("selectSeasonInfo called"); -// try { -// uiContext.setData("MetierSeasonInfo", metierSeasonInfo); -// -// frame.refreshView("inputMetierSeasonInfoZone"); -// frame.refreshView("inputMetierSeasonInfoSpecies"); -// }catch(Exception eee){ -// log.error("Can't create MetierSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch){ log.debug("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation); @@ -961,7 +878,7 @@ // frame.refreshView("inputMetierSeasonInfoSpecies"); }catch(Exception eee){ log.error("Can't add TargetSpecies", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -976,7 +893,7 @@ } }catch(Exception eee){ log.error("Can't remove TargetSpecies", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -997,7 +914,7 @@ }catch(Exception eee){ log.error("Can't create EffortDescription", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } } @@ -1009,30 +926,13 @@ } catch (Exception eee) { log.error("Can't remove entity: " + effort, eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } // Population -// -// public void wizardGroupOpen() { -// log.debug("wizardGroupOpen"); -// -//// TODO : convertir WizardGroupCreation en jaxx -// WizardGroupCreationUI model = new WizardGroupCreationUI(); -//// model.setAgeType(population.getSpecies().getAgeGroupType()); -//// if (model.isAgeType()) { -//// model.setState("singleGroupAge"); -//// } else { -//// model.setState("beginGroupLength"); -//// } -// -//// return new OutputView("input/WizardGroupCreation.xml", ctx); -// } - - public Object createRecruitmentDistribution() { log.debug("createRecruitmentDistributionontext called: " + population); try { @@ -1064,12 +964,12 @@ population.setRecruitmentDistribution(newMat); population.update(); } else { -// new OutputView("Error.xml", "error", _("isisfish.error.integer.positif")); +// new OutputView("Error.xml " + "Error " + _("isisfish.error.integer.positif")); } } catch (Exception eee) { log.error("Can't remove PopulationSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -1085,7 +985,7 @@ }catch(Exception eee){ log.error("Can't add migration", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } @@ -1100,34 +1000,11 @@ }catch(Exception eee){ log.error("Can't add emigration", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } - -// public Object removeEmigration(PopulationSeasonInfo info, -// MatrixPanelEditor panel) { -// log.debug("removeEmigration called"); -// try { -// int row = panel.getTable().getSelectedRow(); -// Object group = panel.getTable().getValueAt(row, 0); -// Object departure = panel.getTable().getValueAt(row, 1); -// -// MatrixND mat = info.getEmigrationMatrix().copy(); -// mat.setValue(group, departure, 0); -// info.setEmigrationMatrix(mat); -// -// frame.refreshView("PopulationMigrationEmigrationTable"); -// }catch(Exception eee){ -// log.error("Can't remove migration", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } - - - public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) { log.debug("addImmigration called"); try { @@ -1137,28 +1014,8 @@ }catch(Exception eee){ log.error("Can't add immigration", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); + showMsgBox("Error " + eee.getMessage()); } return null; } - -// static public Object removeImmigration(AbstractFrame frame, PopulationSeasonInfo info, -// MatrixPanelEditor panel) { -// log.debug("removeImmigration called"); -// try { -// int row = panel.getTable().getSelectedRow(); -// Object group = panel.getTable().getValueAt(row, 0); -// Object arrival = panel.getTable().getValueAt(row, 2); -// -// MatrixND mat = info.getImmigrationMatrix().copy(); -// mat.setValue(group, arrival, 0); -// info.setImmigrationMatrix(mat); -// -// frame.refreshView("PopulationMigrationImmigrationTable"); -// }catch(Exception eee){ -// log.error("Can't remove immigration", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } } 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 2008-11-21 13:57:45 UTC (rev 1615) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-11-21 15:53:41 UTC (rev 1616) @@ -42,6 +42,7 @@ import org.codelutin.util.FileUtil; import static org.apache.commons.logging.LogFactory.getLog; import static fr.ifremer.isisfish.equation.Language.JAVA; +import static javax.swing.JOptionPane.showMessageDialog; class ScriptFileFilter implements FileFilter { final FileFilter filter; @@ -62,6 +63,11 @@ public ScriptAction(){ } + protected void showMsgBox(String txt){ + if (txt != null){ + showMessageDialog(null, txt); + } + } public CodeSourceStorage getCode(){ return code; } @@ -120,12 +126,9 @@ * Creer un nouveau script, ici un script peut-etre un Script, un Simulator, * un Export. * - * @param uiContext TODO - * @param frame TODO + * @param fileName * @param scriptType le type que l'on souhaite Script, Simulator, * ou Export. - * @param jmodel TODO - * @param tree TODO * @return TODO */ public void newScript(String fileName, String scriptType) { @@ -176,32 +179,6 @@ template = mapping.getDefaultContent(); switch (mapping) { case EquationModel: -// if (!category.isEmpty()) { -// // on utilise la category passée dans le nom -// parentNode = (TreeNodeWrapper) jmodel.getNode(category); -// if (parentNode == null) { -// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); -// JTreeNode jparentNode = parentNode.getWrapped(); -// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); -// jnode.setName(category); -// parentNode.addNode(jnode, category); -// parentNode = (TreeNodeWrapper) jmodel.getNode(category); -// UIHelper.setTreeSelection(tree, jmodel, category); -// } -// } else { -// // on utilise la category dans la navigation -// TreePath path = tree.getSelectionPath(); -// if (path.getPath().length < 2) { -// // fatal error no category found, and was required -// String message = _("isisfish.error.invalid.category.name", fileName); -// e = new RuntimeException(message); -// return returnError(_("isisfish.error.script.create", fileName, e.getMessage()), e); -// } -// TreeNodeWrapper categotyNode = (TreeNodeWrapper) path.getPathComponent(2); -// parentNode = categotyNode; -// category = String.valueOf(categotyNode.getUserObject()); -// } - script = FormuleStorage.createFormule(category, realFilename, JAVA); break; case AnalysePlan: @@ -238,24 +215,7 @@ IsisFish.config.getUserName(), IsisFish.config.getUserMail()); script.setContent(content); - // ajout du nouveau script dans l'arbre -// if (parentNode == null) { -// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); -// } -// if (parentNode != null) { -// JTreeNode jparentNode = parentNode.getWrapped(); -// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); -// parentNode.addNode(jnode, script.getName()); -// } -// // selection du nouveau noeud, ce qui appel la methode load -// UIHelper.setTreeSelection(tree, jmodel, script.getName()); - -// uiContext.setData(SCRIPT_STORAGE, script); code = script; -// uiContext.setData(SCRIPT_TYPE, scriptType); -// frame.refreshView("scriptJedit"); -// frame.refreshView("buttonBar"); -// frame.refreshView("scriptMenuBar"); } catch (Exception eee) { returnError(_("isisfish.error.script.create",fileName, eee.getMessage()),eee); } @@ -263,8 +223,7 @@ } protected void returnError(String s, Exception eee) { log.error(s,eee); -// return new OutputView("Error.xml", "error", s); - //return null; + showMsgBox("error " + s); } public void loadScript(GenericCell c, String fileName, String type){ ScriptMapping mapping = ScriptMapping.valueOf(type); @@ -344,9 +303,7 @@ * Exporte le(s) script(s) sélectionnés dans l'arbe. * <br>L'arbre doit avoir au moins un script de selectionne * - * @param uiContext swixat context - * @param frame swiaxt frame - * @param tree tree contaings script + * @param TreePath selected path * @return <code>null</code> if everything is ok, * an <code>OutputVie<</code> with an error to display otherwise */ @@ -355,16 +312,6 @@ // first step : acquire list of files required int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1; List<String> listFiles = extractFiles(prefixLength, selectedPaths); - -// try { -// boolean fired = ScriptActionHelper.exportScript(null, listFiles, false, true, frame); -// if (!fired) { -// message = _("isisfish.message.export.cancelled"); -// } else { -// message = _("isisfish.message.export.done"); -// } -// } catch (Exception eee) { -// } return message; } protected static List<String> extractFiles(int prefixLength,TreePath[] selectedPaths) { @@ -403,12 +350,6 @@ List<File> listF = new ArrayList<File>(); // there is some directories selected by user for (File dir : dirFound) { - // take all files and directories in the dir - // (without VCS and data dirs) -// SVNMigrateHelper.grabbFiles(dir, excludeFilter, listF); - - - // getFilteredElements use include file filter, we inverse excludeFilter FileFilter filter = new FileFilter() { FileFilter excludeFilter = getSCRIPT_FILE_FILTER(); public boolean accept(File pathname) { @@ -477,6 +418,7 @@ return resultLog; } public String evaluateScript(String content) { + showMsgBox("Error.xml" + "test" + content); log.debug("evaluateScript called"); String msg = ""; try { @@ -510,17 +452,9 @@ log.debug("importScript "); // TODO : a reimplanter try { -// boolean fired = fr.ifremer.isisfish.ui.ScriptActionHelper.importScript(null, false, true, frame); -// if (!fired) { msg = _("isisfish.message.import.scripts.file.cancelled"); -// return null; -// } -// msg = _("isisfish.message.import.scripts.file.done"); -// if (script!=null) { -// UIHelper.setTreeSelection(tree, jmodel, script.getName()); -// } } catch (Exception eee) { -// return returnError(_("isisfish.error.script.import", eee.getMessage()), eee); + returnError(_("isisfish.error.script.import", eee.getMessage()), eee); } return msg; } @@ -538,17 +472,14 @@ code.delete(remote); if (code.getFile().exists()) { RuntimeException exception = new RuntimeException("file could not be deleted"); -// return returnError(_("isisfish.error.script.delete",code.getFile(), exception.getMessage()), exception); + returnError(_("isisfish.error.script.delete",code.getFile(), exception.getMessage()), exception); } -// uiContext.setData(SCRIPT_STORAGE, null); - -// frame.refreshView(); msg = _("isisfish.message.delete.finished"); } else { msg = _("isisfish.message.delete.canceled"); } } catch (Exception eee) { -// return returnError(_("isisfish.error.script.delete",script==null?null:script.getFile(), eee.getMessage()),eee); + returnError(_("isisfish.error.script.delete",code==null?null:code.getFile(), eee.getMessage()),eee); } return msg; } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-11-21 13:57:45 UTC (rev 1615) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-11-21 15:53:41 UTC (rev 1616) @@ -73,8 +73,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.JDialog; -import javax.swing.JLabel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codelutin.log.UserLog; @@ -102,7 +100,6 @@ public SimulAction() { init(); } - public String init(){ log.debug("Init "); try { @@ -177,7 +174,7 @@ /** * Change region in simulation launcher * - * @param regionName SimulationParameter/description + * @param regionName SimulationParameter/description */ public String regionChange(String regionName) { try{