wlu: ordering
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/BSActivityItemProvider.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/BSActivityItemProvider.java
index 59d8024..a4de3af 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/BSActivityItemProvider.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/BSActivityItemProvider.java
@@ -652,13 +652,18 @@
newPrevNode.nextNode = node;
orderModified = true;
}
+
if (orderModified) {
+ List oldChildList = childList;
childList = new ArrayList();
LinkedChildListNode node = linkedChildList.head.nextNode;
while (node != null) {
childList.add(node.thisItem);
node = node.nextNode;
}
+ if (oldChildList.size() != childList.size()) { //Should never happen, but in case
+ childList = oldChildList;
+ }
}
// System.out.println("LD> result: ");
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/MoveUpCommand.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/MoveUpCommand.java
index d28b272..dd36f2f 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/MoveUpCommand.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/MoveUpCommand.java
@@ -22,10 +22,12 @@
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.epf.library.edit.TngAdapterFactory;
import org.eclipse.epf.library.edit.command.IResourceAwareCommand;
+import org.eclipse.epf.library.edit.util.DescriptorPropUtil;
import org.eclipse.epf.library.edit.util.TngUtil;
import org.eclipse.epf.library.edit.util.WbePropUtil;
import org.eclipse.epf.uma.Activity;
import org.eclipse.epf.uma.BreakdownElement;
+import org.eclipse.epf.uma.TaskDescriptor;
import org.eclipse.epf.uma.WorkBreakdownElement;
@@ -129,13 +131,6 @@
//return true if move is completely done - no need to do local move
//return false if move is partially done - still need to do local move
public static boolean handleWbeGlobalMove(Activity act, WorkBreakdownElement wbe, boolean up) {
- System.out.println("LD> handleWbeGlobalMove: begin");
- boolean b = handleWbeGlobalMove_(act, wbe, up);
- System.out.println("LD> handleWbeGlobalMove: end = " + b);
-
- return b;
- }
- public static boolean handleWbeGlobalMove_(Activity act, WorkBreakdownElement wbe, boolean up) {
AdapterFactory aFactory = TngAdapterFactory.INSTANCE
.getWBS_ComposedAdapterFactory();
ItemProviderAdapter adapter = (ItemProviderAdapter) aFactory.adapt(
@@ -146,13 +141,24 @@
return false;
}
+ WbePropUtil propUtil = WbePropUtil.getWbePropUtil();
boolean completelyDone = false;
List<?> childList = (List<?>) children;
- Set<BreakdownElement> localSet = new HashSet<BreakdownElement>(act
- .getBreakdownElements());
- WbePropUtil propUtil = WbePropUtil.getWbePropUtil();
+ Set<BreakdownElement> localSet = new HashSet<BreakdownElement>();
+ for (BreakdownElement be : act.getBreakdownElements()) {
+ if (be instanceof WorkBreakdownElement) {
+ if (be instanceof TaskDescriptor) {
+ if (DescriptorPropUtil.getDesciptorPropUtil()
+ .getGreenParent((TaskDescriptor) be) != null) {
+ continue;
+ }
+ }
+ localSet.add((WorkBreakdownElement) be);
+ }
+ }
+
WorkBreakdownElement globalPresentedAfter = act;
for (int i = 0; i < childList.size(); i++) {
Object child = childList.get(i);
@@ -208,7 +214,7 @@
Object newNextItem = i + 2 < childList.size() ? childList
.get(i + 2) : null;
- if (newNextItem instanceof WorkBreakdownElement) {
+ if (localSet.contains(newNextItem)) {
propUtil.setGlobalPresentedAfter((WorkBreakdownElement) newNextItem, wbe);
}