Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-07-04 08:35:04 +0000
committerTobias Schwarz2014-07-04 08:36:56 +0000
commit8f170df14be2719dcc29ad8ec494fb8e3681478b (patch)
tree36434f94f665ab7e9928ef8a1717945f6bdff935 /target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper
parent0b339905fc0ae6af00d98467d521a86033f8f75c (diff)
downloadorg.eclipse.tcf-8f170df14be2719dcc29ad8ec494fb8e3681478b.tar.gz
org.eclipse.tcf-8f170df14be2719dcc29ad8ec494fb8e3681478b.tar.xz
org.eclipse.tcf-8f170df14be2719dcc29ad8ec494fb8e3681478b.zip
Target Explorer: add steps for channel manager rework
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/StepperAttributeUtil.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java32
2 files changed, 37 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/StepperAttributeUtil.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/StepperAttributeUtil.java
index 798836236..0ef68d438 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/StepperAttributeUtil.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/StepperAttributeUtil.java
@@ -147,8 +147,7 @@ public class StepperAttributeUtil {
* @param fullQualifiedId The full qualified id for this step.
* @param data The data.
* @param value The new value.
- * @param share When <code>true</code>, the value is also stored within the parent full
- * qualified id to share the value with other steps within the same parent (group).
+ * @param share If <code>true</code>, the value is also stored without the full qualified id.
* @return <code>true</code> if the value was set.
*/
public final static boolean setProperty(String key, IFullQualifiedId fullQualifiedId, IPropertiesContainer data, Object value, boolean share) {
@@ -182,8 +181,7 @@ public class StepperAttributeUtil {
* @param fullQualifiedId The full qualified id for this step.
* @param data The data.
* @param value The new boolean value.
- * @param share When <code>true</code>, the value is also stored within the parent full
- * qualified id to share the value with other steps within the same parent (group).
+ * @param share If <code>true</code>, the value is also stored without the full qualified id.
* @return <code>true</code> if the value was set.
*/
public final static boolean setProperty(String key, IFullQualifiedId fullQualifiedId, IPropertiesContainer data, boolean value, boolean share) {
@@ -191,7 +189,7 @@ public class StepperAttributeUtil {
Assert.isNotNull(data);
if (share && fullQualifiedId != null) {
- data.setProperty(getFullQualifiedKey(key, fullQualifiedId.getParentId(), data), value);
+ data.setProperty(getFullQualifiedKey(key, null, data), value);
}
return data.setProperty(getFullQualifiedKey(key, fullQualifiedId, data), value);
}
@@ -217,8 +215,7 @@ public class StepperAttributeUtil {
* @param fullQualifiedId The full qualified id for this step.
* @param data The data.
* @param value The new int value.
- * @param share When <code>true</code>, the value is also stored within the parent full
- * qualified id to share the value with other steps within the same parent (group).
+ * @param share If <code>true</code>, the value is also stored without the full qualified id.
* @return <code>true</code> if the value was set.
*/
public final static boolean setProperty(String key, IFullQualifiedId fullQualifiedId, IPropertiesContainer data, int value, boolean share) {
@@ -226,7 +223,7 @@ public class StepperAttributeUtil {
Assert.isNotNull(data);
if (share && fullQualifiedId != null) {
- data.setProperty(getFullQualifiedKey(key, fullQualifiedId.getParentId(), data), value);
+ data.setProperty(getFullQualifiedKey(key, null, data), value);
}
return data.setProperty(getFullQualifiedKey(key, fullQualifiedId, data), value);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java
index 1e403d8bf..2abfb226f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/utils/StepperHelper.java
@@ -10,7 +10,9 @@
package org.eclipse.tcf.te.runtime.stepper.utils;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.persistence.utils.DataHelper;
@@ -53,6 +55,7 @@ public final class StepperHelper {
}
if (stepGroupId != null && stepContext != null) {
+ scheduleStepperJob(stepContext, stepGroupId, name, histData, isCancelable, callback, monitor);
StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
stepContext,
data,
@@ -71,4 +74,33 @@ public final class StepperHelper {
}
}
+
+ public static final void scheduleStepperJob(Object context, String stepGroupId, String jobName, IPropertiesContainer data, boolean isCancelable, ICallback callback, IProgressMonitor monitor) {
+ IStepContext stepContext = null;
+ if (context instanceof IStepContext) {
+ stepContext = (IStepContext)context;
+ }
+ else if (context instanceof IAdaptable) {
+ stepContext = (IStepContext)((IAdaptable)context).getAdapter(IStepContext.class);
+ }
+ if (stepContext == null && context != null) {
+ stepContext = (IStepContext)Platform.getAdapterManager().getAdapter(context, IStepContext.class);
+ }
+
+ StepperJob job = new StepperJob(jobName != null ? jobName : "", //$NON-NLS-1$
+ stepContext,
+ data,
+ stepGroupId,
+ stepGroupId,
+ isCancelable,
+ monitor == null);
+ job.setJobCallback(callback);
+
+ if (monitor != null) {
+ job.run(monitor);
+ }
+ else {
+ job.schedule();
+ }
+ }
}

Back to the top