fix for #19460.. groups problem
for group nodes the supporter map needs to be recreated each time, because the content of the group can change.
1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java Wed Jan 16 17:36:59 2002 +0000
1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java Thu Jan 17 08:30:45 2002 +0000
1.3 @@ -98,6 +98,7 @@
1.4 while (it.hasNext()) {
1.5 CommandActionSupporter support = (CommandActionSupporter)it.next();
1.6 Set files = (Set)suppMap.get(support);
1.7 +// System.out.println("executing.. files size =" + files.size());
1.8 FileObject[] filesArr = new FileObject[files.size()];
1.9 filesArr = (FileObject[])files.toArray(filesArr);
1.10 support.performAction(this, filesArr);
1.11 @@ -257,8 +258,18 @@
1.12 createSupporterMap(activatedNodes);
1.13 nodesRef = new WeakReference(activatedNodes);
1.14 } else {
1.15 + Node[] nods = (Node[])array;
1.16 + boolean hasAnyGroups = false;
1.17 + for (int i = 0; i < nods.length; i++) {
1.18 + if (nods[i] != null && nods[i] instanceof VcsGroupNode) {
1.19 +// System.out.println("has groupos..");
1.20 + hasAnyGroups = true;
1.21 + break;
1.22 + }
1.23 + }
1.24 boolean equal = org.openide.util.Utilities.compareObjects(array, activatedNodes);
1.25 - if (!equal) {
1.26 + if (!equal || hasAnyGroups ) {
1.27 +// System.out.println("recreating..");
1.28 createSupporterMap(activatedNodes);
1.29 nodesRef = new WeakReference(activatedNodes);
1.30 }
1.31 @@ -296,7 +307,7 @@
1.32 putValue(GROUP_DESCRIPTION_PROP, grNode.getShortDescription());
1.33 putValue(GROUP_NAME_PROP, grNode.getDisplayName());
1.34 Enumeration childs = nodes[i].getChildren().nodes();
1.35 -// System.out.println("create supp. map for group..");
1.36 +// System.out.println("create supp. map for group.. count=" + grNode.getChildren().getNodesCount());
1.37 while (childs.hasMoreElements()) {
1.38 Node nd = (Node)childs.nextElement();
1.39 DataObject dobj = (DataObject)nd.getCookie(DataObject.class);