Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-10-17 13:58:35 +0000
committerUwe Stieber2013-10-17 13:58:35 +0000
commit00f7c65d9fa10c845b5ca8a48e734f04514191e4 (patch)
treecca12c9b26b8b8857141ab621c4a35cd8dda1dc2 /target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src
parentc2ac8b11f40f1f28ab4154a3fb5a59730d1f849d (diff)
downloadorg.eclipse.tcf-00f7c65d9fa10c845b5ca8a48e734f04514191e4.tar.gz
org.eclipse.tcf-00f7c65d9fa10c845b5ca8a48e734f04514191e4.tar.xz
org.eclipse.tcf-00f7c65d9fa10c845b5ca8a48e734f04514191e4.zip
Target Explorer: Fix auto-refresh in system monitor has no effect
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
index 2fc0f8d2a..97c28eeb1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java
@@ -52,7 +52,7 @@ public class ContentProvider implements ITreeContentProvider {
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
@Override
- public Object[] getChildren(Object parentElement) {
+ public Object[] getChildren(final Object parentElement) {
Object[] children = NO_ELEMENTS;
// If the parent element is a peer model node, than return
@@ -104,7 +104,7 @@ public class ContentProvider implements ITreeContentProvider {
// Return the pending operation node
return new Object[] { refreshable.getPendingOperationNode() };
}
- else if (refreshable.getQueryState(QueryType.CHILD_LIST).equals(QueryState.IN_PROGRESS)) {
+ else if (refreshable.getQueryState(QueryType.CHILD_LIST).equals(QueryState.IN_PROGRESS) && ((IRuntimeModel)parentElement).getAutoRefreshInterval() == 0) {
// Refresh is still running -> return the pending operation node (if set)
return refreshable.getPendingOperationNode() != null ? new Object[] { refreshable.getPendingOperationNode() } : NO_ELEMENTS;
}
@@ -160,8 +160,20 @@ public class ContentProvider implements ITreeContentProvider {
return new Object[] { refreshable.getPendingOperationNode() };
}
else if (refreshable.getQueryState(QueryType.CHILD_LIST).equals(QueryState.IN_PROGRESS)) {
- // Refresh is still running -> return the pending operation node (if set)
- return refreshable.getPendingOperationNode() != null ? new Object[] { refreshable.getPendingOperationNode() } : NO_ELEMENTS;
+ final AtomicReference<IRuntimeModel> model = new AtomicReference<IRuntimeModel>();
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ model.set(((IProcessContextNode)parentElement).getParent(IRuntimeModel.class));
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ if (model.get() == null || model.get().getAutoRefreshInterval() == 0) {
+ // Refresh is still running -> return the pending operation node (if set)
+ return refreshable.getPendingOperationNode() != null ? new Object[] { refreshable.getPendingOperationNode() } : NO_ELEMENTS;
+ }
}
}

Back to the top