From: <de...@us...> - 2012-10-17 22:51:43
|
Revision: 7758 http://fudaa.svn.sourceforge.net/fudaa/?rev=7758&view=rev Author: deniger Date: 2012-10-17 22:51:37 +0000 (Wed, 17 Oct 2012) Log Message: ----------- Modified Paths: -------------- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java Modified: trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java =================================================================== --- trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:30:58 UTC (rev 7757) +++ trunk/soft/fudaa-crue/ui-emh/src/main/java/org/fudaa/fudaa/crue/emh/common/OutlineSelectionHistory.java 2012-10-17 22:51:37 UTC (rev 7758) @@ -10,12 +10,12 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyVetoException; -import javax.swing.event.ListSelectionEvent; +import org.apache.commons.lang.ArrayUtils; import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandAction; import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.fudaa.crue.common.node.NodeHelper; +import org.fudaa.ctulu.CtuluLibArray; import org.openide.explorer.ExplorerManager; import org.openide.explorer.view.OutlineView; import org.openide.nodes.Node; @@ -44,9 +44,6 @@ private void changePath(Node[] path) { isUpdatingFromHistory = true; try { -// for (Node node : path) { -// NodeHelper.expandNode(node, outlineView); -// } em.setSelectedNodes(path); } catch (PropertyVetoException ex) { Exceptions.printStackTrace(ex); @@ -68,7 +65,6 @@ private boolean isUpdatingFromHistory; private Action nextAction; private Action previousAction; - private final OutlineView outlineView; private final ExplorerManager em; /** @@ -78,7 +74,6 @@ */ public OutlineSelectionHistory(OutlineView table) { super(); - this.outlineView = table; em = ExplorerManager.find(table); em.addPropertyChangeListener(this); } @@ -136,6 +131,7 @@ public void uninstallListener() { em.removePropertyChangeListener(this); } + Node[] keptOldSelection; @Override public void propertyChange(PropertyChangeEvent evt) { @@ -143,10 +139,22 @@ if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) { Node[] oldNode = (Node[]) evt.getOldValue(); Node[] newNode = (Node[]) evt.getNewValue(); + //cela peut arriver... + + if (oldNode.length == 0 && keptOldSelection != null) { + oldNode = keptOldSelection; + } + if (CtuluLibArray.isEquals(newNode, oldNode)) { + return; + } + keptOldSelection = null; if (oldNode.length > 0 && newNode.length > 0) { getHistory().addCmd(new ChangeSelectionCommand(oldNode, newNode)); + } else if (newNode.length == 0 && oldNode.length > 0) { + keptOldSelection = oldNode; } } else if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { + keptOldSelection = null; getHistory().clean(); } Modified: trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java =================================================================== --- trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:30:58 UTC (rev 7757) +++ trunk/soft/fudaa-crue/ui-modelling/src/main/java/org/fudaa/fudaa/crue/modelling/ModellingNetworkTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758) @@ -16,6 +16,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.JButton; import javax.swing.JPanel; @@ -28,6 +29,7 @@ import org.fudaa.dodico.crue.metier.emh.EMHScenario; import org.fudaa.dodico.crue.metier.emh.EMHSousModele; import org.fudaa.dodico.crue.metier.transformer.TransformerHelper; +import org.fudaa.ebli.commun.EbliLib; import org.fudaa.fudaa.crue.common.log.LogsDisplayer; import org.fudaa.fudaa.crue.emh.common.OutlineSelectionHistory; import org.fudaa.fudaa.crue.emh.node.LinkedEMHTableCellRenderer; @@ -124,6 +126,7 @@ btNext.setText(StringUtils.EMPTY); pnTop.add(btNext); add(pnTop, BorderLayout.NORTH); + EbliLib.updateMapKeyStroke(this, new Action[]{history.getPreviousAction(), history.getNextAction()}); } @Override Modified: trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java =================================================================== --- trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java 2012-10-17 22:30:58 UTC (rev 7757) +++ trunk/soft/fudaa-crue/ui-study/src/main/java/org/fudaa/fudaa/crue/study/ModeleListTopComponent.java 2012-10-17 22:51:37 UTC (rev 7758) @@ -19,14 +19,14 @@ * Top component which displays something. */ @ConvertAsProperties(dtd = "-//org.fudaa.fudaa.crue.study//ModeleList//EN", - autostore = false) +autostore = false) @TopComponent.Description(preferredID = ModeleListTopComponent.TOPCOMPONENT_ID, - iconBase = "org/fudaa/fudaa/crue/study/icons/modele_16.png", - persistenceType = TopComponent.PERSISTENCE_ALWAYS) -...@To...gistration(mode = "study-topRight",position = 2, openAtStartup = false) +iconBase = "org/fudaa/fudaa/crue/study/icons/modele_16.png", +persistenceType = TopComponent.PERSISTENCE_ALWAYS) +...@To...gistration(mode = "study-topRight", position = 2, openAtStartup = false) @ActionID(category = "Window", id = "org.fudaa.fudaa.crue.study.ModeleListTopComponent") @TopComponent.OpenActionRegistration(displayName = "#CTL_ModeleListAction", - preferredID = ModeleListTopComponent.TOPCOMPONENT_ID) +preferredID = ModeleListTopComponent.TOPCOMPONENT_ID) @ActionReference(path = "Menu/Window/Study", position = 2) public final class ModeleListTopComponent extends ListTopComponentAbstract { @@ -40,7 +40,6 @@ outlineView.getOutline().setToolTipText(null); outlineView.getOutline().setColumnHidingAllowed(false); outlineView.getOutline().addFocusListener(new FocusAdapter() { - @Override public void focusGained(FocusEvent e) { super.focusGained(e); @@ -55,8 +54,8 @@ } /** - * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of - * this method is always regenerated by the Form Editor. + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |