Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-06-05 03:17:15 -0400
committerUwe Stieber2013-06-05 03:17:15 -0400
commita13cb6fdddc13a8ca1f42a4ec8f092baa891d8e0 (patch)
tree7d7e78b53c1ee5ac5339bbce240cda1808b1a11d /target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core
parent2e41449b85607ac874a0360f73c095b30eaf94f6 (diff)
downloadorg.eclipse.tcf-a13cb6fdddc13a8ca1f42a4ec8f092baa891d8e0.tar.gz
org.eclipse.tcf-a13cb6fdddc13a8ca1f42a4ec8f092baa891d8e0.tar.xz
org.eclipse.tcf-a13cb6fdddc13a8ca1f42a4ec8f092baa891d8e0.zip
Target Explorer: Provide busy indicator while refreshing the process list
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java26
1 files changed, 26 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/services/RuntimeModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
index 0737a3de4..2e04f5cbb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
@@ -89,6 +89,21 @@ public class RuntimeModelRefreshService extends AbstractModelService<IRuntimeMod
return;
}
+ final IAsyncRefreshableCtx refreshable = (IAsyncRefreshableCtx)model.getAdapter(IAsyncRefreshableCtx.class);
+ final AtomicBoolean resetPendingNode = new AtomicBoolean(false);
+ if (refreshable != null && refreshable.getQueryState(QueryType.CHILD_LIST) != QueryState.IN_PROGRESS) {
+ resetPendingNode.set(true);
+ // Mark the refresh as in progress
+ refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.IN_PROGRESS);
+ // Create a new pending operation node and associate it with the refreshable
+ PendingOperationModelNode pendingNode = new PendingOperationNode();
+ pendingNode.setParent(model);
+ refreshable.setPendingOperationNode(pendingNode);
+ // Trigger a refresh of the view content.
+ ChangeEvent event = new ChangeEvent(model, IContainerModelNode.NOTIFY_CHANGED, null, null);
+ EventManager.getInstance().fireEvent(event);
+ }
+
// Get the list of old children (update node instances where possible)
final List<IProcessContextNode> oldChildren = model.getChildren(IProcessContextNode.class);
@@ -111,6 +126,17 @@ public class RuntimeModelRefreshService extends AbstractModelService<IRuntimeMod
for (IProcessContextNode oldChild : oldChildren) model.getService(IModelUpdateService.class).remove(oldChild);
}
+ if (refreshable != null && resetPendingNode.get()) {
+ resetPendingNode.set(false);
+ // Mark the refresh as done
+ refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.DONE);
+ // Reset the pending operation node
+ refreshable.setPendingOperationNode(null);
+ // Trigger a refresh of the view content.
+ ChangeEvent event = new ChangeEvent(model, IContainerModelNode.NOTIFY_CHANGED, null, null);
+ EventManager.getInstance().fireEvent(event);
+ }
+
// Invoke the callback
if (callback != null) callback.done(this, Status.OK_STATUS);
}

Back to the top