r776 - in trunk/simexplorer-is-swing/src: java/fr/cemagref/simexplorer/is/ui/swing/actions java/fr/cemagref/simexplorer/is/ui/swing/actions/util resources uimodel/fr/cemagref/simexplorer/is/ui/swing/tab
Author: tchemit Date: 2008-02-09 00:28:19 +0000 (Sat, 09 Feb 2008) New Revision: 776 Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAttachmentAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteLoggableElementAction.java trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/util/DeleteAbstractAction.java Modified: trunk/simexplorer-is-swing/src/resources/actions.properties trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx Log: actions de suppression Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAttachmentAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAttachmentAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteAttachmentAction.java 2008-02-09 00:28:19 UTC (rev 776) @@ -0,0 +1,72 @@ +/* +* ##% 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.attachment.Attachment; +import fr.cemagref.simexplorer.is.ui.swing.actions.util.DeleteAbstractAction; +import fr.cemagref.simexplorer.is.ui.swing.model.DetailTabModel; + +import java.awt.event.ActionEvent; + +/** + * Action pour downloader un résultat ou une librairie + * + * @author chemit + */ + at jaxx.runtime.builder.ActionConfig( + actionCommand = "deleteAttachment", + name = "simexplorer.action.deleteAttachment", + shortDescription = "simexplorer.action.deleteAttachment.tooltip", + longDescription = "simexplorer.action.deleteAttachment.help", + smallIcon = "action/delete.png", + mnemonic = 'x', + hideActionText = true +) +public class DeleteAttachmentAction extends DeleteAbstractAction { + + protected Attachment attachment; + private static final long serialVersionUID = 7535647131305304738L; + + + public DeleteAttachmentAction(String name) { + super(name); + } + + @Override + protected boolean beforeAction(ActionEvent e) throws Exception { + return super.beforeAction(e) && attachment != null; + } + + @Override + protected void initModel(DetailTabModel model) { + super.initModel(model); + attachment = model.getSelectedAttachment(); + } + + @Override + protected void doAction(ActionEvent e) throws Exception { + super.doAction(e); + } + + @Override + protected void clear() { + super.clear(); + attachment = null; + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteLoggableElementAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteLoggableElementAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/DeleteLoggableElementAction.java 2008-02-09 00:28:19 UTC (rev 776) @@ -0,0 +1,59 @@ +/* +* ##% 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.actions.util.DeleteAbstractAction; +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 = "deleteLoggableElement", + name = "simexplorer.action.deleteLoggableElement", + shortDescription = "simexplorer.action.deleteLoggableElement.tooltip", + longDescription = "simexplorer.action.deleteLoggableElement.help", + smallIcon = "action/delete.png", + mnemonic = 'x', + hideActionText = true +) +public class DeleteLoggableElementAction extends DeleteAbstractAction { + private static final long serialVersionUID = 5227114960042141191L; + + public DeleteLoggableElementAction(String name) { + super(name); + } + + @Override + protected void doAction(ActionEvent e) throws Exception { + super.doAction(e); + //TODO delete + } +} \ No newline at end of file Added: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/util/DeleteAbstractAction.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/util/DeleteAbstractAction.java (rev 0) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/util/DeleteAbstractAction.java 2008-02-09 00:28:19 UTC (rev 776) @@ -0,0 +1,89 @@ +/* +* ##% 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.util; + +import fr.cemagref.simexplorer.is.entities.metadata.MetaData; +import fr.cemagref.simexplorer.is.entities.metadata.Version; +import fr.cemagref.simexplorer.is.ui.swing.model.DetailTabModel; + +import java.awt.event.ActionEvent; + +/** + * Action pour deleter un loggableElement ou attachment + * + * @author chemit + */ +public abstract class DeleteAbstractAction extends SimExplorerAbstractTabAction { + + private static final long serialVersionUID = 7535647131305304738L; + + MetaData element; + String uuid; + Version version; + + protected DeleteAbstractAction(String name) { + super(name); + } + + + protected void initModel(DetailTabModel model) { + element = model.getDetail(); + version = model.getSelectedVersion(); + uuid = element.getUuid(); + } + + protected MetaData getElement() { + return element; + } + + protected String getUuid() { + return uuid; + } + + protected Version getVersion() { + return version; + } + + @Override + protected boolean beforeAction(ActionEvent e) throws Exception { + if (!super.beforeAction(e)) { + return false; + } + DetailTabModel model = ((DetailTabModel) getModel()); + boolean result; + // init from model + initModel(model); + result = element != null && version != null; + return result; + } + + @Override + protected void doAction(ActionEvent e) throws Exception { + super.doAction(e); + } + + @Override + protected void clear() { + super.clear(); + element = null; + version = null; + uuid = null; + } + +} \ No newline at end of file Modified: trunk/simexplorer-is-swing/src/resources/actions.properties =================================================================== --- trunk/simexplorer-is-swing/src/resources/actions.properties 2008-02-08 23:42:07 UTC (rev 775) +++ trunk/simexplorer-is-swing/src/resources/actions.properties 2008-02-09 00:28:19 UTC (rev 776) @@ -37,7 +37,8 @@ action.expandAllApplication=fr.cemagref.simexplorer.is.ui.swing.actions.ExpandAllAction action.downloadLoggableElement=fr.cemagref.simexplorer.is.ui.swing.actions.DownloadLoggableElementAction action.downloadAttachment=fr.cemagref.simexplorer.is.ui.swing.actions.DownloadAttachmentAction -action.delete=fr.cemagref.simexplorer.is.ui.swing.actions.DeleteAction +action.deleteLoggableElement=fr.cemagref.simexplorer.is.ui.swing.actions.DeleteLoggableElementAction +action.deleteAttachment=fr.cemagref.simexplorer.is.ui.swing.actions.DeleteAttachmentAction action.exportApplication=fr.cemagref.simexplorer.is.ui.swing.actions.ExportApplicationAction action.importApplication=fr.cemagref.simexplorer.is.ui.swing.actions.ImportApplicationAction Modified: trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx =================================================================== --- trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx 2008-02-08 23:42:07 UTC (rev 775) +++ trunk/simexplorer-is-swing/src/uimodel/fr/cemagref/simexplorer/is/ui/swing/tab/JApplicationDetailTab.jaxx 2008-02-09 00:28:19 UTC (rev 776) @@ -41,7 +41,7 @@ <JToolBar> <JButton id='exportApplication'/> <JButton id='downloadLoggableElement'/> - <JButton id='delete'/> + <JButton id='deleteLoggableElement'/> </JToolBar> </cell> </row> @@ -122,6 +122,7 @@ <cell fill='horizontal' anchor="east"> <JToolBar> <JButton id='downloadAttachment'/> + <JButton id='deleteAttachment'/> </JToolBar> </cell> </row>
participants (1)
-
tchemit@users.labs.libre-entreprise.org