Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.cdt.ui')
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml26
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java68
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java83
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFThreadFilterEditor.java402
5 files changed, 580 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.properties b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.properties
index f152f3e65..e606504da 100644
--- a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.properties
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.properties
@@ -11,6 +11,7 @@
pluginName = TCF/CDT Integration UI (Incubation)
providerName = Eclipse.org - DSDP
+breakpoints.filterPage.name = Scope
launchConfigType.remoteApplication.name=TCF Remote Application
launchTab.main.name=Main
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
index 837e2d741..8025f0fa0 100644
--- a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
@@ -77,6 +77,32 @@
debugModelId="org.eclipse.tm.tcf.debug">
</modelContextBinding>
</extension>
+
+ <extension
+ point="org.eclipse.cdt.debug.core.BreakpointExtension">
+ <breakpointExtension
+ class="org.eclipse.tm.internal.tcf.cdt.ui.breakpoints.TCFBreakpointScopeExtension"
+ debugModelId="org.eclipse.tm.tcf.debug"
+ id="org.eclipse.tm.tcf.cdt.ui.breakpointExtension"
+ markerType="org.eclipse.cdt.debug.core.cBreakpointMarker">
+ </breakpointExtension>
+ </extension>
+
+ <extension point="org.eclipse.ui.propertyPages">
+ <page class="org.eclipse.tm.internal.tcf.cdt.ui.breakpoints.TCFBreakpointThreadFilterPage"
+ id="org.eclipse.tm.tcf.breakpoint.filtering"
+ name="%breakpoints.filterPage.name">
+ <filter name="debugModelId" value="org.eclipse.tm.tcf.debug"/>
+ <enabledWhen>
+ <and>
+ <adapt type="org.eclipse.cdt.debug.core.model.ICBreakpoint"/>
+ <not>
+ <adapt type="org.eclipse.cdt.debug.core.model.ICTracepoint"/>
+ </not>
+ </and>
+ </enabledWhen>
+ </page>
+ </extension>
<!-- Remote Application Launch config type -->
<!-- TODO: Move to common CDT plugin? -->
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
new file mode 100644
index 000000000..34e4617b6
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.cdt.ui.breakpoints;
+
+import org.eclipse.cdt.debug.core.model.ICBreakpoint;
+import org.eclipse.cdt.debug.core.model.ICBreakpointExtension;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.tm.internal.tcf.cdt.ui.Activator;
+import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants;
+import org.eclipse.tm.tcf.services.IBreakpoints;
+
+public class TCFBreakpointScopeExtension implements ICBreakpointExtension {
+
+ private static final String ATTR_CONTEXT_IDS = ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_CONTEXTIDS;
+
+ private String[] fContextIds;
+ private ICBreakpoint fBreakpoint;
+
+ public void initialize(ICBreakpoint breakpoint) throws CoreException {
+ fBreakpoint = breakpoint;
+ IMarker m = breakpoint.getMarker();
+ if (m != null && m.exists()) {
+ String contextIdAttr = m.getAttribute(ATTR_CONTEXT_IDS, null);
+ if (contextIdAttr != null) {
+ fContextIds = contextIdAttr.split(",\\s*");
+ }
+ }
+ }
+
+ public void setThreadFilter(String[] threadIds) {
+ fContextIds = threadIds;
+ if (fBreakpoint == null) {
+ return;
+ }
+ IMarker m = fBreakpoint.getMarker();
+ if (m == null || !m.exists()) {
+ return;
+ }
+ String contextIdAttr = null;
+ if (threadIds != null) {
+ StringBuilder buf = new StringBuilder();
+ for (String id : threadIds) {
+ buf.append(id).append(',');
+ }
+ contextIdAttr = buf.toString();
+ }
+ try {
+ m.setAttribute(ATTR_CONTEXT_IDS, contextIdAttr);
+ }
+ catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+
+ public String[] getThreadFilters() {
+ return fContextIds;
+ }
+
+}
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java
new file mode 100644
index 000000000..fe0506fe1
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 QNX Software Systems 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:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems - Adapted to TCF
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.cdt.ui.breakpoints;
+
+import org.eclipse.cdt.debug.core.model.ICBreakpoint;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.tm.internal.tcf.debug.model.ITCFConstants;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * Property page to define the scope of a breakpoint.
+ */
+public class TCFBreakpointThreadFilterPage extends PropertyPage {
+
+ private TCFThreadFilterEditor fThreadFilterEditor;
+
+ @Override
+ protected Control createContents(Composite parent) {
+ noDefaultAndApplyButton();
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ mainComposite.setFont(parent.getFont());
+ mainComposite.setLayout(new GridLayout());
+ mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ createThreadFilterEditor(mainComposite);
+ setValid(true);
+ return mainComposite;
+ }
+
+ protected ICBreakpoint getBreakpoint() {
+ return (ICBreakpoint) getElement().getAdapter(ICBreakpoint.class);
+ }
+
+ protected TCFBreakpointScopeExtension getFilterExtension() {
+ ICBreakpoint bp = getBreakpoint();
+ if (bp != null) {
+ try {
+ TCFBreakpointScopeExtension filter =
+ (TCFBreakpointScopeExtension) bp.getExtension(
+ ITCFConstants.ID_TCF_DEBUG_MODEL, TCFBreakpointScopeExtension.class);
+ filter.initialize(bp);
+ return filter;
+ } catch (CoreException e) {
+ // potential race condition: ignore
+ }
+ }
+ return null;
+ }
+
+ protected void createThreadFilterEditor(Composite parent) {
+ fThreadFilterEditor = new TCFThreadFilterEditor(parent, this);
+ }
+
+ protected TCFThreadFilterEditor getThreadFilterEditor() {
+ return fThreadFilterEditor;
+ }
+
+ @Override
+ public boolean performOk() {
+ doStore();
+ return super.performOk();
+ }
+
+ /**
+ * Stores the values configured in this page.
+ */
+ protected void doStore() {
+ fThreadFilterEditor.doStore();
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFThreadFilterEditor.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFThreadFilterEditor.java
new file mode 100644
index 000000000..9c7659822
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/breakpoints/TCFThreadFilterEditor.java
@@ -0,0 +1,402 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 QNX Software Systems 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:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems - Adapted to TCF
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.cdt.ui.breakpoints;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFChildren;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFModel;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFModelManager;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeExecContext;
+import org.eclipse.tm.tcf.services.IRunControl;
+import org.eclipse.tm.tcf.util.TCFDataCache;
+import org.eclipse.tm.tcf.util.TCFTask;
+
+public class TCFThreadFilterEditor {
+
+ private static class Context {
+ private final String fName;
+ private final String fId;
+ private final String fParentId;
+ private final boolean fIsContainer;
+
+ Context(IRunControl.RunControlContext ctx) {
+ fName = ctx.getName() != null ? ctx.getName() : ctx.getID();
+ fId = ctx.getID();
+ fParentId = ctx.getParentID();
+ fIsContainer = ctx.isContainer();
+ }
+ }
+
+ public class CheckHandler implements ICheckStateListener {
+
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ Object element = event.getElement();
+ if (element instanceof Context) {
+ Context ctx = (Context) element;
+ getThreadViewer().expandToLevel(ctx, 1);
+ checkContext(ctx, event.getChecked());
+ updateParentCheckState(ctx);
+ }
+ }
+
+ /**
+ * Check or uncheck a context in the tree viewer. When a container
+ * is checked, attempt to check all of the containers threads by
+ * default. When a container is unchecked, uncheck all its threads.
+ */
+ protected void checkContext(Context ctx, boolean checked) {
+ if (ctx.fIsContainer) {
+ Context[] threads = syncGetThreads(ctx);
+ for (int i = 0; i < threads.length; i++) {
+ checkContext(threads[i], checked);
+ }
+ }
+ checkThread(ctx, checked);
+ }
+
+ /**
+ * Check or uncheck a thread.
+ */
+ protected void checkThread(Context thread, boolean checked) {
+ getThreadViewer().setChecked(thread, checked);
+ getThreadViewer().setGrayed(thread, false);
+ }
+
+ protected void updateParentCheckState(Context thread) {
+ Context parent = getContainer(thread);
+ if (parent == null) {
+ return;
+ }
+ Context[] threads = syncGetThreads(parent);
+ int checkedNumber = 0;
+ int grayedNumber = 0;
+ for (int i = 0; i < threads.length; i++) {
+ if (getThreadViewer().getGrayed(threads[i])) {
+ ++grayedNumber;
+ } else if (getThreadViewer().getChecked(threads[i])) {
+ ++checkedNumber;
+ }
+ }
+ if (checkedNumber + grayedNumber == 0) {
+ getThreadViewer().setChecked(parent, false);
+ getThreadViewer().setGrayed(parent, false);
+ } else if (checkedNumber == threads.length) {
+ getThreadViewer().setChecked(parent, true);
+ getThreadViewer().setGrayed(parent, false);
+ } else {
+ getThreadViewer().setGrayChecked(parent, true);
+ }
+ updateParentCheckState(parent);
+ }
+ }
+
+ public class ThreadFilterContentProvider implements ITreeContentProvider {
+
+ public Object[] getChildren(Object parent) {
+ if (parent instanceof Context) {
+ return syncGetThreads((Context) parent);
+ }
+
+ if (parent instanceof ILaunchManager) {
+ List<Object> children = new ArrayList<Object>();
+ ILaunch[] launches = ((ILaunchManager) parent).getLaunches();
+ Context[] targetArray;
+ for (int i = 0; i < launches.length; i++) {
+ if (launches[i] instanceof TCFLaunch) {
+ targetArray = syncGetContainers((TCFLaunch) launches[i]);
+ children.addAll(Arrays.asList(targetArray));
+ }
+ }
+ return children.toArray();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof Context) {
+ Context ctx = (Context) element;
+ if (ctx.fParentId == null) {
+ return DebugPlugin.getDefault().getLaunchManager();
+ } else {
+ return getContainer(ctx);
+ }
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ }
+
+ public class ThreadFilterLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof Context) {
+ Context ctx = (Context) element;
+ if (ctx.fIsContainer) {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET);
+ } else {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Context) {
+ Context ctx = (Context) element;
+ return ctx.fName;
+ }
+ return "?";
+ }
+ }
+
+
+ private TCFBreakpointThreadFilterPage fPage;
+ private CheckboxTreeViewer fThreadViewer;
+ private final ThreadFilterContentProvider fContentProvider;
+ private final CheckHandler fCheckHandler;
+ private final List<Context> fContexts = new ArrayList<Context>();
+ private final Map<TCFLaunch, Context[]> fContainersPerLaunch = new HashMap<TCFLaunch, Context[]>();
+ private final Map<Context, Context[]> fContextsPerContainer = new HashMap<Context, Context[]>();
+
+ public TCFThreadFilterEditor(Composite parent, TCFBreakpointThreadFilterPage page) {
+ fPage = page;
+ fContentProvider = new ThreadFilterContentProvider();
+ fCheckHandler = new CheckHandler();
+ createThreadViewer(parent);
+ }
+
+ protected TCFBreakpointThreadFilterPage getPage() {
+ return fPage;
+ }
+
+ private void createThreadViewer(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Restrict to Selected Contexts:"); //$NON-NLS-1$
+ label.setFont(parent.getFont());
+ label.setLayoutData(new GridData());
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 100;
+ fThreadViewer = new CheckboxTreeViewer(parent, SWT.BORDER);
+ fThreadViewer.addCheckStateListener(fCheckHandler);
+ fThreadViewer.getTree().setLayoutData(data);
+ fThreadViewer.getTree().setFont(parent.getFont());
+ fThreadViewer.setContentProvider(fContentProvider);
+ fThreadViewer.setLabelProvider(new ThreadFilterLabelProvider());
+ fThreadViewer.setInput(DebugPlugin.getDefault().getLaunchManager());
+ setInitialCheckedState();
+ }
+
+ /**
+ * Returns the root contexts that appear in the tree
+ */
+ protected Context[] getRootContexts() {
+ Object input = fThreadViewer.getInput();
+ if (!(input instanceof ILaunchManager)) {
+ return new Context[0];
+ }
+ List<Object> targets = new ArrayList<Object>();
+ ILaunch[] launches = ((ILaunchManager) input).getLaunches();
+ for (int i = 0; i < launches.length; i++) {
+ if (launches[i] instanceof TCFLaunch) {
+ Context[] targetArray = syncGetContainers((TCFLaunch) launches[i]);
+ targets.addAll(Arrays.asList(targetArray));
+ }
+ }
+ return targets.toArray(new Context[targets.size()]);
+ }
+
+ protected final CheckboxTreeViewer getThreadViewer() {
+ return fThreadViewer;
+ }
+
+ /**
+ * Sets the initial checked state of the tree viewer. The initial state
+ * should reflect the current state of the breakpoint. If the breakpoint has
+ * a thread filter in a given thread, that thread should be checked.
+ */
+ protected void setInitialCheckedState() {
+ TCFBreakpointScopeExtension filterExtension = fPage.getFilterExtension();
+ if (filterExtension == null) {
+ return;
+ }
+ String[] ctxIds = filterExtension.getThreadFilters();
+
+ if (ctxIds == null) {
+ Context[] contexts = getRootContexts();
+ for (Context context : contexts) {
+ fCheckHandler.checkContext(context, true);
+ }
+ } else if (ctxIds.length != 0) {
+ // expand all to realize tree items
+ getThreadViewer().expandAll();
+ for (int i = 0; i < ctxIds.length; i++) {
+ Context ctx = getContext(ctxIds[i]);
+ if (ctx != null) {
+ fCheckHandler.checkContext(ctx, true);
+ fCheckHandler.updateParentCheckState(ctx);
+ }
+ }
+ // expand checked items only
+ getThreadViewer().setExpandedElements(getThreadViewer().getCheckedElements());
+ }
+ }
+
+ private Context getContainer(Context child) {
+ return getContext(child.fParentId);
+ }
+
+ private Context getContext(String id) {
+ for (Context ctx : fContexts) {
+ if (ctx.fId.equals(id))
+ return ctx;
+ }
+ return null;
+ }
+
+ protected void doStore() {
+ CheckboxTreeViewer viewer = getThreadViewer();
+ Object[] elements = viewer.getCheckedElements();
+ String[] threadIds;
+ if (elements.length == fContexts.size()) {
+ threadIds = null;
+ } else {
+ List<String> checkedIds = new ArrayList<String>();
+ for (int i = 0; i < elements.length; ++i) {
+ Context ctx = (Context) elements[i];
+ if (!viewer.getGrayed(ctx)) {
+ checkedIds.add(ctx.fId);
+ }
+ }
+ threadIds = (String[]) checkedIds.toArray(new String[checkedIds.size()]);
+ }
+ TCFBreakpointScopeExtension filterExtension = fPage.getFilterExtension();
+ if (filterExtension == null) {
+ return;
+ }
+ filterExtension.setThreadFilter(threadIds);
+ DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(fPage.getBreakpoint());
+ }
+
+ private Context[] syncGetContainers(final TCFLaunch launch) {
+ Context[] result = fContainersPerLaunch.get(launch);
+ if (result != null) {
+ return result;
+ }
+ result = new TCFTask<Context[]>() {
+ public void run() {
+ List<Context> containers = new ArrayList<Context>();
+ TCFModel model = TCFModelManager.getModelManager().getModel(launch);
+ TCFChildren children = model.getRootNode().getChildren();
+ if (!children.validate(this)) return;
+ Map<String, TCFNode> childMap = children.getData();
+ for (TCFNode node : childMap.values()) {
+ if (node instanceof TCFNodeExecContext) {
+ TCFNodeExecContext exeCtx = (TCFNodeExecContext) node;
+ TCFDataCache<IRunControl.RunControlContext> runCtxCache = exeCtx.getRunContext();
+ if (!runCtxCache.validate(this)) return;
+ IRunControl.RunControlContext runCtx = runCtxCache.getData();
+ containers.add(new Context(runCtx));
+ }
+ }
+ done((Context[]) containers.toArray(new Context[containers.size()]));
+ }
+ }.getE();
+ fContexts.addAll(Arrays.asList(result));
+ fContainersPerLaunch.put(launch, result);
+ return result;
+ }
+
+ private Context[] syncGetThreads(final Context container) {
+ Context[] result = fContextsPerContainer.get(container);
+ if (result != null) {
+ return result;
+ }
+ final TCFLaunch launch = getLaunch(container);
+ result = new TCFTask<Context[]>() {
+ public void run() {
+ List<Context> contexts = new ArrayList<Context>();
+ TCFModel model = TCFModelManager.getModelManager().getModel(launch);
+ TCFChildren children = ((TCFNodeExecContext) model.getNode(container.fId)).getChildren();
+ if (!children.validate(this)) return;
+ Map<String, TCFNode> childMap = children.getData();
+ for (TCFNode node : childMap.values()) {
+ if (node instanceof TCFNodeExecContext) {
+ TCFNodeExecContext exeCtx = (TCFNodeExecContext) node;
+ TCFDataCache<IRunControl.RunControlContext> runCtxCache = exeCtx.getRunContext();
+ if (!runCtxCache.validate(this)) return;
+ IRunControl.RunControlContext runCtx = runCtxCache.getData();
+ contexts.add(new Context(runCtx));
+ }
+ }
+ done((Context[]) contexts.toArray(new Context[contexts.size()]));
+ }
+ }.getE();
+ fContextsPerContainer.put(container, result);
+ fContexts.addAll(Arrays.asList(result));
+ return result;
+ }
+
+ private TCFLaunch getLaunch(Context container) {
+ Context parent = getContainer(container);
+ while (parent != null) {
+ container = parent;
+ parent = getContainer(container);
+ }
+ for (TCFLaunch launch : fContainersPerLaunch.keySet()) {
+ Context[] containers = fContainersPerLaunch.get(launch);
+ for (Context context : containers) {
+ if (context.fId.equals(container.fId)) {
+ return launch;
+ }
+ }
+ }
+ return null;
+ }
+
+}

Back to the top