Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-06-23 13:58:19 -0400
committereutarass2011-06-23 13:58:19 -0400
commitd094f2cbb1a9a3d82d1409de6873857d3a362b76 (patch)
tree8dd7080e3b845fe0a609e0e2458790b3de4ea19e /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
parent0dca60bde34a25fef299272ffbcbed69eb8d56c7 (diff)
downloadorg.eclipse.tcf-d094f2cbb1a9a3d82d1409de6873857d3a362b76.tar.gz
org.eclipse.tcf-d094f2cbb1a9a3d82d1409de6873857d3a362b76.tar.xz
org.eclipse.tcf-d094f2cbb1a9a3d82d1409de6873857d3a362b76.zip
TCF Debugger: applied model proxy patch from Bug 349998 that allows to avoid using SWT by using ITreeModelViewer and ITreeModelContentProvider interfaces.
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
index c73c8ceb2..953e4f8cb 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
@@ -15,7 +15,8 @@ import java.util.LinkedList;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
+import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget;
+import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
@@ -24,14 +25,12 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationCont
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
+import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch;
import org.eclipse.tm.tcf.protocol.Protocol;
@@ -184,7 +183,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
public void installed(Viewer viewer) {
super.installed(viewer);
- ((TreeModelViewer)viewer).addViewerUpdateListener(update_listener);
+ ((ITreeModelViewer)viewer).addViewerUpdateListener(update_listener);
Protocol.invokeAndWait(new Runnable() {
public void run() {
assert !installed;
@@ -203,7 +202,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
disposed = true;
}
});
- ((TreeModelViewer)getViewer()).removeViewerUpdateListener(update_listener);
+ ((ITreeModelViewer)getViewer()).removeViewerUpdateListener(update_listener);
launch.removePendingClient(update_listener);
super.dispose();
}
@@ -219,12 +218,8 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
assert installed && !disposed;
if (flags == 0) return;
Integer delta = node2flags.get(node);
- if (delta != null) {
- node2flags.put(node, delta.intValue() | flags);
- }
- else {
- node2flags.put(node, flags);
- }
+ if (delta != null) flags |= delta.intValue();
+ node2flags.put(node, flags);
post();
}
@@ -382,13 +377,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
asyncExec(new Runnable() {
boolean found;
public void run() {
- Tree tree = (Tree)getViewer().getControl();
- for (TreeItem item : tree.getItems()) {
- if (item.getData() == launch) {
- found = true;
- break;
- }
- }
+ found = ((ITreeModelContentProviderTarget)getViewer()).findElementIndex(TreePath.EMPTY, launch) >= 0;
Protocol.invokeLater(new Runnable() {
public void run() {
if (found) realized = true;

Back to the top