Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-11-21 05:36:45 -0500
committerTobias Schwarz2013-11-21 05:36:45 -0500
commitdab1611d5bc60d095cbe8e3fdfe0efe7bde9de3a (patch)
tree44c0ca3a0315fe49d5acf04c1bd27984acfd0cbf /target_explorer
parent2e7cb57c2e295a0fb8cf301bb2200c1f567c7683 (diff)
downloadorg.eclipse.tcf-dab1611d5bc60d095cbe8e3fdfe0efe7bde9de3a.tar.gz
org.eclipse.tcf-dab1611d5bc60d095cbe8e3fdfe0efe7bde9de3a.tar.xz
org.eclipse.tcf-dab1611d5bc60d095cbe8e3fdfe0efe7bde9de3a.zip
Target Explorer: fix problems with group reference parameters not
forwarded to steps
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroup.java107
2 files changed, 94 insertions, 47 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
index 601b4246e..c792adc74 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
@@ -12,6 +12,7 @@ package org.eclipse.tcf.te.runtime.stepper.extensions;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -50,6 +51,9 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
private final List<ReferenceSubElement> references = new ArrayList<ReferenceSubElement>();
+ // Map of parameters of the step reference
+ private Map<String,String> parameters = new HashMap<String,String>();
+
private ExecutableExtensionProxy<IStepGroupIterator> iteratorProxy = null;
/**
@@ -861,11 +865,17 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
protected IExecutableExtension getCandidate(String id, ReferenceSubElement reference) {
Assert.isNotNull(id);
IExecutableExtension candidate = StepperManager.getInstance().getStepExtManager().getStep(id, true);
+ Map<String,String> parameters = new HashMap<String, String>();
+ parameters.putAll(getParameters());
+ if (reference != null) {
+ parameters.putAll(reference.getParameters());
+ }
if (candidate == null) {
candidate = StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, true);
+ ((IStepGroup)candidate).setParameters(parameters);
}
else if (reference != null && candidate instanceof IStep) {
- ((IStep)candidate).setParameters(reference.getParameters());
+ ((IStep)candidate).setParameters(parameters);
}
return candidate;
}
@@ -913,4 +923,26 @@ public class StepGroup extends ExecutableExtension implements IStepGroup {
public IStepGroupIterator getStepGroupIterator() {
return iteratorProxy != null ? iteratorProxy.newInstance() : null;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#setParameters(java.util.Map)
+ */
+ @Override
+ public void setParameters(Map<String,String> parameters) {
+ if (parameters != null) {
+ this.parameters = parameters;
+ }
+ else {
+ this.parameters = Collections.EMPTY_MAP;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#getParameters()
+ */
+ @Override
+ public Map<String, String> getParameters() {
+ return parameters;
+ }
+
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroup.java
index 7ac8e26b1..8ea36ab52 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroup.java
@@ -1,46 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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.tcf.te.runtime.stepper.interfaces;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
-
-
-/**
- * A step group.
- * <p>
- * A step group is a set of single steps or other step groups.
- */
-public interface IStepGroup extends IExecutableExtension {
-
- /**
- * Returns if or if not the step group is locked for user modifications.
- *
- * @return <code>True</code> if locked for user modifications, <code>false</code> otherwise.
- */
- public boolean isLocked();
-
- /**
- * Returns the list of steps or step groups enlisted and enabled in the group for the
- * given context.
- *
- * @param context The step context object. Must not be <code>null</code>.
- * @return The list of steps and step groups or an empty array.
- *
- * @throws CoreException If the steps cannot be determined.
- */
- public IStepGroupable[] getSteps(IStepContext context) throws CoreException;
-
- /**
- * Return the step group iterator or <code>null</code>. The step group iterator can be used to
- * generate loops and conditions for a step group.
- */
- public IStepGroupIterator getStepGroupIterator();
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 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.tcf.te.runtime.stepper.interfaces;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+
+
+/**
+ * A step group.
+ * <p>
+ * A step group is a set of single steps or other step groups.
+ */
+public interface IStepGroup extends IExecutableExtension {
+
+ /**
+ * Returns if or if not the step group is locked for user modifications.
+ *
+ * @return <code>True</code> if locked for user modifications, <code>false</code> otherwise.
+ */
+ public boolean isLocked();
+
+ /**
+ * Returns the list of steps or step groups enlisted and enabled in the group for the
+ * given context.
+ *
+ * @param context The step context object. Must not be <code>null</code>.
+ * @return The list of steps and step groups or an empty array.
+ *
+ * @throws CoreException If the steps cannot be determined.
+ */
+ public IStepGroupable[] getSteps(IStepContext context) throws CoreException;
+
+ /**
+ * Return the step group iterator or <code>null</code>. The step group iterator can be used to
+ * generate loops and conditions for a step group.
+ */
+ public IStepGroupIterator getStepGroupIterator();
+
+
+ /**
+ * Set additional parameters for this step
+ * @param parameters
+ */
+ public void setParameters(Map<String,String> parameters);
+
+ /**
+ * Returns a map of additional parameters given through the parameters section in the Reference section of a StepGroups.
+ * @return The parameters of an empty Map.
+ */
+ public Map<String,String> getParameters();
+}

Back to the top