Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-09-19 10:37:00 -0400
committerUwe Stieber2013-09-19 10:37:00 -0400
commit9a223d759e4b237e82fa16aad9a4ec0ef7928da8 (patch)
tree640cd0daac8d7f5e3f842d88b4433130c67acf6f /target_explorer/plugins
parent6c3710b2f22199b463d0341d86ca48406ad63f6b (diff)
downloadorg.eclipse.tcf-9a223d759e4b237e82fa16aad9a4ec0ef7928da8.tar.gz
org.eclipse.tcf-9a223d759e4b237e82fa16aad9a4ec0ef7928da8.tar.xz
org.eclipse.tcf-9a223d759e4b237e82fa16aad9a4ec0ef7928da8.zip
Target Explorer: Fix context menu of system monitor is not updated on detaching a context.
Diffstat (limited to 'target_explorer/plugins')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelRunControlServiceListener.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelRunControlServiceListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelRunControlServiceListener.java
index 6f9322a0c..366ef2ac4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelRunControlServiceListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelRunControlServiceListener.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.processes.core.model.runtime.listener;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
@@ -68,13 +70,44 @@ public class RuntimeModelRunControlServiceListener implements RunControlListener
if (context_ids != null && context_ids.length > 0) {
IModelLookupService lkupService = model.getService(IModelLookupService.class);
IModelRefreshService refreshService = model.getService(IModelRefreshService.class);
+
+ // If we get a context ID like "P2.274154640", use the first part of the ID to
+ // refresh the parent context.
+ List<String> parentContextIDs = new ArrayList<String>();
+
for (String contextID : context_ids) {
+ if (contextID == null || "".equals(contextID.trim())) continue; //$NON-NLS-1$
+
IModelNode[] candidates = lkupService.lkupModelNodesById(contextID);
if (candidates != null && candidates.length > 0) {
for (IModelNode node : candidates) {
refreshService.refresh(node, null);
}
}
+
+ String[] parts = contextID.split("\\."); //$NON-NLS-1$
+ if (parts.length > 1) {
+ // Look for candidates for all parts. If found, than add the ID
+ // to the parent list
+ for (String partID : parts) {
+ candidates = lkupService.lkupModelNodesById(contextID);
+ if (candidates != null && candidates.length > 0) {
+ if (!parentContextIDs.contains(partID)) {
+ parentContextIDs.add(partID);
+ }
+ }
+ }
+ }
+ }
+
+ // Refresh all determined parent contexts
+ for (String parentContextID : parentContextIDs) {
+ IModelNode[] candidates = lkupService.lkupModelNodesById(parentContextID);
+ if (candidates != null && candidates.length > 0) {
+ for (IModelNode node : candidates) {
+ refreshService.refresh(node, null);
+ }
+ }
}
}
}

Back to the top