Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-10-25 17:20:35 +0000
committerEugene Tarassov2011-10-25 17:20:35 +0000
commit8144824869be5784978ab5739b59c83cdad68614 (patch)
treec88a818461a5e2834e36d6a52c1a88b1cb8b0840 /plugins
parent9c7aeedb79f79a4d7b70bfe91b3e2abfcebd6a74 (diff)
downloadorg.eclipse.tcf-8144824869be5784978ab5739b59c83cdad68614.tar.gz
org.eclipse.tcf-8144824869be5784978ab5739b59c83cdad68614.tar.xz
org.eclipse.tcf-8144824869be5784978ab5739b59c83cdad68614.zip
TCF Debugger: implemented Update Policy menu in debug views.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/icons/refresh.gifbin0 -> 368 bytes
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/plugin.xml206
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/ManualRefreshCommand.java78
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/RefreshHandler.java48
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java113
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFPropertyTester.java21
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFSnapshot.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java5
10 files changed, 375 insertions, 108 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/icons/refresh.gif b/plugins/org.eclipse.tm.tcf.debug.ui/icons/refresh.gif
new file mode 100644
index 000000000..049cac696
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/icons/refresh.gif
Binary files differ
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
index 719aa1252..99651388b 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
@@ -19,12 +19,14 @@ debugBreakpointInstance = Breakpoint
DebuggerActionSet.label = TCF Debugger
+commands.category.name = TCF Debugger
+commands.category.desc = TCF Debugger Commands
+
Signals.label = Signals...
MemoryMap.label = Symbol Files...
ViewMemory.label = View Memory
WatchInExpressions.label = Watch In Expressions
Refresh.label = Refresh
-ManualRefresh.label = Manual Refresh
CastToType.label=Cast To Type...
CastToType.tooltip=Cast Expression To Type
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.xml b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.xml
index 20c8c9940..b6c6de4fe 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.xml
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?><!--
- Copyright (c) 2010 Wind River Systems, Inc. and others.
+<?eclipse version="3.2"?>
+<!--
+ Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -63,7 +64,7 @@
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
namespace="org.eclipse.tm.tcf.launch"
- properties="isExecutable"
+ properties="isExecutable,areUpdatePoliciesSupported"
type="org.eclipse.core.runtime.IAdaptable"
class="org.eclipse.tm.internal.tcf.debug.ui.launch.TCFPropertyTester"
id="org.eclipse.tm.tcf.launch.PropertyTester">
@@ -229,6 +230,12 @@
icon="icons/signals.gif"
label="%Signals.label"
menubarPath="additions">
+ <enablement>
+ <pluginState
+ value="activated"
+ id="org.eclipse.tm.tcf.debug.ui">
+ </pluginState>
+ </enablement>
</action>
</objectContribution>
@@ -265,6 +272,7 @@
<action
id="org.eclipse.tm.tcf.debug.ui.actions.Refresh"
class="org.eclipse.tm.internal.tcf.debug.ui.commands.RefreshCommand"
+ icon="icons/refresh.gif"
label="%Refresh.label"
menubarPath="additions">
<enablement>
@@ -274,19 +282,6 @@
</pluginState>
</enablement>
</action>
- <action
- class="org.eclipse.tm.internal.tcf.debug.ui.commands.ManualRefreshCommand"
- id="org.eclipse.tm.tcf.debug.ui.actions.ManualRefresh"
- label="%ManualRefresh.label"
- menubarPath="additions"
- style="toggle">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.tm.tcf.debug.ui">
- </pluginState>
- </enablement>
- </action>
</objectContribution>
<!-- TCFNodeExpression popup menu contributions -->
@@ -380,6 +375,183 @@
</extension>
<extension
+ point="org.eclipse.ui.commands">
+ <category
+ name="%commands.category.name"
+ description="%commands.category.desc"
+ id="org.eclipse.tm.tcf.debug.ui.commands">
+ </category>
+ <command
+ categoryId="org.eclipse.tm.tcf.debug.ui.commands"
+ defaultHandler="org.eclipse.tm.internal.tcf.debug.ui.commands.RefreshHandler"
+ id="org.eclipse.tm.tcf.debug.ui.commands.refresh"
+ name="%Refresh.label"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.tm.internal.tcf.debug.ui.commands.RefreshHandler"
+ commandId="org.eclipse.ui.file.refresh">
+ <activeWhen>
+ <and>
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ <with variable="activePart">
+ <test property="org.eclipse.tm.tcf.launch.areUpdatePoliciesSupported"/>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.menus">
+ <!-- Registers View -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.debug.ui.RegisterView?after=additions">
+ <command
+ commandId="org.eclipse.tm.tcf.debug.ui.commands.refresh"
+ icon="icons/refresh.gif"
+ id="org.eclipse.tm.tcf.debug.ui.commands.refresh.registers"
+ label="%Refresh.label"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:org.eclipse.debug.ui.RegisterView?after=additions">
+ <menu
+ label="%UpdatePolicy.label"
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.registers">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ <dynamic
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.registers.menu"
+ class="org.eclipse.tm.internal.tcf.debug.ui.commands.UpdatePolicyMenu"/>
+ </menu>
+ </menuContribution>
+ <!-- Variables View -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.debug.ui.VariableView?after=additions">
+ <command
+ commandId="org.eclipse.tm.tcf.debug.ui.commands.refresh"
+ icon="icons/refresh.gif"
+ id="org.eclipse.tm.tcf.debug.ui.commands.refresh.variables"
+ label="%Refresh.label"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:org.eclipse.debug.ui.VariableView?after=additions">
+ <menu
+ label="%UpdatePolicy.label"
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.variables">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ <dynamic
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.variables.menu"
+ class="org.eclipse.tm.internal.tcf.debug.ui.commands.UpdatePolicyMenu"/>
+ </menu>
+ </menuContribution>
+ <!-- Expressions View -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.debug.ui.ExpressionView?after=additions">
+ <command
+ commandId="org.eclipse.tm.tcf.debug.ui.commands.refresh"
+ icon="icons/refresh.gif"
+ id="org.eclipse.tm.tcf.debug.ui.commands.refresh.expressions"
+ label="%Refresh.label"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:org.eclipse.debug.ui.ExpressionView?after=additions">
+ <menu
+ label="%UpdatePolicy.label"
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.expressions">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ <dynamic
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.expressions.menu"
+ class="org.eclipse.tm.internal.tcf.debug.ui.commands.UpdatePolicyMenu"/>
+ </menu>
+ </menuContribution>
+ <!-- Modules View -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.debug.ui.ModuleView?after=additions">
+ <command
+ commandId="org.eclipse.tm.tcf.debug.ui.commands.refresh"
+ icon="icons/refresh.gif"
+ id="org.eclipse.tm.tcf.debug.ui.commands.refresh.modules"
+ label="%Refresh.label"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:org.eclipse.debug.ui.ModuleView?after=additions">
+ <menu
+ label="%UpdatePolicy.label"
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.modules">
+ <visibleWhen checkEnabled="false">
+ <with variable="activeContexts">
+ <iterate ifEmpty="false" operator="or">
+ <equals value="org.eclipse.tm.tcf.debug.ui.debugging"/>
+ </iterate>
+ </with>
+ </visibleWhen>
+ <dynamic
+ id="org.eclipse.tm.tcf.debug.ui.commands.update.policy.modules.menu"
+ class="org.eclipse.tm.internal.tcf.debug.ui.commands.UpdatePolicyMenu"/>
+ </menu>
+ </menuContribution>
+ </extension>
+
+ <extension
point="org.eclipse.debug.ui.memoryRenderings">
<renderingBindings
defaultIds="org.eclipse.debug.ui.rendering.raw_memory"
@@ -419,6 +591,6 @@
</extension>
<extension point="org.eclipse.core.runtime.preferences">
- <initializer class="org.eclipse.tm.internal.tcf.debug.ui.preferences.TCFPreferencesInitializer"/>
+ <initializer class="org.eclipse.tm.internal.tcf.debug.ui.preferences.TCFPreferencesInitializer"/>
</extension>
</plugin>
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/ManualRefreshCommand.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/ManualRefreshCommand.java
deleted file mode 100644
index 6de94ebe3..000000000
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/ManualRefreshCommand.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tm.internal.tcf.debug.ui.commands;
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
-import org.eclipse.tm.tcf.util.TCFTask;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-public class ManualRefreshCommand extends AbstractActionDelegate {
-
- // TODO: Automatic, Manual, Breakpoint Hit
- // org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/messages.properties
- // No update policies for current selection
-
- @Override
- protected void selectionChanged() {
- final IAction action = getAction();
- final TCFNode node = getRootNode();
- if (node == null) {
- action.setEnabled(false);
- action.setChecked(false);
- }
- else {
- new TCFTask<Object>(node.getChannel()) {
- public void run() {
- IViewPart part = getView();
- action.setEnabled(true);
- action.setChecked(node.getModel().isLocked(part));
- done(null);
- }
- }.getE();
- }
- }
-
- @Override
- protected void run() {
- final TCFNode node = getRootNode();
- if (node == null) return;
- new TCFTask<Object>(node.getChannel()) {
- public void run() {
- IViewPart part = getView();
- if (getAction().isChecked()) {
- node.getModel().setLock(part);
- }
- else {
- node.getModel().clearLock(part);
- }
- done(null);
- }
- }.getE();
- }
-
- private TCFNode getRootNode() {
- IViewPart view = getView();
- if (view == null) return null;
- IWorkbenchPartSite site = view.getSite();
- if (site == null || IDebugUIConstants.ID_DEBUG_VIEW.equals(site.getId())) {
- return null;
- }
- if (view instanceof IDebugView) {
- Object input = ((IDebugView)view).getViewer().getInput();
- if (input instanceof TCFNode) return (TCFNode)input;
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/RefreshHandler.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/RefreshHandler.java
new file mode 100644
index 000000000..389e06b97
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/RefreshHandler.java
@@ -0,0 +1,48 @@
+package org.eclipse.tm.internal.tcf.debug.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
+import org.eclipse.tm.tcf.util.TCFTask;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RefreshHandler extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Object input = null;
+ final IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ if (part instanceof IDebugView) {
+ IWorkbenchPartSite site = part.getSite();
+ if (site != null && IDebugUIConstants.ID_DEBUG_VIEW.equals(site.getId())) {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection)selection).getFirstElement();
+ if (obj instanceof TCFNode) input = ((TCFNode)obj).getModel().getRootNode();
+ }
+ }
+ else {
+ input = ((IDebugView)part).getViewer().getInput();
+ }
+ }
+ if (input instanceof TCFNode) {
+ final TCFNode node = (TCFNode)input;
+ return new TCFTask<Object>(node.getChannel()) {
+ public void run() {
+ node.refresh(part);
+ if (node.getModel().clearLock(part)) {
+ node.getModel().setLock(part);
+ }
+ done(null);
+ }
+ }.getE();
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java
new file mode 100644
index 000000000..a574ce990
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java
@@ -0,0 +1,113 @@
+package org.eclipse.tm.internal.tcf.debug.ui.commands;
+
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.IDebugView;
+import org.eclipse.jface.action.ContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
+import org.eclipse.tm.tcf.util.TCFTask;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+
+public class UpdatePolicyMenu extends CompoundContributionItem {
+
+ private static final String[] policy_names = {
+ "Automatic",
+ "Manual",
+ //"Breakpoint Hit",
+ };
+
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ IContributionItem[] items = new IContributionItem[policy_names.length];
+ for (int i = 0; i < items.length; i++) {
+ final int n = i;
+ items[i] = new ContributionItem() {
+ @Override
+ public void fill(final Menu menu, int index) {
+ final MenuItem item = new MenuItem(menu, SWT.RADIO);
+ item.setText(policy_names[n]);
+ final MenuListener menu_listener = new MenuListener() {
+ public void menuShown(MenuEvent e) {
+ item.setSelection(getPolicy() == n);
+ }
+ public void menuHidden(MenuEvent e) {
+ }
+ };
+ menu.addMenuListener(menu_listener);
+ item.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ menu.removeMenuListener(menu_listener);
+ }
+ });
+ item.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ if (item.getSelection()) setPolicy(n);
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+ };
+ }
+ return items;
+ }
+
+ private IWorkbenchPart getPart() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
+ }
+
+ private TCFNode getRootNode(IWorkbenchPart part) {
+ IWorkbenchPartSite site = part.getSite();
+ if (site == null || IDebugUIConstants.ID_DEBUG_VIEW.equals(site.getId())) {
+ return null;
+ }
+ if (part instanceof IDebugView) {
+ Object input = ((IDebugView)part).getViewer().getInput();
+ if (input instanceof TCFNode) return (TCFNode)input;
+ }
+ return null;
+ }
+
+ private int getPolicy() {
+ final IWorkbenchPart part = getPart();
+ if (part == null) return 0;
+ final TCFNode node = getRootNode(part);
+ if (node == null) return 0;
+ return new TCFTask<Integer>(node.getChannel()) {
+ public void run() {
+ if (!node.getModel().isLocked(part)) done(0);
+ else done(1);
+ }
+ }.getE();
+ }
+
+ private void setPolicy(final int n) {
+ final IWorkbenchPart part = getPart();
+ if (part == null) return;
+ final TCFNode node = getRootNode(part);
+ if (node == null) return;
+ new TCFTask<Object>(node.getChannel()) {
+ public void run() {
+ if (n == 0) {
+ node.getModel().clearLock(part);
+ }
+ else {
+ node.getModel().setLock(part);
+ }
+ done(null);
+ }
+ }.getE();
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFPropertyTester.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFPropertyTester.java
index 3b5196540..c70096067 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFPropertyTester.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFPropertyTester.java
@@ -14,23 +14,32 @@ import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.ui.IDebugView;
import org.eclipse.tm.internal.tcf.debug.ui.Activator;
public class TCFPropertyTester extends PropertyTester {
public boolean test(Object receiver, String property, Object[] args, Object expected_value) {
+ if (property.equals("areUpdatePoliciesSupported")) return testUpdatePoliciesSupported(receiver);
+ if (property.equals("isExecutable")) return testIsExecutable(receiver, expected_value);
+ return false;
+ }
+
+ private boolean testUpdatePoliciesSupported(Object receiver) {
+ return receiver instanceof IDebugView;
+ }
+
+ private boolean testIsExecutable(Object receiver, Object expected_value) {
Object value = null;
try {
if (receiver instanceof IAdaptable) {
IAdaptable selection = (IAdaptable)receiver;
ITCFLaunchContext context = TCFLaunchContext.getLaunchContext(selection);
if (context != null) {
- if (property.equals("isExecutable")) {
- IProject project = context.getProject(selection);
- IPath path = context.getPath(selection);
- if (project != null && path != null) {
- value = context.isBinary(project, path);
- }
+ IProject project = context.getProject(selection);
+ IPath path = context.getPath(selection);
+ if (project != null && path != null) {
+ value = context.isBinary(project, path);
}
}
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
index cf0f37574..fec9f971a 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
@@ -27,7 +27,7 @@ import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.tm.tcf.util.TCFDataCache;
-import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
/**
* TCFNode is base class for all TCF debug model elements.
@@ -450,7 +450,7 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
/*--------------------------------------------------------------------------------------*/
/* Misc */
- public void refresh(IViewPart view) {
+ public void refresh(IWorkbenchPart view) {
model.flushAllCaches();
for (TCFModelProxy p : model.getModelProxies()) {
if (p.getPresentationContext().getPart() != view) continue;
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFSnapshot.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFSnapshot.java
index 8ff410544..6963716ec 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFSnapshot.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFSnapshot.java
@@ -40,6 +40,8 @@ class TCFSnapshot {
private final String[] columns;
private final RGB rgb_stalled = new RGB(128, 128, 128);
+ private boolean ignore_bg_color = true;
+
private class PresentationData implements IChildrenCountUpdate, IChildrenUpdate, ILabelUpdate, Runnable {
IViewerUpdate update;
@@ -300,7 +302,7 @@ class TCFSnapshot {
}
}
}
- if (data.bg_color != null) {
+ if (!ignore_bg_color && data.bg_color != null) {
for (int i = 0; i < data.bg_color.length; i++) {
if (data.bg_color[i] != null) update.setBackground(data.bg_color[i], i);
}
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
index 6817d036e..885b8b18f 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
@@ -148,12 +148,10 @@ public class TCFLaunch extends Launch {
private final IStreams.StreamsListener streams_listener = new IStreams.StreamsListener() {
public void created(String stream_type, String stream_id, String context_id) {
+ stream_ids.put(stream_id, context_id);
if (process_start_command == null) {
disconnectStream(stream_id);
}
- else {
- stream_ids.put(stream_id, context_id);
- }
}
public void disposed(String stream_type, String stream_id) {
@@ -860,6 +858,7 @@ public class TCFLaunch extends Launch {
}
private void disconnectStream(String id) {
+ assert stream_ids.get(id) != null;
stream_ids.remove(id);
if (channel.getState() != IChannel.STATE_OPEN) return;
IStreams streams = getService(IStreams.class);

Back to the top