Author: tchemit Date: 2008-02-09 00:29:16 +0000 (Sat, 09 Feb 2008) New Revision: 778 Removed: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAction.java Log: actions de suppression Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAction.java 2008-02-09 00:28:46 UTC (rev 777) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAction.java 2008-02-09 00:29:16 UTC (rev 778) @@ -1,97 +0,0 @@ -/* -* ##% 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.actions; - -import fr.cemagref.simexplorer.is.entities.data.LoggableElement; -import fr.cemagref.simexplorer.is.entities.metadata.Version; -import fr.cemagref.simexplorer.is.ui.swing.actions.util.SimExplorerAbstractTabAction; -import fr.cemagref.simexplorer.is.ui.swing.model.LoggableElementTreeHelper; -import fr.cemagref.simexplorer.is.ui.swing.model.LoggableElementTreeNode; -import fr.cemagref.simexplorer.is.ui.swing.tab.JApplicationDetailTab; - -import javax.swing.JTree; -import java.awt.event.ActionEvent; -import java.io.File; - -/** - * Action pour downloader un résultat ou une librairie - * - * @author chemit - */ - at jaxx.runtime.builder.ActionConfig( - actionCommand = "delete", - name = "simexplorer.action.application.delete", - shortDescription = "simexplorer.action.application.delete.tooltip", - longDescription = "simexplorer.action.application.delete.help", - smallIcon = "action/delete.png", - mnemonic = 'x', - hideActionText = true -) -public class DeleteAction extends SimExplorerAbstractTabAction { - - private static final long serialVersionUID = 7535647131305304738L; - - - JTree tree; - LoggableElementTreeNode node; - File file; - LoggableElement element; - String uuid; - Version version; - - public DeleteAction(String name) { - super(name); - } - - @Override - protected boolean beforeAction(ActionEvent e) throws Exception { - if (!super.beforeAction(e)) { - return false; - } - JApplicationDetailTab ui = (JApplicationDetailTab) getUI(); - tree = ui.getNavigationTree(); - node = LoggableElementTreeHelper.getSelectedNodeOrRootNode(tree); - boolean result; - result = LoggableElementTreeHelper.canDelete(node); - if (result) { - // ask user confirmation of node to delete - element = (LoggableElement) node.getUserObject(); - uuid = element.getMetaData().getUuid(); - version = element.getMetaData().getVersion(); - } - result = false; - return result; - } - - @Override - protected void doAction(ActionEvent e) throws Exception { - super.doAction(e); - } - - @Override - protected void clear() { - super.clear(); - tree = null; - node = null; - file = null; - element = null; - version = null; - uuid = null; - } -} \ No newline at end of file