Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Chen2012-06-05 02:59:44 +0000
committerWilliam Chen2012-06-05 02:59:44 +0000
commitdf86b6fec4ffbdb531785dd56925e06cad39c879 (patch)
tree6063f17243094d96e515139cf9748d6ffde50c46 /target_explorer
parent80f51a0ad2e09e4199ba4330a6f7f66339ced551 (diff)
downloadorg.eclipse.tcf-df86b6fec4ffbdb531785dd56925e06cad39c879.tar.gz
org.eclipse.tcf-df86b6fec4ffbdb531785dd56925e06cad39c879.tar.xz
org.eclipse.tcf-df86b6fec4ffbdb531785dd56925e06cad39c879.zip
Target Explorer: Refresh the first level children upon expanding a
directory.
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/CallbackMonitor.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/CallbackMonitor.java)6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSTreeNode.java49
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetChildren.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetContext.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshChildrenDoneOpenChannel.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetChildren.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetContext.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessModel.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessTreeNode.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.properties1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/controls/ProcessNavigatorContentProvider.java59
16 files changed, 120 insertions, 74 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/CallbackMonitor.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/CallbackMonitor.java
index bd71dccb2..506f45371 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/CallbackMonitor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/concurrent/CallbackMonitor.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.processes.core.callbacks;
+package org.eclipse.tcf.te.tcf.core.concurrent;
import java.util.ArrayList;
import java.util.Collections;
@@ -20,8 +20,8 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.processes.core.nls.Messages;
+import org.eclipse.tcf.te.tcf.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.core.nls.Messages;
/**
* A helper class used to synchronize multiple threads. It is used
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
index 3828f111f..74181e5ba 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
@@ -97,4 +97,5 @@ public class Messages extends NLS {
public static String AbstractExternalValueAdd_output;
public static String ValueAddLauncher_launch_command;
+ public static String CallbackMonitor_AllTasksFinished;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
index 16c948018..b0f1d8552 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
@@ -36,3 +36,4 @@ AbstractExternalValueAdd_error_invalidLocation=Invalid value-add location. Execu
AbstractExternalValueAdd_output=Output read from value-add: {0}. Target id = {1}
ValueAddLauncher_launch_command=Launch value-add with arguments: {0}. Target id = {1}. Value-add id = {2}
+CallbackMonitor_AllTasksFinished=All tasks are finished\!
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
index 0ff6cc759..cfe37bbf2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
@@ -29,7 +29,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
*/
public abstract class AbstractTreeNode extends PlatformObject implements IPeerModelProvider{
// The unique id of this node.
- private final UUID uniqueId = UUID.randomUUID();
+ protected final UUID uniqueId = UUID.randomUUID();
/**
* The tree node name.
@@ -305,4 +305,9 @@ public abstract class AbstractTreeNode extends PlatformObject implements IPeerMo
public List<? extends AbstractTreeNode> getChildren() {
return new ArrayList<AbstractTreeNode>(children);
}
+
+ /**
+ * Refresh the children's children.
+ */
+ public abstract void refreshChildren();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSTreeNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSTreeNode.java
index b7907244f..cebc1b7a6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSTreeNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSTreeNode.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.runtime.Assert;
@@ -37,6 +38,7 @@ import org.eclipse.tcf.services.IFileSystem.DirEntry;
import org.eclipse.tcf.services.IFileSystem.FileAttrs;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IWindowsFileAttributes;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.UserAccount;
@@ -618,6 +620,19 @@ public final class FSTreeNode extends AbstractTreeNode implements Cloneable {
return new QueryDoneOpenChannel(this, callback);
}
+ /**
+ * Override the queryChildren to refresh the second level children upon expanding.
+ */
+ @Override
+ public void queryChildren() {
+ queryChildren(new Callback(){
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ refreshChildren();
+ }
+ });
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.filesystem.core.model.AbstractTreeNode#getParent()
@@ -626,4 +641,38 @@ public final class FSTreeNode extends AbstractTreeNode implements Cloneable {
public FSTreeNode getParent() {
return (FSTreeNode) parent;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.filesystem.core.model.AbstractTreeNode#refreshChildren()
+ */
+ @Override
+ public void refreshChildren() {
+ List<FSTreeNode> children = getChildren();
+ if(!children.isEmpty()) {
+ ICallback callback = new Callback(){
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ queryDone();
+ }
+ };
+ final CallbackMonitor monitor = new CallbackMonitor(callback);
+ for(FSTreeNode child : children) {
+ if(child.isDirectory() && !child.childrenQueried && !child.childrenQueryRunning) {
+ monitor.lock(child.uniqueId);
+ }
+ }
+ for(FSTreeNode child : children) {
+ if(child.isDirectory() && !child.childrenQueried && !child.childrenQueryRunning) {
+ final UUID uuid = child.uniqueId;
+ child.queryChildren(new Callback(){
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ monitor.unlock(uuid, status);
+ }
+ });
+ }
+ }
+ }
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
index 733f0501d..c123f968c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
@@ -13,6 +13,9 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.ITreeViewerListener;
+import org.eclipse.jface.viewers.TreeExpansionEvent;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.tcf.te.tcf.filesystem.core.model.AbstractTreeNode;
import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
@@ -22,7 +25,7 @@ import org.eclipse.tcf.te.ui.trees.TreeContentProvider;
/**
* The base navigator content provider for File System and Process Monitor
*/
-public abstract class NavigatorContentProvider extends TreeContentProvider {
+public abstract class NavigatorContentProvider extends TreeContentProvider implements ITreeViewerListener {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
@@ -36,6 +39,49 @@ public abstract class NavigatorContentProvider extends TreeContentProvider {
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeViewerListener#treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent)
+ */
+ @Override
+ public void treeCollapsed(TreeExpansionEvent event) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeViewerListener#treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent)
+ */
+ @Override
+ public void treeExpanded(TreeExpansionEvent event) {
+ Object object = event.getElement();
+ if(object instanceof AbstractTreeNode) {
+ AbstractTreeNode parent = (AbstractTreeNode) object;
+ if (parent.childrenQueried && !parent.childrenQueryRunning) {
+ parent.refreshChildren();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ super.inputChanged(viewer, oldInput, newInput);
+ this.viewer.addTreeListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ this.viewer.removeTreeListener(this);
+ super.dispose();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetChildren.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetChildren.java
index 9dd16b50c..e0721592f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetChildren.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetChildren.java
@@ -16,6 +16,7 @@ import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetContext.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetContext.java
index abd5f4bb0..625eb80b2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/QueryDoneGetContext.java
@@ -20,6 +20,7 @@ import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcesses.ProcessContext;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshChildrenDoneOpenChannel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshChildrenDoneOpenChannel.java
index 15a0c2c32..d042613de 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshChildrenDoneOpenChannel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshChildrenDoneOpenChannel.java
@@ -22,6 +22,7 @@ import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetChildren.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetChildren.java
index 58c6cbca6..0b62f02dd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetChildren.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetChildren.java
@@ -21,6 +21,7 @@ import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetContext.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetContext.java
index eb477a74f..9a114bc21 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/callbacks/RefreshDoneGetContext.java
@@ -22,6 +22,7 @@ import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcesses.ProcessContext;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.tcf.core.concurrent.CallbackMonitor;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessModel.java
index 9f9f79417..cbd5cb4ff 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessModel.java
@@ -21,11 +21,9 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.core.interfaces.IViewerInput;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.processes.core.callbacks.RefreshChildrenDoneOpenChannel;
import org.eclipse.tcf.te.tcf.processes.core.nls.Messages;
/**
@@ -220,12 +218,5 @@ public class ProcessModel implements ITreeNodeModel{
public boolean isRefreshStopped() {
return stopped;
}
-
- /**
- * Refresh the children without refreshing itself.
- */
- public void refreshChildren(ProcessTreeNode node) {
- Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), null, new RefreshChildrenDoneOpenChannel(node));
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessTreeNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessTreeNode.java
index c9d38b57f..6615c45b8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessTreeNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ProcessTreeNode.java
@@ -20,9 +20,11 @@ import org.eclipse.tcf.services.IProcesses.ProcessContext;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel;
import org.eclipse.tcf.te.tcf.filesystem.core.model.AbstractTreeNode;
import org.eclipse.tcf.te.tcf.processes.core.callbacks.QueryDoneOpenChannel;
+import org.eclipse.tcf.te.tcf.processes.core.callbacks.RefreshChildrenDoneOpenChannel;
import org.eclipse.tcf.te.tcf.processes.core.callbacks.RefreshDoneOpenChannel;
/**
@@ -258,4 +260,9 @@ public final class ProcessTreeNode extends AbstractTreeNode {
public ProcessTreeNode getParent() {
return (ProcessTreeNode) parent;
}
+
+ @Override
+ public void refreshChildren() {
+ Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new RefreshChildrenDoneOpenChannel(this));
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.java
index a82ac3d8e..f5990ca43 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.java
@@ -47,7 +47,6 @@ public class Messages extends NLS {
public static String ProcessStreamWriterRunnable_error_writeFailed;
public static String ProcessStreamReaderRunnable_error_appendFailed;
- public static String CallbackMonitor_AllTasksFinished;
public static String PendingOperation_label;
public static String ProcessLabelProvider_RootNodeLabel;
public static String AttachStep_error_connect;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.properties
index 3f90dc6ac..6385a5d2e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/nls/Messages.properties
@@ -25,7 +25,6 @@ ProcessLauncher_cause_ioexception=An IOException occurred.
ProcessStreamReaderRunnable_error_readFailed=Failed to read data from stream with id ''{0}''.\n\nPossible Cause:\n{1}
ProcessStreamWriterRunnable_error_writeFailed=Failed to write data to stream with id ''{0}''.\n\nPossible Cause:\n{1}
ProcessStreamReaderRunnable_error_appendFailed=Failed to append data from stream with id ''{0}'' to data receiver.\n\nLost data:\n{1}.
-CallbackMonitor_AllTasksFinished=All tasks are finished\!
PendingOperation_label=Pending...
ProcessLabelProvider_RootNodeLabel=Processes
AttachStep_error_connect=Failed to attach to context: {0}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/controls/ProcessNavigatorContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/controls/ProcessNavigatorContentProvider.java
index 3017c544c..80633075c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/controls/ProcessNavigatorContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/controls/ProcessNavigatorContentProvider.java
@@ -10,15 +10,11 @@
package org.eclipse.tcf.te.tcf.processes.ui.controls;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
import org.eclipse.tcf.te.tcf.filesystem.ui.controls.NavigatorContentProvider;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.processes.core.model.ProcessModel;
-import org.eclipse.tcf.te.tcf.processes.core.model.ProcessTreeNode;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.navigator.NavigatorFilterService;
@@ -32,33 +28,12 @@ import org.eclipse.ui.navigator.INavigatorFilterService;
* Processes content provider for the common navigator of Target Explorer.
*/
@SuppressWarnings("restriction")
-public class ProcessNavigatorContentProvider extends NavigatorContentProvider implements ICommonContentProvider, ITreeViewerListener {
+public class ProcessNavigatorContentProvider extends NavigatorContentProvider implements ICommonContentProvider {
// The "Single Thread" filter id
private final static String SINGLE_THREAD_FILTER_ID = "org.eclipse.tcf.te.tcf.processes.ui.navigator.filter.singleThread"; //$NON-NLS-1$
/*
* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- this.viewer.addTreeListener(this);
- refreshChildren(newInput);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#dispose()
- */
- @Override
- public void dispose() {
- super.dispose();
- this.viewer.removeTreeListener(this);
- }
-
- /*
- * (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.filesystem.ui.controls.NavigatorContentProvider#doGetModel(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
*/
@Override
@@ -103,36 +78,4 @@ public class ProcessNavigatorContentProvider extends NavigatorContentProvider i
@Override
public void saveState(IMemento aMemento) {
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- @Override
- public void treeCollapsed(TreeExpansionEvent event) {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- @Override
- public void treeExpanded(TreeExpansionEvent event) {
- Object element = event.getElement();
- refreshChildren(element);
- }
-
- /**
- * Refresh the element's children if it is a process node and its children has
- * already been queried.
- */
- private void refreshChildren(Object object) {
- if(object instanceof ProcessTreeNode) {
- ProcessTreeNode parent = (ProcessTreeNode) object;
- if (parent.childrenQueried && !parent.childrenQueryRunning) {
- ProcessModel pModel = ProcessModel.getProcessModel(parent.peerNode);
- pModel.refreshChildren(parent);
- }
- }
- }
}

Back to the top