Author: tchemit Date: 2008-02-12 01:28:16 +0000 (Tue, 12 Feb 2008) New Revision: 849 Removed: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SynchronizeElementAction.java Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/CollapseAllAction.java trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ExpandAllAction.java trunk/simexplorer-is/simexplorer-is-swing/src/resources/actions.properties Log: suppression action inutile +mise en place des actions expandAll et collapseAll sur plusieurs arbres avec le m?\195?\170me code de base. le nom de l'action permet de savoir exactement sur quel arbre travailler Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/CollapseAllAction.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/CollapseAllAction.java 2008-02-12 01:25:14 UTC (rev 848) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/CollapseAllAction.java 2008-02-12 01:28:16 UTC (rev 849) @@ -22,6 +22,7 @@ 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.JDetailTab; +import fr.cemagref.simexplorer.is.ui.swing.JSynchronizeTab; import javax.swing.JTree; import java.awt.event.ActionEvent; @@ -32,7 +33,7 @@ * @author chemit */ @jaxx.runtime.builder.ActionConfig( - actionCommand = "collapseAllApplication", + actionCommand = "collapseAll", name = "simexplorer.action.collapseAll", shortDescription = "simexplorer.action.collapseAll.tooltip", longDescription = "simexplorer.action.collapseAll.help", @@ -54,9 +55,23 @@ protected boolean beforeAction(ActionEvent e) throws Exception { if (!super.beforeAction(e)) { return false; + } + String actionName = getActionName(); + // on retrouve l'arbre concerné à partir du nom de l'action + if ("collapseAllDetail".equals(actionName)) { + JDetailTab ui = (JDetailTab) getUI(); + tree = ui.getNavigationTree(); + } else if ("collapseAllLocal".equals(actionName)) { + JSynchronizeTab ui = (JSynchronizeTab) getUI(); + tree = ui.getContentTreeLocal(); + } else if ("collapseAllRemote".equals(actionName)) { + JSynchronizeTab ui = (JSynchronizeTab) getUI(); + tree = ui.getContentTreeRemote(); } - JDetailTab ui = (JDetailTab) getUI(); - tree = ui.getNavigationTree(); + if (tree==null) { + // arbre non trouvé (cela devrait souleve une exception !) + return false; + } node = LoggableElementTreeHelper.getSelectedNodeOrRootNode(tree); boolean result; result = !(node == null || node.isLeaf()); Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ExpandAllAction.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ExpandAllAction.java 2008-02-12 01:25:14 UTC (rev 848) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/ExpandAllAction.java 2008-02-12 01:28:16 UTC (rev 849) @@ -18,21 +18,23 @@ * ##% */ package fr.cemagref.simexplorer.is.ui.swing.actions; +import fr.cemagref.simexplorer.is.ui.swing.JDetailTab; +import fr.cemagref.simexplorer.is.ui.swing.JSynchronizeTab; 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.model.LoggableElementTreeHelper; -import fr.cemagref.simexplorer.is.ui.swing.JDetailTab; import javax.swing.JTree; import java.awt.event.ActionEvent; /** - * Pour dérouler tous les noeuds de l'arbre d'une application + * Pour dérouler tous les noeuds de l'arbre de navigation à partir du noeud + * sélectionné. * * @author tony */ @jaxx.runtime.builder.ActionConfig( - actionCommand = "expandAllApplication", + actionCommand = "expandAll", name = "simexplorer.action.expandAll", shortDescription = "simexplorer.action.expandAll.tooltip", longDescription = "simexplorer.action.expandAll.help", @@ -55,8 +57,23 @@ if (!super.beforeAction(e)) { return false; } - JDetailTab ui = (JDetailTab) getUI(); - tree = ui.getNavigationTree(); + String actionName = getActionName(); + // on retrouve l'arbre concerné à partir du nom de l'action + if ("expandAllDetail".equals(actionName)) { + JDetailTab ui = (JDetailTab) getUI(); + tree = ui.getNavigationTree(); + } else if ("expandAllLocal".equals(actionName)) { + JSynchronizeTab ui = (JSynchronizeTab) getUI(); + tree = ui.getContentTreeLocal(); + } else if ("expandAllRemote".equals(actionName)) { + JSynchronizeTab ui = (JSynchronizeTab) getUI(); + tree = ui.getContentTreeRemote(); + } + if (tree==null) { + // arbre non trouvé (cela devrait souleve une exception !) + return false; + } + node = LoggableElementTreeHelper.getSelectedNodeOrRootNode(tree); boolean result; result = !(node == null || node.isLeaf()); Deleted: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SynchronizeElementAction.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SynchronizeElementAction.java 2008-02-12 01:25:14 UTC (rev 848) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/actions/SynchronizeElementAction.java 2008-02-12 01:28:16 UTC (rev 849) @@ -1,53 +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.actions.util.SimExplorerAbstractTabAction; -import fr.cemagref.simexplorer.is.ui.SimExplorerRuntimeException; - -import java.awt.event.ActionEvent; - -/** - * Action pour lancer la synchro - * - * @author tony - */ - at jaxx.runtime.builder.ActionConfig( - actionCommand = "synchronizeElement", - name = "simexplorer.action.synchronize", - shortDescription = "simexplorer.action.synchronize.tooltip", - longDescription = "simexplorer.action.synchronize.help", - smallIcon = "action/reload.png", - hideActionText = true -) -public class SynchronizeElementAction extends SimExplorerAbstractTabAction { - - private static final long serialVersionUID = 8379937369551031306L; - - public SynchronizeElementAction(String name) { - super(name); - } - - @Override - protected void doAction(ActionEvent e) throws Exception { - super.doAction(e); - //TODO prepare SynchronizeTabModel with uuid et version - throw new SimExplorerRuntimeException(this+" is not implemented yet!"); - } -} \ No newline at end of file Modified: trunk/simexplorer-is/simexplorer-is-swing/src/resources/actions.properties =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/resources/actions.properties 2008-02-12 01:25:14 UTC (rev 848) +++ trunk/simexplorer-is/simexplorer-is-swing/src/resources/actions.properties 2008-02-12 01:28:16 UTC (rev 849) @@ -24,9 +24,6 @@ action.showTab_detail=fr.cemagref.simexplorer.is.ui.swing.actions.ShowDetailTabAction action.showTab_synchronize=fr.cemagref.simexplorer.is.ui.swing.actions.ShowSynchronizeTabAction -# ??? TODO suppress -action.synchronizeElement=fr.cemagref.simexplorer.is.ui.swing.actions.SynchronizeElementAction - # toggle tab actions action.toggleTab_local=fr.cemagref.simexplorer.is.ui.swing.actions.ToggleLocalTabAction action.toggleTab_remote=fr.cemagref.simexplorer.is.ui.swing.actions.ToggleRemoteTabAction @@ -45,12 +42,12 @@ action.changeSizor=fr.cemagref.simexplorer.is.ui.swing.actions.ChangeSizorAction # collapse tree node actions -action.collapseAll=fr.cemagref.simexplorer.is.ui.swing.actions.CollapseAllAction +action.collapseAllDetail=fr.cemagref.simexplorer.is.ui.swing.actions.CollapseAllAction action.collapseAllLocal=fr.cemagref.simexplorer.is.ui.swing.actions.CollapseAllAction action.collapseAllRemote=fr.cemagref.simexplorer.is.ui.swing.actions.CollapseAllAction # expand tree node actions -action.expandAll=fr.cemagref.simexplorer.is.ui.swing.actions.ExpandAllAction +action.expandAllDetail=fr.cemagref.simexplorer.is.ui.swing.actions.ExpandAllAction action.expandAllLocal=fr.cemagref.simexplorer.is.ui.swing.actions.ExpandAllAction action.expandAllRemote=fr.cemagref.simexplorer.is.ui.swing.actions.ExpandAllAction @@ -63,8 +60,8 @@ # import- export actions action.exportElement=fr.cemagref.simexplorer.is.ui.swing.actions.ExportAction -action.exportElementToLocal=fr.cemagref.simexplorer.is.ui.swing.actions.ExportAction -action.exportElementToRemote=fr.cemagref.simexplorer.is.ui.swing.actions.ExportAction +action.exportElementToLocal=fr.cemagref.simexplorer.is.ui.swing.actions.ExportToLocalAction +action.exportElementToRemote=fr.cemagref.simexplorer.is.ui.swing.actions.ExportToRemoteAction action.importElement=fr.cemagref.simexplorer.is.ui.swing.actions.ImportAction # help actions
participants (1)
-
tchemit@users.labs.libre-entreprise.org